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