Toggling Collision off and on with button?
Toggling Collision off and on with button?
Could someone tell me how to modify the code so that I can turn off the collision and turn it back on using a button? What would be the best way to toggle collision code wise?
Check example/tutorial #12 Terrain Rendering for how to react on keypresses, or #05 if you'r talking about gui buttons.
These are member functions of the ISceneNodeAnimatorCollisionResponse interface (the animator returned from createCollisionResponseAnimator). By toggling this value, you dont need to recreate the animator all the time.
Code: Select all
//! Should the Target react on collision ( default = true )
virtual void setAnimateTarget ( bool enable ) = 0;
virtual bool getAnimateTarget () const = 0;