2
0
Эх сурвалжийг харах

move internal use instances to the end of the file

Yomotsu 5 жил өмнө
parent
commit
8bcfccda1b

+ 3 - 3
src/math/Euler.js

@@ -3,9 +3,6 @@ import { Vector3 } from './Vector3.js';
 import { Matrix4 } from './Matrix4.js';
 import { MathUtils } from './MathUtils.js';
 
-const _matrix = new Matrix4();
-const _quaternion = new Quaternion();
-
 class Euler {
 
 	constructor( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) {
@@ -339,5 +336,8 @@ class Euler {
 
 }
 
+const _matrix = new Matrix4();
+const _quaternion = new Quaternion();
+
 
 export { Euler };

+ 8 - 9
src/math/Matrix4.js

@@ -1,13 +1,5 @@
 import { Vector3 } from './Vector3.js';
 
-const _v1 = new Vector3();
-let _m1;
-const _zero = new Vector3( 0, 0, 0 );
-const _one = new Vector3( 1, 1, 1 );
-const _x = new Vector3();
-const _y = new Vector3();
-const _z = new Vector3();
-
 class Matrix4 {
 
 	constructor() {
@@ -881,6 +873,13 @@ class Matrix4 {
 
 }
 
-_m1 = new Matrix4();
+const _v1 = new Vector3();
+const _m1 = new Matrix4();
+const _zero = new Vector3( 0, 0, 0 );
+const _one = new Vector3( 1, 1, 1 );
+const _x = new Vector3();
+const _y = new Vector3();
+const _z = new Vector3();
+
 
 export { Matrix4 };

+ 2 - 4
src/math/Vector3.js

@@ -1,9 +1,6 @@
 import { MathUtils } from './MathUtils.js';
 import { Quaternion } from './Quaternion.js';
 
-let _vector;
-const _quaternion = new Quaternion();
-
 class Vector3 {
 
 	constructor( x = 0, y = 0, z = 0 ) {
@@ -727,6 +724,7 @@ class Vector3 {
 
 }
 
-_vector = new Vector3();
+const _vector = new Vector3();
+const _quaternion = new Quaternion();
 
 export { Vector3 };