Created
August 19, 2015 12:13
-
-
Save SET001/54ca4409da2c9d4b2918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var head = this.mesh.getObjectByName("FPSCharacter.head"); | |
var camera = head.children[0]; | |
var startPoint = head.position.clone().applyMatrix4(this.mesh.matrixWorld); | |
var endPoint = camera.position.clone().applyMatrix4(this.mesh.matrixWorld); | |
var directionPoint = endPoint.sub(startPoint).normalize(); | |
var ray = new THREE.Raycaster(startPoint, directionPoint, 0, 50); | |
var collisionResult = ray.intersectObject(V3.RenderSystem.scene.getObjectByName('Room')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment