IsActive property

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
jbosch
Posts: 43
Joined: Sat May 29, 2010 4:42 pm
Contact:

IsActive property

Post by jbosch »

Hi there,

If I set IsActive to a physical entity what does it happen? It stops being considered in the physical space for collisions, gravity and so on?

In that little game I need to deactivate the fallen pieces between first and second shot. I'm doing it setting IsActive = false and to not drawing the fallen pieces at the second turn. ¿Is that correct?

http://www.youtube.com/watch?v=Dc_8EJJENr0

Thanks
Jesús Bosch
XNA BLOG: http://geeks.ms/blogs/jbosch
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: IsActive property

Post by Norbo »

Deactivated entities will still be in the 'world' and can be collided with/reactivated. If you want to ensure that they are no longer part of the simulation, the most complete option is to remove them using space.remove. You can also change their collision rules such that the ball/other pins won't collide with them, though this would be more work with no significant benefit.

"Deactivation" is a time-saving operation that allows stable, unmoving entities to fall asleep. It's designed so that when something comes along and wakes it up, they will return to normal functioning. Under normal circumstances, you can't tell that things have gone to sleep; when you force objects to sleep, it's possible to see them stopped in mid-air or in other odd configurations, but it's the same state.

And looking good, by the way :)
Post Reply