Drag[en]gine Script Module DragonScript
1.21
|
Immutable 4-component quaternion. More...
Public Member Functions | |
Management | |
float | getX () |
X-Component. More... | |
float | getY () |
Y-Component. More... | |
float | getZ () |
Z-Component. More... | |
float | getW () |
W-Component. More... | |
float | get (int component) |
Component by index (0=X, 1=Y, 2=Z, 3=W). More... | |
float | getLength () |
Length. More... | |
Quaternion | normalize () |
Quaternion divided by length(). More... | |
Quaternion | conjugate () |
Conjugated quaternion. More... | |
Quaternion | absolute () |
Absolute quaternion. More... | |
Vector | getEulerAngles () |
Euler angles matching quaternion rotation. More... | |
Quaternion | slerp (Quaternion other, float factor) |
Slerp quaternion with another quaternion. More... | |
bool | isEqualTo (Quaternion q, float threshold) |
Two quaternions are equal. More... | |
bool | equals (Object other) |
Quaternion is equal to another object. More... | |
int | hashCode () |
Hash code for use as dictionary keys. More... | |
String | toString () |
String representation of quaternion. More... | |
String | toString (int precision) |
String representation of quaternion with precision. More... | |
Operators | |
Quaternion | operator- () |
Returns the negated of quaternion. More... | |
Quaternion | operator+ (Quaternion quaternion) |
Returns the sum of quaternion with another Quaternion. More... | |
Quaternion | operator- (Quaternion quaternion) |
Returns the difference of quaternion and another Quaternion. More... | |
Quaternion | operator* (float scalar) |
Returns quaternion multiplied by a factor. More... | |
Quaternion | operator/ (float scalar) |
Returns quaternion divided by a factor. More... | |
Quaternion | operator* (Quaternion quaternion) |
Returns quaternion multiplication. More... | |
Vector | operator* (Vector vector) |
Rotate vector by quaternion. More... | |
DVector | operator* (DVector vector) |
Rotate vector by quaternion. More... | |
Constructors | |
Quaternion | new () |
Create quaternion with components set to (0,0,0,1). More... | |
Quaternion | new (float x, float y, float z, float w) |
Create quaternion from values. More... | |
Quaternion | new (Quaternion q) |
Create copy of quaternion. More... | |
static Quaternion | newFromEuler (float rx, float ry, float rz) |
Create quaternion from euler angles. More... | |
static Quaternion | newFromEuler (Vector angles) |
Create quaternion from euler angles. More... | |
static Quaternion | newFromEulerX (float angle) |
Create quaternion from an euler angle around the x axis. More... | |
static Quaternion | newFromEulerY (float angle) |
Create quaternion from an euler angle around the y axis. More... | |
static Quaternion | newFromEulerZ (float angle) |
Create quaternion from an euler angle around the z axis. More... | |
static Quaternion | newFromAxis (Vector axis, float angle) |
Create quaternion from axis and angle around the axis. More... | |
File Handling | |
void | writeToFile (FileWriter writer) |
Write quaternion to a file writer. More... | |
static Quaternion | readFromFile (FileReader reader) |
Read quaternion from a file reader. More... | |
Immutable 4-component quaternion.
This is a native class. It can not be subclassed.
Quaternion Dragengine.Scenery.Quaternion.absolute | ( | ) |
Absolute quaternion.
Quaternion Dragengine.Scenery.Quaternion.conjugate | ( | ) |
Conjugated quaternion.
bool Dragengine.Scenery.Quaternion.equals | ( | Object | other | ) |
Quaternion is equal to another object.
Implements Object.equals(Object).
float Dragengine.Scenery.Quaternion.get | ( | int | component | ) |
Component by index (0=X, 1=Y, 2=Z, 3=W).
Vector Dragengine.Scenery.Quaternion.getEulerAngles | ( | ) |
Euler angles matching quaternion rotation.
Result is only correct if the quaternion is normalized.
float Dragengine.Scenery.Quaternion.getLength | ( | ) |
Length.
float Dragengine.Scenery.Quaternion.getW | ( | ) |
W-Component.
float Dragengine.Scenery.Quaternion.getX | ( | ) |
X-Component.
float Dragengine.Scenery.Quaternion.getY | ( | ) |
Y-Component.
float Dragengine.Scenery.Quaternion.getZ | ( | ) |
Z-Component.
int Dragengine.Scenery.Quaternion.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
bool Dragengine.Scenery.Quaternion.isEqualTo | ( | Quaternion | q, |
float | threshold | ||
) |
Two quaternions are equal.
Quaternion Dragengine.Scenery.Quaternion.new | ( | ) |
Create quaternion with components set to (0,0,0,1).
Quaternion Dragengine.Scenery.Quaternion.new | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Create quaternion from values.
Quaternion Dragengine.Scenery.Quaternion.new | ( | Quaternion | q | ) |
Create copy of quaternion.
|
static |
Create quaternion from axis and angle around the axis.
|
static |
Create quaternion from euler angles.
|
static |
Create quaternion from euler angles.
|
static |
Create quaternion from an euler angle around the x axis.
|
static |
Create quaternion from an euler angle around the y axis.
|
static |
Create quaternion from an euler angle around the z axis.
Quaternion Dragengine.Scenery.Quaternion.normalize | ( | ) |
Quaternion divided by length().
EDivisionByZero | Length is 0. |
Quaternion Dragengine.Scenery.Quaternion.operator* | ( | float | scalar | ) |
Returns quaternion multiplied by a factor.
Quaternion Dragengine.Scenery.Quaternion.operator* | ( | Quaternion | quaternion | ) |
Returns quaternion multiplication.
If both quaternions are unit quaternions this operation equals applying the rotation of quaternion to the rotation of this quaternion.
Quaternion Dragengine.Scenery.Quaternion.operator+ | ( | Quaternion | quaternion | ) |
Returns the sum of quaternion with another Quaternion.
Quaternion Dragengine.Scenery.Quaternion.operator- | ( | ) |
Returns the negated of quaternion.
Quaternion Dragengine.Scenery.Quaternion.operator- | ( | Quaternion | quaternion | ) |
Returns the difference of quaternion and another Quaternion.
Quaternion Dragengine.Scenery.Quaternion.operator/ | ( | float | scalar | ) |
Returns quaternion divided by a factor.
EDivisionByZero | scalar is 0. |
|
static |
Read quaternion from a file reader.
Quaternion Dragengine.Scenery.Quaternion.slerp | ( | Quaternion | other, |
float | factor | ||
) |
Slerp quaternion with another quaternion.
String Dragengine.Scenery.Quaternion.toString | ( | ) |
String representation of quaternion.
Implements Object.toString()
String Dragengine.Scenery.Quaternion.toString | ( | int | precision | ) |
String representation of quaternion with precision.
Same as toString() except the count of digits of each component is precision.
precision | Precision in digits in the range from 0 to 9 inclusive. |
EInvalidParam | precision is less than 0 or larger than 9. |
void Dragengine.Scenery.Quaternion.writeToFile | ( | FileWriter | writer | ) |
Write quaternion to a file writer.