浏览代码

Removed yet some more .translate() and .rotateByAxis() instances. See #3185.

Mr.doob 12 年之前
父节点
当前提交
5d3a56beaf
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 2 1
      src/extras/helpers/SpotLightHelper.js
  2. 3 3
      test/unit/math/Ray.js

+ 2 - 1
src/extras/helpers/SpotLightHelper.js

@@ -18,7 +18,8 @@ THREE.SpotLightHelper = function ( light, sphereSize ) {
 	this.add( this.lightSphere );
 	this.add( this.lightSphere );
 
 
 	geometry = new THREE.CylinderGeometry( 0.0001, 1, 1, 8, 1, true );
 	geometry = new THREE.CylinderGeometry( 0.0001, 1, 1, 8, 1, true );
-	geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ).translate( new THREE.Vector3( 0, -0.5, 0 ) ) );
+	geometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, -0.5, 0 ) );
+	geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
 
 	material = new THREE.MeshBasicMaterial( { fog: false, wireframe: true, opacity: 0.3, transparent: true } );
 	material = new THREE.MeshBasicMaterial( { fog: false, wireframe: true, opacity: 0.3, transparent: true } );
 	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
 	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );

+ 3 - 3
test/unit/math/Ray.js

@@ -151,15 +151,15 @@ test( "intersectPlane", function() {
 
 
 test( "applyMatrix4", function() {
 test( "applyMatrix4", function() {
 	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
 	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	var m = new THREE.Matrix4().identity();
+	var m = new THREE.Matrix4();
 
 
 	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
 	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
 
 
 	a = new THREE.Ray( zero3.clone(), new THREE.Vector3( 0, 0, 1 ) );
 	a = new THREE.Ray( zero3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	m.rotateByAxis( new THREE.Vector3( 0, 0, 1 ), Math.PI );
+	m.makeRotationZ( Math.PI );
 	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
 	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
 
 
-	m.identity().rotateX( Math.PI );
+	m.makeRotationX( Math.PI );
 	var b = a.clone();
 	var b = a.clone();
 	b.direction.negate();
 	b.direction.negate();
 	var a2 = a.clone().applyMatrix4( m );
 	var a2 = a.clone().applyMatrix4( m );