dynamic rigidbody trigger with terrain

Post Reply
vulhgor
Posts: 1
Joined: Tue Dec 12, 2017 4:33 am

dynamic rigidbody trigger with terrain

Post by vulhgor »

I created a dynamic rigidbody as a trigger, and a terrain heightfield. At the first place, the trigger was placed in (0,222,0), then let it drop. It will be stopped when it collide with terrain. But bullet mistake they are on collision
when the trigger enter the AABB of the heightfield. So the trigger was hanged on the sky. :P I want to know,
how to let bullet callback when the trigger truly touch the surface of the terrain.

Image
Attachments
360截图20171212123702702.png
360截图20171212123702702.png (889.92 KiB) Viewed 1703 times
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: dynamic rigidbody trigger with terrain

Post by drleviathan »

Perhaps you could monitor collision events and stop the falling object when it hits something?

Bullet doesn't supply "collision events" per-se, but it does provide a few hooks for figuring out when a collision is happening. You could register a callback to analyze contacts as they are created. Alternatively you could walk all contact manifolds at the end of each step looking for a contact manifold that involves your falling object (I would recommend this method rather than filtering all contacts).
Post Reply