updateMatrix method
dynamic
updateMatrix()
Compose the object matrix.
Implementation
updateMatrix() {
matrix = M4.translate(M4.identity(), position.x, position.y, position.z);
matrix = M4.xRotate(matrix, rotation.x);
matrix = M4.yRotate(matrix, rotation.y);
matrix = M4.zRotate(matrix, rotation.z);
matrix = M4.scale(matrix, scale.x, scale.y, scale.z);
// update the uniforms.
uniforms['u_world'] = matrix; // update the uniforms.
}