Moving Sensor Shapes

Official forum for the Chipmunk2D Physics Library.
Post Reply
damien.epiphany
Posts: 3
Joined: Tue Aug 06, 2013 4:08 am
Contact:

Moving Sensor Shapes

Post by damien.epiphany »

Hi,

I'm using the Buoyancy example to emulate water, which works fine if I create the water sensor shape, but not move it. But I need to simulate a pool being filled up. So I setup the sensor shape to be the size of the pool, and set it below the pool bottom and raise it as the pool is filled, but the bodies in the water don't act the same as if the sensor shape was set to static.

To simulate the pool filling up, I use cpShapeUpdate() to change the position, which I can see the shape being moved with the debug draws, but the bodies act differently. I tried following that function with cpSpaceReindexShape(), but if I do that, the shape ends up not moving at all. Is there something else I'm missing here?

Regards,
damien.epiphany
Posts: 3
Joined: Tue Aug 06, 2013 4:08 am
Contact:

Re: Moving Sensor Shapes

Post by damien.epiphany »

I solved this by using a Rogue Body instead and attaching the water sensor to that.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 13 guests