Page 1 of 1

Forcibly deactivating an entity

Posted: Mon May 04, 2015 8:50 pm
by mcmonkey
I'm working on client/server sharing physics, and I want to make it so if the server says an entity is deactivated, then it deactivates on the client as well. There's a variety of reasons for this that aren't incredibly relevant to the discussion.
Basically:
- The entity must stop moving / calculating / etc.
- The entity should still be affected by physics, EG if it gets hit it should react, this results out making it kinematic
- Efficiency is in mind, and genuine deactivation is required to ensure things run efficiency

Most physics engines have a simple function or setter that marks an entity deactivated, however in BEPU I can only find "Activate()", no DEactivate equivalent. So... how do I go about doing this?

Re: Forcibly deactivating an entity

Posted: Mon May 04, 2015 9:02 pm
by Norbo
Deactivate the SimulationIsland the entity is a part of by setting entity.ActivityInformation.SimulationIsland.IsActive to false. That entity and any other object that is physically interacting with that entity will then freeze.