[WiP] <RetVar> = <RetObj> get rot alpha

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Post Reply
User avatar
EmperorJon
Posts: 7178
Joined: Mon, 29. Dec 08, 21:58
x3tc

[WiP] <RetVar> = <RetObj> get rot alpha

Post by EmperorJon » Fri, 10. Sep 10, 11:01

<RetVar> = <RetObj> get rot alpha

<RetVar> = The variable where the requested information is put.
<RefObj> = The object to check for the information.

Checks the alpha rotation value of the object and writes it as a numeric variable.

Rotation is out of 65536. (0-360 degrees with 65536 being 360, which is of course the same as 0.)

Alpha is Yaw, Beta is Pitch and Gamma is Roll.

For Ships:

- Alpha and Beta are for the direction the Ship is looking to
- Gamma is for the Rotation around the own axis of a Ship
- Alpha is for the Rotation on the ecliptic level (or when gamma = 0 left and right)
- Beta is for the rotation up and down from the ecliptic (or when gamma = 0 )

Example:

$PlayRotA = [PLAYERSHIP] get rot alpha
$PlayRotB = [PLAYERSHIP] get rot beta
$PlayRotG = [PLAYERSHIP] get rot gamma

Would find the exact direction your ship is facing.


Command Location:
Last edited by EmperorJon on Wed, 22. Sep 10, 17:08, edited 2 times in total.

User avatar
Ketraar
Moderator (DevNet)
Moderator (DevNet)
Posts: 9028
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Fri, 10. Sep 10, 12:30

mark_a_condren wrote:nice to find out what the value is, degrees or whatever
According to KlausM 65536 = 360º
Assuming that's the value output you get (only looked in X3Editor) one can safely say that
$PlayRotA*360/65536=rotation in degrees.

MFG

Ketraar
Image

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13931
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Fri, 10. Sep 10, 15:24

@Ketraar
confirmed, i have used these Values often enough ;)
btw: the integrated Sin/Cos-functions of the SE are working in this range, too (so 0° to 360° is translated to 0 to 65536 and the output 0,0 to 1,0 is translated to 0 to 65536) so you can use them almost directly with these commands.



and here my informations for the Rot commands:

For Ships:

- Alpha and Beta are for the direction the Ship is looking to
- Gamma is for the Rotation around the own axis of a Ship
- Alpha is for the Rotation on the ecliptic level (or when gamma = 0 left and right)
- Beta is for the rotation up and down from the ecliptic (or when gamma = 0 )
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Wed, 22. Sep 10, 14:53

Sorry just to correct everyone, the rotations are between 0 and 65 536-1
(as 65 536 == 0)

I think it would also be good to mention
alpha - yaw - right/left (I may have this flip-ed around, it might be left/right)
beta - pitch -up/down
gamma- roll- spin clockwise/anticlockwise

-slightly off topic
The order of rotation is alpha, then beta, then gamma
(in a 3d+ space, rotations are non commutative, i.e. order IS important)

Post Reply

Return to “MSCI Reference”