Browse Source

Updated builds.

Mr.doob 11 years ago
parent
commit
aef8e636e9
2 changed files with 177 additions and 168 deletions
  1. 33 22
      build/three.js
  2. 144 146
      build/three.min.js

+ 33 - 22
build/three.js

@@ -7092,25 +7092,7 @@ THREE.EventDispatcher.prototype = {
 
 		if ( object instanceof THREE.Sprite ) {
 
-			matrixPosition.setFromMatrixPosition( object.matrixWorld );
-			
-			var distance = raycaster.ray.distanceToPoint( matrixPosition );
-
-			if ( distance > object.scale.x ) {
-
-				return intersects;
-
-			}
-
-			intersects.push( {
-
-				distance: distance,
-				point: object.position,
-				face: null,
-				object: object
-
-			} );
-
+			object.raycast( raycaster, intersects );
 
 		} else if ( object instanceof THREE.PointCloud ) {
 		
@@ -14517,6 +14499,10 @@ THREE.Mesh = function ( geometry, material ) {
 
 THREE.Mesh.prototype = Object.create( THREE.Object3D.prototype );
 
+THREE.Mesh.prototype.raycast = function () {
+
+};
+
 THREE.Mesh.prototype.updateMorphTargets = function () {
 
 	if ( this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0 ) {
@@ -15263,9 +15249,34 @@ THREE.Sprite = ( function () {
 
 THREE.Sprite.prototype = Object.create( THREE.Object3D.prototype );
 
-/*
- * Custom update matrix
- */
+THREE.Sprite.prototype.raycast = ( function () {
+
+	var matrixPosition = new THREE.Vector3();
+
+	return function ( raycaster, intersects ) {
+
+		matrixPosition.setFromMatrixPosition( this.matrixWorld );
+			
+		var distance = raycaster.ray.distanceToPoint( matrixPosition );
+
+		if ( distance > this.scale.x ) {
+
+			return intersects;
+
+		}
+
+		intersects.push( {
+
+			distance: distance,
+			point: this.position,
+			face: null,
+			object: this
+
+		} );
+		
+	};
+
+} )();
 
 THREE.Sprite.prototype.updateMatrix = function () {
 

File diff suppressed because it is too large
+ 144 - 146
build/three.min.js


Some files were not shown because too many files changed in this diff