r1cky17
16-10-2007 08:19:03
hi, i have a problem in removing the collision.
i make racing game, and for the 1st stage i add a collision to all object in the 1st stage.
this is the code that i use to add the collision
and if i change the stage, the object collision from the old stage is not gone.
am i need to destroy the collision for all objects in the old stage?
how to destroy the collision?
thx for the help
i make racing game, and for the 1st stage i add a collision to all object in the 1st stage.
this is the code that i use to add the collision
SceneNode* bodyNode = mSceneMgr->getSceneNode(bodyName);
Vector3 currPos = bodyNode->getPosition();
Quaternion currOrient = bodyNode->getOrientation();
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::TreeCollision( m_World, bodyNode, false );
OgreNewt::Body* bod = new OgreNewt::Body( m_World, col );
delete col;
bod->attachToNode(bodyNode);
bod->setPositionOrientation(currPos, currOrient);
and if i change the stage, the object collision from the old stage is not gone.
am i need to destroy the collision for all objects in the old stage?
how to destroy the collision?
thx for the help