Vector of three Int values x, y and z.
// constructing
var a = new Vec3i(1, 2, 3);
var b:Vec3i = { x:1, y:2, z:2 };
var c:Vec3i = [ 1, 2, 3 ];
// access values
trace(a.z); // 3
a.y = 42;
trace( b.length ); // 3
.length calculates the current vector-length (same by casting the vector to a Float).
Operations:
+, - between two vectors results in a new Vec3i, while * (dot product) results in a Float.
* and / between a Vec3i and a Float results in a new (stretched or compressed) Vec3i.
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:Vec3iImpl, v:Vec3i):Vec3i
Copyes the values of another inside this vector and returns its reference.
staticinlinenegate(this:Vec3iImpl):Vec3i
Negates the values of this vector and returns its reference.