A Vector2 object represents a fixed length array with 2 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
A Vector3 object represents a fixed length array with 3 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
A Vector4 object represents a fixed length array with 4 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Planes
Planes are represented with a Vector4 object. The first 3 components are the normal of the plane and the fourth component is its distance, in the direction of the normal, from the origin.
A AABB object represents a fixed length array with 6 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
The AABB object is represented internally as minimum and maximum points in 3D.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
A Quaternion object represents a rotation stored as a quaternion. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var quatCopy = quat.slice();
Returns a Quaternion object.
A QuaternionPosition object represents a rotation stored as a quaternion and a position stored as 3 floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized. The quaternion is stored on the first 4 elements and the position on the last 3.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var quatPosCopy = quatPos.slice();
var quat = quatPos.slice(0, 4);
var pos = quatPos.slice(4, 7);
Returns a QuaternionPosition object.
A Matrix33 object represents a 3 by 3 matrix stored as a fixed length array with 9 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var matrixCopy = matrix.slice();
var right = matrix.slice(0, 3);
var up = matrix.slice(3, 6);
var at = matrix.slice(6, 9);
The optional first parameter represents the offset of the element to start copying, valid values are multiples of 3.
The optional second parameter represents the offset of the element to end the copy, it is required to be the start offset plus 3.
Returns a Matrix33 object if no parameters are passed, a Vector3 otherwise.
A Matrix34 object represents a 3 by 4 matrix stored as a fixed length array with 12 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var matrixCopy = matrix.slice();
var vec0 = matrix.slice(0, 4);
var vec1 = matrix.slice(4, 8);
var vec2 = matrix.slice(8, 12);
The optional first parameter represents the offset of the element to start copying, valid values are multiples of 4.
The optional second parameter represents the offset of the element to end the copy, it is required to be the start offset plus 4.
Returns a Matrix34 object if no parameters are passed, a Vector4 otherwise.
A Matrix43 object represents a 4 by 3 matrix stored as a fixed length array with 12 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var matrixCopy = matrix.slice();
var right = matrix.slice(0, 3);
var up = matrix.slice(3, 6);
var at = matrix.slice(6, 9);
var pos = matrix.slice(9, 12);
The optional first parameter represents the offset of the element to start copying, valid values are multiples of 3.
The optional second parameter represents the offset of the element to end the copy, it is required to be the start offset plus 3.
Returns a Matrix43 object if no parameters are passed, a Vector3 otherwise.
A Matrix44 object represents a 4 by 4 matrix stored as a fixed length array with 16 single-precision floating point values. It behaves like a JavaScript array for getting or setting array elements but it can not be resized.
This object has been designed to provide optimal data storage for calculations done by the MathDevice.
Summary
Create a new math object copying the contents from the current math object.
Syntax
var matrixCopy = matrix.slice();
var vec0 = matrix.slice(0, 4);
var vec1 = matrix.slice(4, 8);
var vec2 = matrix.slice(8, 12);
var vec3 = matrix.slice(12, 16);
The optional first parameter represents the offset of the element to start copying, valid values are multiples of 4.
The optional second parameter represents the offset of the element to end the copy, it is required to be the start offset plus 4.
Returns a Matrix44 object if no parameters are passed, a Vector4 otherwise.