Skip to content

Commit

Permalink
Replace array iteration with standard for-loop to avoid producing gar…
Browse files Browse the repository at this point in the history
…bage
  • Loading branch information
nous- authored Dec 15, 2023
1 parent 88b92fc commit 0105479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Matrix4x4 extends Matrix implements TransformId {
let matrix = new Float32Array(16)
this._rotation = new MatrixComponent<Quaternion>(this, new Quaternion(), data => {
// To extract a correct rotation, the scaling component must be eliminated.
for (let col of [0, 1, 2]) {
for (let col = 0; col < 3; col++) {
matrix[col + 0] = this.array[col + 0] / this.scaling.x
matrix[col + 4] = this.array[col + 4] / this.scaling.y
matrix[col + 8] = this.array[col + 8] / this.scaling.z
Expand Down

0 comments on commit 0105479

Please sign in to comment.