abstract hxmath.math.Vector3(Vector3Type) from Vector3Type to Vector3Type
Available on all platforms
A 3D vector.
Class Fields
function cross(a:Vector3, b:Vector3):Vector3
Cross product. The resulting vector is orthogonal to the plane defined by the input vectors.
a | |
b | |
returns | a X b |
function equals(a:Vector3, b:Vector3):Bool
Test element-wise equality between two vectors. False if one of the inputs is null and the other is not.
a | |
b | |
returns | ai == bi |
function fromArray(rawData:Array<Float>):Vector3
Construct a Vector3 from an array.
rawData | The input array. |
returns | The constructed structure. |
function lerp(a:Vector3, b:Vector3, t:Float):Vector3
Linear interpolation between two vectors.
a | The value at t = 0 |
b | The value at t = 1 |
t | A number in the range [0, 1] |
returns | The interpolated value |
function notEquals(a:Vector3, b:Vector3):Bool
Test inequality between two vectors.
a | |
b | |
returns | !(ai == bi) |
Instance Fields
function addWith(a:Vector3):Vector3
Add a vector in place. Note: += operator on Haxe abstracts does not behave this way (a new object is returned).
a | |
returns | selfi += ai |
function applyScalarFunc(func:Float ->Float):Vector3
Apply a scalar function to each element.
func | The function to apply. |
returns | The modified object. |
function copyTo(other:Vector3):Void
Copy the contents of this structure to another.
other | The target structure. |
function getArrayElement(i:Int):Float
Get an element by position.
i | The element index. |
returns | The element. |
function setArrayElement(i:Int, value:Float):Float
Set an element by position.
i | The element index. |
value | The new value. |
returns | The updated element. |
function subtractWith(a:Vector3):Vector3
Subtract a vector in place. Note: -= operator on Haxe abstracts does not behave this way (a new object is returned).
a | |
returns | selfi -= ai |