|
@@ -31,6 +31,8 @@ var WEBGL_CONSTANTS = {
|
|
|
REPEAT: 10497
|
|
|
};
|
|
|
|
|
|
+var identityArray = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ];
|
|
|
+
|
|
|
var THREE_TO_WEBGL = {};
|
|
|
|
|
|
THREE_TO_WEBGL[ THREE.NearestFilter ] = WEBGL_CONSTANTS.NEAREST;
|
|
@@ -152,6 +154,18 @@ THREE.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.
|
|
|
* @param {string} text
|
|
@@ -1777,7 +1791,7 @@ THREE.GLTFExporter.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( ! equalArray( object.matrix.elements, [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ] ) ) {
|
|
|
+ if ( isIdentityMatrix( object.matrix ) === false ) {
|
|
|
|
|
|
gltfNode.matrix = object.matrix.elements;
|
|
|
|