How can i enable and disable a physics aggregation

how can i enable and disable a physics aggregation.

If i disable a mesh with mesh.setEnabled(false); but physics aggregation still working .

You are the first one asking for that AFAIK.
There is no way to do so for now. simplest solution is to delete/recreate body.
Do you see another solution @carolhmj ?

2 Likes

I checked the Havok package and there doesn’t seem to be a function to disable a body/shape, unless I missed something @eoin ?

Yeah, we can do that. HP_World_RemoveBody() will remove the body from the simulation, so it’ll stop being updated and will stop affecting other bodies. Then, HP_World_AddBody() will enable it again.

Probably just need a little refactoring in HavokPlugin. The latter is called automatically by HavokPlugin.initBody(), to allow it to be called “manually.” The former function is already exposed by HavokPlugin.removeBody(), but probably want to keep the observers intact…

1 Like