max123 Posted October 27, 2016 Share Posted October 27, 2016 Hi, Another head scratcher for me: I'm trying to cast rays to detect if an a object (A) is in "view" of another object (B).B has got lookAt(A) attached to it, so this is how I'm constructing the ray: var ray = new BABYLON.Ray(this.mesh.position, this.mesh.rotationQuaternion.toEulerAngles().normalize()); It's not working, so what am I doing wrong? Quote Link to comment Share on other sites More sharing options...
max123 Posted October 27, 2016 Author Share Posted October 27, 2016 BTW, I tried a variation: var ray = new BABYLON.Ray(this.mesh.position, this.mesh.rotationQuaternion.normalize().toEulerAngles()); but still no joy... Quote Link to comment Share on other sites More sharing options...
adam Posted October 27, 2016 Share Posted October 27, 2016 This should be useful: You might know this already, but when you use Mesh.lookAt, it points the negative z access at the lookAt point. max123 and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
max123 Posted October 27, 2016 Author Share Posted October 27, 2016 This worked!! Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.