Vector of four Float values x, y, z and w.
// constructing
var a = new Vec4(1, 2, 3.0, 3.14);
var b:Vec4 = { x:2, y:4, z:5, w:6 };
var c:Vec4 = [ 1, 2, 3.0, 3.14 ];
// access values
trace(a.w); // 3.14
a.y = 42;
trace( b.length ); // 9
.length calculates the current vector-length (same by casting the vector to a Float).
Operations:
+, - between two vectors results in a new Vec4, while * (dot product) results in a Float.
* and / between a Vec4 and a Float results in a new (stretched or compressed) Vec4.
Comparing vectors:
>, <, >=, <= results into comparing the lengths of the vectors.
a.isEqual(b) can be used to compare two vectors a and b for value-equality.
Static variables
Static methods
staticinlinecopyFrom(this:Vec4Impl, v:Vec4):Vec4
Copyes the values of another inside this vector and returns its reference.
staticinlinenormalize(this:Vec4Impl):Vec4
Normalizes the values of this vector and returns its reference.