Art Vandelay Posted December 12, 2017 Share Posted December 12, 2017 Hi, I took the drag and drop demo and added collisions to it. Basically that means that in onPointerMove: I move the mesh I do mesh.computeWorldMatrix I check for an intersection of the mesh with every other mesh and if I discover one I move the mesh back Everything works fine and the meshes generally don't "go through" each other. However, if I drag a mesh fast enough it will slightly intersect with another mesh before actually being stopped by it. I can't understand why this is happening. Any ideas? Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 12, 2017 Share Posted December 12, 2017 Hello:) we will need a repro in the playground to help you ;D Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted December 12, 2017 Share Posted December 12, 2017 Hi, Have you tried calling "mesh._updateBoundingInfo" ? I think I did that to solve some frustrum issues, it might be the same problem here if it's about bounding boxes... Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 13, 2017 Share Posted December 13, 2017 Hi. I'll help with the PG. https://www.babylonjs-playground.com/#O3KE1#6 Notice lines 102-104. During drag, if green box intersects blue box, quit onPointerMoving. Now... drag blue box... at high velocity... into side of green box. They overlap. And they are stuck in intersect-state, so, no more onPointerMove happens ever again (without the help of a crowbar) Hope this helps. Hey, what if we invented mesh.deIntersect()... called from the collide observer. It does a careful analysis of bounding boxes, and determines WHICH DIRECTION to start moving the .source... to make it eventually de-intersect (and clear the intersect state). There could also be a "speed" setting. Wow! Essentially, animateFromIntersect(). But yeah, high-horsepower dragging is not for children. Penetration can happen. 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.