bepu / bepuphysics2

Pure C# 3D real time physics simulation library, now with a higher version number.
Apache License 2.0
2.35k stars 272 forks source link

Switching state active and deactivate without remove from simulation. #108

Closed ng08000 closed 3 years ago

ng08000 commented 3 years ago

is there any way to switch the state active and deactivate to prevent other objects collide with it and freeze simulate for this object?

RossNordby commented 3 years ago

A body can forced asleep with bodyReference.Awake = false, but if something hits it it will still wake up, and sleeping operates at the level of interacting body groups. You could make a INarrowPhaseCallbacks.AllowContactGeneration that returns false when such a body is involved in a collision pair, stopping it from colliding with anything and ensuring that the body can be slept in isolation.

I'd expect it to be simpler to just remove it from the simulation.

ng08000 commented 3 years ago

ok, seem like removing the object from the simulation is the on way. thanks by the way 👍