|
Drag[en]gine Script Module DragonScript 1.32.1
|
Immutable 4-component quaternion. More...
Public Member Functions | |
Management | |
| float | getX () |
| X-Component. | |
| float | getY () |
| Y-Component. | |
| float | getZ () |
| Z-Component. | |
| float | getW () |
| W-Component. | |
| float | get (int component) |
| Component by index (0=X, 1=Y, 2=Z, 3=W). | |
| float | getLength () |
| Length. | |
| Quaternion | normalize () |
| Quaternion divided by length(). | |
| Quaternion | conjugate () |
| Conjugated quaternion. | |
| Quaternion | absolute () |
| Absolute quaternion. | |
| Vector | getEulerAngles () |
| Euler angles matching quaternion rotation. | |
| Quaternion | slerp (Quaternion other, float factor) |
| Slerp quaternion with another quaternion. | |
| bool | isEqualTo (Quaternion q, float threshold) |
| Two quaternions are equal. | |
| bool | equals (Object other) |
| Quaternion is equal to another object. | |
| int | hashCode () |
| Hash code for use as dictionary keys. | |
| String | toString () |
| String representation of quaternion. | |
| String | toString (int precision) |
| String representation of quaternion with precision. | |
Operators | |
| Quaternion | operator- () |
| Returns the negated of quaternion. | |
| Quaternion | operator+ (Quaternion quaternion) |
| Returns the sum of quaternion with another Quaternion. | |
| Quaternion | operator- (Quaternion quaternion) |
| Returns the difference of quaternion and another Quaternion. | |
| Quaternion | operator* (float scalar) |
| Returns quaternion multiplied by a factor. | |
| Quaternion | operator/ (float scalar) |
| Returns quaternion divided by a factor. | |
| Quaternion | operator* (Quaternion quaternion) |
| Returns quaternion multiplication. | |
| Vector | operator* (Vector vector) |
| Rotate vector by quaternion. | |
| DVector | operator* (DVector vector) |
| Rotate vector by quaternion. | |
Constructors | |
| Quaternion | new () |
| Create quaternion with components set to (0,0,0,1). | |
| Quaternion | new (float x, float y, float z, float w) |
| Create quaternion from values. | |
| Quaternion | new (Quaternion q) |
| Create copy of quaternion. | |
| static Quaternion | newFromEuler (float rx, float ry, float rz) |
| Create quaternion from euler angles. | |
| static Quaternion | newFromEuler (Vector angles) |
| Create quaternion from euler angles. | |
| static Quaternion | newFromEulerX (float angle) |
| Create quaternion from an euler angle around the x axis. | |
| static Quaternion | newFromEulerY (float angle) |
| Create quaternion from an euler angle around the y axis. | |
| static Quaternion | newFromEulerZ (float angle) |
| Create quaternion from an euler angle around the z axis. | |
| static Quaternion | newFromAxis (Vector axis, float angle) |
| Create quaternion from axis and angle around the axis. | |
File Handling | |
| void | writeToFile (FileWriter writer) |
| Write quaternion to a file writer. | |
| static Quaternion | readFromFile (FileReader reader) |
| Read quaternion from a file reader. | |
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.