Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove var in Libraries/Utilities/MatrixMath.js #22111

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Libraries/Utilities/MatrixMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ const MatrixMath = {
);

// output values
var perspective = [];
let perspective = [];
const quaternion = [];
const scale = [];
const skew = [];
Expand All @@ -590,7 +590,7 @@ const MatrixMath = {
}
const matrix = [];
const perspectiveMatrix = [];
for (var i = 0; i < 4; i++) {
for (let i = 0; i < 4; i++) {
matrix.push([]);
for (let j = 0; j < 4; j++) {
const value = transformMatrix[i * 4 + j] / transformMatrix[15];
Expand Down Expand Up @@ -622,7 +622,7 @@ const MatrixMath = {
const transposedInversePerspectiveMatrix = MatrixMath.transpose(
inversePerspectiveMatrix,
);
var perspective = MatrixMath.multiplyVectorByMatrix(
perspective = MatrixMath.multiplyVectorByMatrix(
rightHandSide,
transposedInversePerspectiveMatrix,
);
Expand All @@ -633,14 +633,14 @@ const MatrixMath = {
}

// translation is simple
for (var i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
translation[i] = matrix[3][i];
}

// Now get scale and shear.
// 'row' is a 3 element array of 3 component vectors
const row = [];
for (i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]];
}

Expand Down Expand Up @@ -678,7 +678,7 @@ const MatrixMath = {
// is -1, then negate the matrix and the scaling factors.
const pdum3 = MatrixMath.v3Cross(row[1], row[2]);
if (MatrixMath.v3Dot(row[0], pdum3) < 0) {
for (i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
scale[i] *= -1;
row[i][0] *= -1;
row[i][1] *= -1;
Expand Down