|
Drag[en]gine Script Module DragonScript 1.32.1
|
Immutable 3-component double precision vector. More...
Public Member Functions | |
Constructors | |
| DVector | new () |
| Create vector with all components set to 0. | |
| DVector | new (float x, float y, float z) |
| Create vector using the specified components. | |
| DVector | new (DVector v) |
| Create copy of a DVector. | |
| DVector | 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. | |
| DVector | normalize () |
| Vector divided by length(). | |
| DVector | absolute () |
| Vector with absolute of all components. | |
| DVector | compMultiply (DVector v) |
| Component wise multiplication. | |
| DVector | compDivide (DVector v) |
| Component wise division. | |
| DVector | compSelect (bool x, bool y, bool z) |
| Vector with components set to true copied while all others are set to 0. | |
| DVector | combine (DVector vector, bool x, bool y, bool z) |
| Combine selected components of this vector with another. | |
| DVector | smallest (DVector v) |
| Vector with all components set to the smallest value of two vectors. | |
| DVector | largest (DVector v) |
| Vector with all components set to the largest value of two vectors. | |
| DVector | clamped (DVector min, DVector max) |
| Vector with all components clamped to a range of two vectors. | |
| Vector | toVector () |
| Convert to single precision vector with possible loss of precision. | |
| Point3 | round () |
| Components rounded to nearest integer value. | |
| DVector | round (float unit) |
| Components rounded to the nearest unit. | |
| DVector | mix (DVector other, float factor) |
| Mix vector with another component wise. | |
| bool | isEqualTo (DVector 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 | |
| DVector | operator- () |
| Negated vector. | |
| DVector | operator+ (DVector v) |
| Sum of two vectors. | |
| DVector | operator- (DVector v) |
| Difference of two vectors. | |
| DVector | operator* (float scalar) |
| Vector scaled by scalar. | |
| DVector | operator/ (float scalar) |
| Vector with each component divided by a value. | |
| float | operator* (DVector v) |
| Dot-Product between two vectors. | |
| DVector | operator% (DVector v) |
| Cross-Product between two vectors. | |
| bool | operator< (DVector v) |
| Vector is less than another vector in all components. | |
| bool | operator<= (DVector v) |
| Vector is less than or equal to another vector in all components. | |
| bool | operator> (DVector v) |
| Vector is greater than another vector in all components. | |
| bool | operator>= (DVector 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 DVector | 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.
| DVector Dragengine.Scenery.DVector.absolute | ( | ) |
Vector with absolute of all components.
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 | ) |
Vector is equal to another object.
Implements Object.equals(Object).
| 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* | ( | float | scalar | ) |
Vector scaled by scalar.
| 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.