diff --git a/src/mol-math/linear-algebra/3d/mat4.ts b/src/mol-math/linear-algebra/3d/mat4.ts index f57fc231c922fb441a10f85fed0355f40354471c..d6ae371a603ef818f18af65ed9ed6c9a2b48b928 100644 --- a/src/mol-math/linear-algebra/3d/mat4.ts +++ b/src/mol-math/linear-algebra/3d/mat4.ts @@ -1070,9 +1070,9 @@ namespace Mat4 { return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); } - const xAxis = Vec3.create(1, 0, 0); - const yAxis = Vec3.create(0, 1, 0); - const zAxis = Vec3.create(0, 0, 1); + const xAxis = [1, 0, 0] as Vec3; + const yAxis = [0, 1, 0] as Vec3; + const zAxis = [0, 0, 1] as Vec3; /** Rotation matrix for 90deg around x-axis */ export const rotX90: ReadonlyMat4 = fromRotation(zero(), degToRad(90), xAxis); diff --git a/src/mol-math/linear-algebra/3d/quat.ts b/src/mol-math/linear-algebra/3d/quat.ts index 2f9872490cf78312a5408999668741e5e8f1c467..31707d8099acfb3a07d75ac5a84c5aa9699db15b 100644 --- a/src/mol-math/linear-algebra/3d/quat.ts +++ b/src/mol-math/linear-algebra/3d/quat.ts @@ -277,7 +277,7 @@ namespace Quat { return out; } - const fromUnitVec3Temp = Vec3(); + const fromUnitVec3Temp = [0, 0, 0] as Vec3; /** Quaternion from two normalized unit vectors. */ export function fromUnitVec3 (out: Quat, a: Vec3, b: Vec3) { // assumes a and b are normalized @@ -376,9 +376,9 @@ namespace Quat { * * Both vectors are assumed to be unit length. */ - const rotTmpVec3 = Vec3(); - const rotTmpVec3UnitX = Vec3.create(1, 0, 0); - const rotTmpVec3UnitY = Vec3.create(0, 1, 0); + const rotTmpVec3 = [0, 0, 0] as Vec3; + const rotTmpVec3UnitX = [1, 0, 0] as Vec3; + const rotTmpVec3UnitY = [0, 1, 0] as Vec3; export function rotationTo(out: Quat, a: Vec3, b: Vec3) { let dot = Vec3.dot(a, b); if (dot < -0.999999) { @@ -421,7 +421,7 @@ namespace Quat { * axes. Each axis is a vec3 and is expected to be unit length and * perpendicular to all other specified axes. */ - const axesTmpMat = Mat3(); + const axesTmpMat = [0, 0, 0, 0, 0, 0, 0, 0, 0] as Mat3; export function setAxes(out: Quat, view: Vec3, right: Vec3, up: Vec3) { axesTmpMat[0] = right[0]; axesTmpMat[3] = right[1]; diff --git a/src/mol-math/linear-algebra/_spec/tensor.spec.ts b/src/mol-math/linear-algebra/_spec/tensor.spec.ts index 923e6455e4369ad8a006563d0d052326e3924c6d..f2a283bb7b816c3b079b1098baf512991e763133 100644 --- a/src/mol-math/linear-algebra/_spec/tensor.spec.ts +++ b/src/mol-math/linear-algebra/_spec/tensor.spec.ts @@ -52,7 +52,7 @@ describe('tensor', () => { it('mat4 equiv', () => { const M = T.ColumnMajorMatrix(4, 4); const data = M.create(); - const m = Mat4.zero(); + const m = Mat4(); for (let i = 0; i < 4; i++) { for (let j = 0; j < 4; j++) {