Browse Source

FBXLoader added support for rotated pivots

Lewy Blue 7 years ago
parent
commit
c4eb4e1b87
1 changed files with 18 additions and 0 deletions
  1. 18 0
      examples/js/loaders/FBXLoader.js

+ 18 - 0
examples/js/loaders/FBXLoader.js

@@ -1808,6 +1808,24 @@
 
 			}
 
+			if ( 'GeometricRotation' in node.properties ) {
+
+				var array = node.properties.GeometricRotation.value.map( THREE.Math.degToRad );
+
+				model.traverse( function ( child ) {
+
+					if ( child.geometry ) {
+
+						child.geometry.rotateX( array[ 0 ] );
+						child.geometry.rotateY( array[ 1 ] );
+						child.geometry.rotateZ( array[ 2 ] );
+
+					}
+
+				} );
+
+			}
+
 			// allow transformed pivots - see https://github.com/mrdoob/three.js/issues/11895
 			if ( 'GeometricTranslation' in node.properties ) {