How to detect continuous contact between two geometries?

I have a sphere that falls onto a loaded model and I can detect collisions fine using a custom RigidBodyControl that PhysicsCollisionListener fine, but this only detected collisions between objects, not if an object was stationary while touching another. What is the best way to go about creating an event that is triggered whenever two spatials are touching. I want to be able to apply a force to the sphere while it is touching the object.

Thanks for any input.

I only way I can really think of to do this is using a ghostcontrol over my model :’(. But id prefer to use detection based on the two rigidbodies themselves…

Ghosts detect overlap using axis-aligned bounding boxes, not the exact collision shape.

What’s the shape of the loaded model that’s touching the sphere? If it’s made up of triangles, you could test each triangle individually using analytic geometry.

We may need to unpack this statement a bit.

Was one of the objects moving once or they basically ‘static’ or ‘kinematic’?

If one of the objects was moving once then did you get an event when it was moving?

Are you using native bullet or jbullet? (For me, spherical ghost objects worked just fine and were sphere-accurate… but I was using jbullet at the time and I understand that maybe this doesn’t work in native bullet?)

1 Like

Thanks for the replies everyone. I don’t think I’ll go through the trouble of using geometry testing. And yes the objects were moving at some point. The spheres basically fall onto the object. I experimented with using a collision event to set a variable that would trigger movement of the ball but I decided to just solve the problem using a simple ghostbody over the area that the spheres fall onto.