I haven't been able to update these functions from an old application using glMatrix 1.2 to glMatrix 2.7:
calculateNormal() {
mat4.identity(this.normalMatrix);
mat4.set(this.modelViewMatrix, this.normalMatrix);
mat4.inverse(this.normalMatrix);
mat4.transpose(this.normalMatrix);
}
And the following function of multiplying a matrix by a 4-component vector doesn't exist:
calculateOrientation() {
mat4.multiplyVec4(this.matrix, [1, 0, 0, 0], this.right);
mat4.multiplyVec4(this.matrix, [0, 1, 0, 0], this.up);
mat4.multiplyVec4(this.matrix, [0, 0, 1, 0], this.normal);
}