The aspect ratio of the perspective matric - normally defined as width / height
The bottom plane of the orthagraphic view
The children of this object
The far point of the perspective matrix
The field of view of the perspective matrix, in degrees
The left plane of the orthagraphic view
A matrix representing the translation, rotation and scale of this object.
Whether to automatically calculate the object matrix each time updateWorldMatrix is called. Convenient, but potentially costly.
The near point of the perspective matrix
Optional
parentThe parent of this object.
Object position
The camera projection matrix gives a vector space projection to a subspace.
The combined projection and view matrix.
Object rotation, expressed as a quaternion
The right plane of the orthagraphic view
Object rotation, expressed as a 3D Euler rotation
Object scale
The top plane of the orthagraphic view
The camera type - perspective or orthographic. If left / right are provided this will default to orthographic, otherwise it will default to perspective
The up unit vector
The camera view matrix transforms vertices from world-space to view-space.
Whether this objec is visible or not. This will stop the renderer from trying to render this object
The world matrix represents the function of all ancestor matrices and the matrix of this object
A boolean indicating whether the world matrix requires updating.
The position in world space
The zoom level of the orthagraphic view
Static
STATE_Static
STATE_Static
STATE_Static
STATE_Static
STATE_Adds a child object to this and indicates whether to notify the child
The object to add as a child of this one
Whether to set the parent of the indicated child to this
Determines whether the camera frustum intersects the supplied drawable object. Used mainly for frustum culling.
The node to test intersection against
Boolean indicating intersection
Determines whether the frustum intersects a sphere
The center of the sphere to test.
The radius of the sphere to test.
Boolean indicating intersection
Determines the largist axis scale of a matrix
The matrix to find the max axis of
The max axis scale
Calculate the parameters necessary for an orthographic camera
The parameters to be used for the camera
Calculate the parameters necessary for a perspective camera
The parameters to be used for the camera
Remove a child from this object.
The child to remove
Whether to notify the child of the removal
Sets the parent of this object and indicates whether to set a child relationship on the parent.
The parent object to use
Whether to set the full parent-child relationsjip
UpdateRotation should be called whenever a change to the quaternion variable is made. This will update the rotation in response to the change in the quaternion. For example:
const Box = new Mesh(gl, { geometry: BoxGeo, program });
Box.quaternion = Quat.fromAxisAngle(new Vec3(1,0,0), Math.PI*-.25);
Box.updateQuaternion();
console.log(Box.rotation) // {_x: 0.7853981633974483, _y: 0, _z: 0}
UpdateRotation should be called whenever a change to the rotation variable is made. This will update the quaternion in response to the change in the rotation. For example:
const Box = new Mesh(gl, { geometry: BoxGeo, program });
Box.rotation.x = Math.PI*.25;
Box.updateRotation();
console.log(Box.quaternion) // {_x: 0.3826834323650898, _y: 0, _z: 0, _w: 0.9238795325112867}
Class representing some Geometry.