|
Drag[en]gine Script Module DragonScript 1.35
|
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 all components clamped to a range of two vectors.
References compDivide().
Referenced by isAtMost().
Combine selected components of this vector with another.
For each component use this vector if value is true otherwise use vector component.
References absolute().
Referenced by round().
| 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.
References normalize().
Referenced by round().
| bool Dragengine.Scenery.Vector.equals | ( | Object | other | ) |
Vector is equal to another object.
Implements Object.equals(Object).
References round().
Referenced by operator-().
| float Dragengine.Scenery.Vector.get | ( | int | component | ) |
Component (0=X, 1=Y, 2=Z).
Referenced by getLengthSquared().
| float Dragengine.Scenery.Vector.getLength | ( | ) |
| float Dragengine.Scenery.Vector.getLengthSquared | ( | ) |
| float Dragengine.Scenery.Vector.getX | ( | ) |
X-Component.
Referenced by getY().
| float Dragengine.Scenery.Vector.getZ | ( | ) |
| int Dragengine.Scenery.Vector.hashCode | ( | ) |
| bool Dragengine.Scenery.Vector.isAtLeast | ( | float | value | ) |
All coordinates are at least of a minimal value.
Referenced by toString().
| bool Dragengine.Scenery.Vector.isAtMost | ( | float | value | ) |
| bool Dragengine.Scenery.Vector.isEqualTo | ( | Vector | v, |
| float | delta ) |
| bool Dragengine.Scenery.Vector.isZero | ( | ) |
Vector with all components set to the largest value of two vectors.
References compMultiply().
Referenced by isEqualTo().
Mix vector with another component wise.
Factor 0 uses this vector, factor 1 the other vector.
References smallest().
Referenced by toString().
| Vector Dragengine.Scenery.Vector.new | ( | ) |
| Vector Dragengine.Scenery.Vector.new | ( | float | x, |
| float | y, | ||
| float | z ) |
Create vector using the specified components.
References new().
| Vector Dragengine.Scenery.Vector.normalize | ( | ) |
Vector divided by length().
| EDivisionByZero | Length is 0. |
References getLength().
Referenced by compSelect().
Cross-Product between two vectors.
References toString().
| Vector Dragengine.Scenery.Vector.operator* | ( | float | scalar | ) |
Vector scaled by scalar.
References hashCode().
| float Dragengine.Scenery.Vector.operator* | ( | Vector | v | ) |
Dot-Product between two vectors.
| Vector Dragengine.Scenery.Vector.operator- | ( | ) |
Negated vector.
Difference of two vectors.
References equals().
| 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.
References readFromFile(), toString(), and writeToFile().
|
static |
| Point3 Dragengine.Scenery.Vector.round | ( | ) |
| Vector Dragengine.Scenery.Vector.round | ( | float | unit | ) |
| String Dragengine.Scenery.Vector.toString | ( | ) |
String representation of vector.
Implements Object.toString()
References isEqualTo(), and mix().
Referenced by operator%(), and operator>=().
| 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. |
References isAtLeast().
| void Dragengine.Scenery.Vector.writeToFile | ( | FileWriter | writer | ) |