|
@@ -17,8 +17,7 @@ import {
|
|
RGBAFormat,
|
|
RGBAFormat,
|
|
RepeatWrapping,
|
|
RepeatWrapping,
|
|
Scene,
|
|
Scene,
|
|
- Vector3,
|
|
|
|
- Matrix4
|
|
|
|
|
|
+ Vector3
|
|
} from "../../../build/three.module.js";
|
|
} from "../../../build/three.module.js";
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------------
|
|
@@ -52,6 +51,8 @@ var WEBGL_CONSTANTS = {
|
|
REPEAT: 10497
|
|
REPEAT: 10497
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+var identityArray = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ];
|
|
|
|
+
|
|
var THREE_TO_WEBGL = {};
|
|
var THREE_TO_WEBGL = {};
|
|
|
|
|
|
THREE_TO_WEBGL[ NearestFilter ] = WEBGL_CONSTANTS.NEAREST;
|
|
THREE_TO_WEBGL[ NearestFilter ] = WEBGL_CONSTANTS.NEAREST;
|
|
@@ -173,6 +174,18 @@ GLTFExporter.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Is identity matrix
|
|
|
|
+ *
|
|
|
|
+ * @param {THREE.Matrix4} matrix
|
|
|
|
+ * @returns {Boolean} Returns true, if parameter is identity matrix
|
|
|
|
+ */
|
|
|
|
+ function isIdentityMatrix( matrix ) {
|
|
|
|
+
|
|
|
|
+ return equalArray( matrix.elements, identityArray );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Converts a string to an ArrayBuffer.
|
|
* Converts a string to an ArrayBuffer.
|
|
* @param {string} text
|
|
* @param {string} text
|
|
@@ -1798,7 +1811,7 @@ GLTFExporter.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( ! equalArray( object.matrix.elements, new Matrix4().toArray() ) ) {
|
|
|
|
|
|
+ if ( ! isIdentityMatrix( object.matrix ) ) {
|
|
|
|
|
|
gltfNode.matrix = object.matrix.elements;
|
|
gltfNode.matrix = object.matrix.elements;
|
|
|
|
|