Collision is now robust (ありがとうチェリーさん)
This commit is contained in:
		
							parent
							
								
									dbd823c066
								
							
						
					
					
						commit
						718e6f88b8
					
				| @ -243,7 +243,7 @@ PointerCamera.prototype.isColliding = function(direction) { | ||||
|     var intersects = this.raycaster.intersectObjects(this.collidableObjects, true); | ||||
| 
 | ||||
|     for (var i in intersects) { | ||||
|         if (intersects[i].distance < 100*this.speed) { | ||||
|         if (intersects[i].distance < Tools.norm(direction)) { | ||||
|             return true; | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @ -246,7 +246,7 @@ TutoCamera.prototype.isColliding = function(direction) { | ||||
|     var intersects = this.raycaster.intersectObjects(this.collidableObjects, true); | ||||
| 
 | ||||
|     for (var i in intersects) { | ||||
|         if (intersects[i].distance < 100*this.speed) { | ||||
|         if (intersects[i].distance < Tools.norm(direction)) { | ||||
|             return true; | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user