Drag[en]gine Script Module DragonScript
1.23
|
Immutable 3-component double precision vector. More...
Public Member Functions | |
Constructors | |
Vector | new () |
Create vector with all components set to 0. More... | |
Vector | new (float x, float y, float z) |
Create vector using the specified components. More... | |
Vector | new (Vector v) |
Create DVetor from Vector. More... | |
Management | |
float | getX () |
X-Component. More... | |
float | getY () |
Y-Component. More... | |
float | getZ () |
Z-Component. More... | |
float | get (int component) |
Component (0=X, 1=Y, 2=Z). More... | |
float | getLength () |
Length. More... | |
float | getLengthSquared () |
Squared length. More... | |
Vector | normalize () |
Vector divided by length(). More... | |
Vector | absolute () |
Vector with absolute value of each component. More... | |
Vector | compMultiply (Vector v) |
Component wise multiplication. More... | |
Vector | compDivide (Vector v) |
Component wise division. More... | |
Vector | compSelect (bool x, bool y, bool z) |
Vector with components set to true copied while all others are set to 0. More... | |
Vector | combine (Vector vector, bool x, bool y, bool z) |
Combine selected components of this vector with another. More... | |
Vector | smallest (Vector v) |
Vector with all components set to the smallest value of two vectors. More... | |
Vector | largest (Vector v) |
Vector with all components set to the largest value of two vectors. More... | |
Vector | clamped (Vector min, Vector max) |
Vector with all components clamped to a range of two vectors. More... | |
Point3 | round () |
Components rounded to nearest integer value. More... | |
Vector | round (float unit) |
Components rounded to the nearest unit. More... | |
Vector | mix (Vector other, float factor) |
Mix vector with another component wise. More... | |
bool | isEqualTo (Vector v, float delta) |
Two vectors are equal. More... | |
bool | isAtLeast (float value) |
All coordinates are at least of a minimal value. More... | |
bool | isAtMost (float value) |
All coordinates are at most of a maximal value. More... | |
bool | isZero () |
Vector is equal to zero vector. More... | |
bool | equals (Object other) |
Vector is equal to another object. More... | |
int | hashCode () |
Hash code for use as dictionary keys. More... | |
String | toString () |
String representation of vector. More... | |
String | toString (int precision) |
String representation of vector with precision. More... | |
Operators | |
Vector | operator- () |
Negated vector. More... | |
Vector | operator+ (Vector v) |
Sum of two vectors. More... | |
Vector | operator- (Vector v) |
Difference of two vectors. More... | |
Vector | operator* (float scalar) |
Vector scaled by scalar. More... | |
Vector | operator/ (float scalar) |
Vector with each component divided by a value. More... | |
float | operator* (Vector v) |
Dot-Product between two vectors. More... | |
Vector | operator% (Vector v) |
Cross-Product between two vectors. More... | |
bool | operator< (Vector v) |
Vector is less than another vector in all components. More... | |
bool | operator<= (Vector v) |
Vector is less than or equal to another vector in all components. More... | |
bool | operator> (Vector v) |
Vector is greater than another vector in all components. More... | |
bool | operator>= (Vector v) |
Vector is greater than or equal to another vector in all components. More... | |
File Handling | |
void | writeToFile (FileWriter writer) |
Write vector to a file writer. More... | |
static Vector | readFromFile (FileReader reader) |
Read vector from a file reader. More... | |
Immutable 3-component double precision vector.
This is a native class. It can not be subclassed.
Vector with all components clamped to a range of two vectors.
Combine selected components of this vector with another.
For each component use this vector if value is true otherwise use vector component.
Vector Dragengine.Scenery.Vector.compSelect | ( | bool | x, |
bool | y, | ||
bool | z | ||
) |
Vector with components set to true copied while all others are set to 0.
bool Dragengine.Scenery.Vector.equals | ( | Object | other | ) |
float Dragengine.Scenery.Vector.get | ( | int | component | ) |
Component (0=X, 1=Y, 2=Z).
float Dragengine.Scenery.Vector.getLength | ( | ) |
Length.
float Dragengine.Scenery.Vector.getLengthSquared | ( | ) |
Squared length.
float Dragengine.Scenery.Vector.getX | ( | ) |
X-Component.
float Dragengine.Scenery.Vector.getY | ( | ) |
Y-Component.
float Dragengine.Scenery.Vector.getZ | ( | ) |
Z-Component.
int Dragengine.Scenery.Vector.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
bool Dragengine.Scenery.Vector.isAtLeast | ( | float | value | ) |
All coordinates are at least of a minimal value.
bool Dragengine.Scenery.Vector.isAtMost | ( | float | value | ) |
All coordinates are at most of a maximal value.
bool Dragengine.Scenery.Vector.isEqualTo | ( | Vector | v, |
float | delta | ||
) |
Two vectors are equal.
bool Dragengine.Scenery.Vector.isZero | ( | ) |
Vector is equal to zero vector.
Vector with all components set to the largest value of two vectors.
Mix vector with another component wise.
Factor 0 uses this vector, factor 1 the other vector.
Vector Dragengine.Scenery.Vector.new | ( | ) |
Create vector with all components set to 0.
Vector Dragengine.Scenery.Vector.new | ( | float | x, |
float | y, | ||
float | z | ||
) |
Create vector using the specified components.
Vector Dragengine.Scenery.Vector.normalize | ( | ) |
Vector divided by length().
EDivisionByZero | Length is 0. |
float Dragengine.Scenery.Vector.operator* | ( | Vector | v | ) |
Dot-Product between two vectors.
Vector Dragengine.Scenery.Vector.operator- | ( | ) |
Negated vector.
Vector Dragengine.Scenery.Vector.operator/ | ( | float | scalar | ) |
Vector with each component divided by a value.
EDivisionByZero | scalar is 0. |
bool Dragengine.Scenery.Vector.operator< | ( | Vector | v | ) |
Vector is less than another vector in all components.
bool Dragengine.Scenery.Vector.operator<= | ( | Vector | v | ) |
Vector is less than or equal to another vector in all components.
bool Dragengine.Scenery.Vector.operator> | ( | Vector | v | ) |
Vector is greater than another vector in all components.
bool Dragengine.Scenery.Vector.operator>= | ( | Vector | v | ) |
Vector is greater than or equal to another vector in all components.
|
static |
Read vector from a file reader.
Point3 Dragengine.Scenery.Vector.round | ( | ) |
Components rounded to nearest integer value.
Vector Dragengine.Scenery.Vector.round | ( | float | unit | ) |
Components rounded to the nearest unit.
Vector with all components set to the smallest value of two vectors.
String Dragengine.Scenery.Vector.toString | ( | ) |
String representation of vector.
Implements Object.toString()
String Dragengine.Scenery.Vector.toString | ( | int | precision | ) |
String representation of vector 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.Vector.writeToFile | ( | FileWriter | writer | ) |
Write vector to a file writer.