Share

Rotation expressions

The following expressions are used for rotation functions:

3 POINTS ROTATIONDescription
ReturnsA rotation value.
Syntaxpoint3rotation(vector1,vector2,vector3) Vector1, vector2, and vector3 are vectors that represent three discrete positions in 3D space. Example: point3rotation({0,0,0},{100,100,100},{100,0,-100})The rotation vector that this returns is: {-120,-35.26,45}.This rotation vector is derived by the axes (vector2-vector1) to spin the axes correctly on the third position vector (vector3).
ADD ROTATIONDescription
PurposeAdds two rotations. Vector1 and vector2 are vectors that represent discrete XYZ rotations.
Syntaxaddrotation(vector1,vector2)
ANGLE DIFF POINTSDescription
PurposeCalculates the angle between two vectors or points, using a supplied radius.
Syntaxanglediffpoints
ANGLE DIFF ROTATIONSDescription
PurposeCalculates the difference between the rotation of two objects. The result can be scaled and offset.
Syntaxanglediffrotations (R1, R2)
ANGULAR ACCELERATIONDescription
ReturnsThe angular acceleration of a rotation vector.
Syntaxangularacc(vector) Vector is a vector that represents an XYZ rotation.
ANGULAR SPEEDDescription
ReturnsThe angular speed of a rotation vector.
Syntaxangularspeed(vector)Vector is a vector that represents an XYZ rotation.
DERIVATIVEDescription
ReturnsThe derivative of a vector by time.
Syntaxderivative(vector)
GLOBAL TO LOCALDescription
PurposeConverts a rotation vector from global to local coordinates.
Syntaxglobaltolocal (rotation)Vector is a vector that represents a position or a speed in 3D space.
GRAVITY MOVEDescription
ReturnsA position.
Syntaxgravitymove(vector1, vector2, vector3)Vector1 is a vector that represents an initial position in 3D space.Vector2 is a vector that represents an initial speed. Vector3 is a vector that represents the acceleration that you want to give to your current position.
INTERPOLATE ROTATIONDescription
PurposeInterpolates between two rotations.
Syntaxinterpolaterotation(R1, R2)
LOCAL TO GLOBALDescription
PurposeConverts a rotation vector from local to global coordinates.
Syntaxlocaltoglobal(Rotation)
MOVEDescription
ReturnsA position.
Syntaxmove(vector1, vector2, vector3) Vector1 is a vector that represents an initial position in 3D space.Vector2 is a vector that represents an initial speed. Vector3 is a vector that represents the acceleration that you want to give to your current position.
ORBITDescription
ReturnsA position. Number is a real number that represents the acceleration constant (MorimobjG6.673E-11) between the origin and the current position (G = 6,672e-11 N m2/kg2).
Syntaxorbit(vector1, vector2, vector3, number) Vector1 is a vector that represents an initial origin position in 3D space (attractive point). Vector2 is a vector that represents the initial object position in 3D space. Vector3 is a vector that represents an initial speed of your object position.
POSITION DAMPINGDescription
ReturnsA position.Number1 is a number that represents the maximum speed. Number2 is a number that represents the maximum acceleration. Number3 is a number that represents the damping ratio. (Includes Play Mode in-connector.)
Syntaxpositiondamping(vector1, number1, number2, number3)Vector1 is a position vector in 3D space.
ROTATION DAMPINGDescription
ReturnsAn XYZ rotation. Vector1 is an XYZ rotation vector. Number1 is a number that represents the maximum angular speed.Number2 is a number that represents the maximum angular acceleration. Number3 is a number that represents the damping ratio. (Includes Play Mode in-connector.)
Syntaxrotationdamping(vector1, number1, number2, number3)
ROTATION PRODUCTDescription
ReturnsThe rotation vector multiplied by a ratio number. Number is a real number that represents a multiplication ratio.
Syntaxmultrotation(vector,number)Vector is a vector that represents an XYZ rotation.
SENSOR ROTATION HELPERDescription
Syntaxsensorrotationhelper
SUB ROTATIONDescription
PurposeSubstitutes two rotations.
Syntaxsubrotation(vector1,vector2)Vector1 and vector2 are vectors that represent discrete XYZ rotations.
SPEEDDescription
ReturnsThe speed of a position vector.
Syntaxspeed(vector)Vector is a vector that represents a position in 3D space.

Was this information helpful?