Browse Source

Optimize trig functions

yomboprime 7 years ago
parent
commit
848a6e201d
1 changed files with 7 additions and 4 deletions
  1. 7 4
      examples/js/loaders/SVGLoader.js

+ 7 - 4
examples/js/loaders/SVGLoader.js

@@ -1101,10 +1101,13 @@ THREE.SVGLoader.prototype = {
 
 
 			var rotation = createIdTransform();
 			var rotation = createIdTransform();
 
 
-			rotation[ 0 ] = Math.cos( angle );
-			rotation[ 1 ] = Math.sin( angle );
-			rotation[ 2 ] = -Math.sin( angle );
-			rotation[ 3 ] = Math.cos( angle );
+			var c = Math.cos( angle );
+			var s = Math.sin( angle );
+
+			rotation[ 0 ] = c;
+			rotation[ 1 ] = s;
+			rotation[ 2 ] = - s;
+			rotation[ 3 ] = c;
 			
 			
 			return rotation;
 			return rotation;