瀏覽代碼

update sprite.raycast

06wj 7 年之前
父節點
當前提交
8cc8425180
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/objects/Sprite.js

+ 2 - 2
src/objects/Sprite.js

@@ -35,7 +35,7 @@ Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 		var alignedPosition = new Vector2();
 		var rotatedPosition = new Vector2();
-		var matrixWorldInverse = new Matrix4();
+		var modelViewInverseMatrix = new Matrix4();
 
 		return function raycast( raycaster, intersects ) {
 
@@ -62,7 +62,7 @@ Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), {
 			worldPosition.y += rotatedPosition.y;
 
 			// transform to world space
-			worldPosition.applyMatrix4( matrixWorldInverse.getInverse( this.modelViewMatrix ) ).applyMatrix4( this.matrixWorld );
+			worldPosition.applyMatrix4( modelViewInverseMatrix.getInverse( this.modelViewMatrix ) ).applyMatrix4( this.matrixWorld );
 
 			raycaster.ray.closestPointToPoint( worldPosition, intersectPoint );