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