Question about turning collision on/off for rigidobject

pwr00
Posts: 5
Joined: Tue Sep 10, 2013 8:01 pm

Question about turning collision on/off for rigidobject

Post by pwr00 »

Hi!
Background:
I am trying to make a game and am not really sure how I should handle the collision for the landscape which the player is walking on. The landscape is built up which patches. When the player is walking in the landscape I want to turn on the collision of the landscape patches so the player doesn't fall through. But if the patches are too far from the player I want to turn off the collision detection. The reason why I want to do this I'm hoping to get better performance.

Question:
1. How do people normally turn the collision on/off for different rigid bodies in bullet?
2. Is turning the collision on/off a bad idea for avoiding having collision detection for objects that are too far away? Or is bullet so good at this so I won't really get a performance boost from this? Would it be better to simply remove the rigid body and the readd it when the collision is needed?

Thanks!