Parcourir la source

Cleaned up ArrowHelper code a bit.

Mr.doob il y a 12 ans
Parent
commit
54cdb693ac
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      src/extras/helpers/ArrowHelper.js

+ 5 - 5
src/extras/helpers/ArrowHelper.js

@@ -16,8 +16,8 @@ THREE.ArrowHelper = function ( dir, origin, length, hex ) {
 
 	THREE.Object3D.call( this );
 
-	if ( hex === undefined ) hex = 0xffff00;
 	if ( length === undefined ) length = 20;
+	if ( hex === undefined ) hex = 0xffff00;
 
 	var lineGeometry = new THREE.Geometry();
 	lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
@@ -57,9 +57,9 @@ THREE.ArrowHelper.prototype.setDirection = function ( dir ) {
 
 	    var axis = THREE.ArrowHelper.__v2.set( d.z, 0, - d.x ).normalize();
 	    var radians = Math.acos( d.y );
-	    var quat = THREE.ArrowHelper.__q1.setFromAxisAngle( axis, radians );
-	    
-	    this.rotation.setEulerFromQuaternion( quat, this.eulerOrder );
+	    var quaternion = THREE.ArrowHelper.__q1.setFromAxisAngle( axis, radians );
+
+	    this.rotation.setEulerFromQuaternion( quaternion, this.eulerOrder );
 
 	}
 
@@ -80,4 +80,4 @@ THREE.ArrowHelper.prototype.setColor = function ( hex ) {
 
 THREE.ArrowHelper.__v1 = new THREE.Vector3();
 THREE.ArrowHelper.__v2 = new THREE.Vector3();
-THREE.ArrowHelper.__q1 = new THREE.Quaternion();
+THREE.ArrowHelper.__q1 = new THREE.Quaternion();