Art Vandelay Posted March 7, 2018 Share Posted March 7, 2018 Hi everyone, I was trying to understand how to work with bounding sphere collisions and created this playground. https://playground.babylonjs.com/#JHTYJL Notice line 114. I can't understand what is going on. I would expect the drag and drop to work normally and for the mesh I am dragging to collide with the purple donut. What am I missing? Thanks! Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted March 7, 2018 Author Share Posted March 7, 2018 Made a silly mistake with that last playground, ignore it . This is the right one: https://playground.babylonjs.com/#JHTYJL#1 Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted March 7, 2018 Share Posted March 7, 2018 Hi, diff.negate returns a function, but currentMesh.position.addInPlace() expects position. So replace diff.negate with diff.negate(). But what you will still get (and you should) - your mesh will freeze after the intersection. Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted March 7, 2018 Author Share Posted March 7, 2018 Thank you for the response @kurhlaa. Another silly mistake... However, I am still not getting the expected behavior. Not sure why. Here is the updated PG. I also noticed I forgot to use computeWorldMatrix but still not working. https://playground.babylonjs.com/#JHTYJL#2 Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted March 8, 2018 Author Share Posted March 8, 2018 OK now it's working. My question now is, how come the bounding sphere of a mesh that is a sphere is much bigger than the sphere? https://playground.babylonjs.com/#JHTYJL#4 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.