Forcibly deactivating an entity

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
mcmonkey
Posts: 92
Joined: Fri Apr 17, 2015 11:42 pm

Forcibly deactivating an entity

Post 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?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Forcibly deactivating an entity

Post 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.
Post Reply