Changing collision primitives "at fly"

vilgeits

21-12-2006 10:10:22

Currently im using:

NF_CamCol = new OgreNewt::CollisionPrimitives::Ellipsoid(NF_World, Ogre::Vector3(1,1,1));
NF_CamBody = new OgreNewt::Body( NF_World, NF_CamCol );


Can i do something like:

NF_CamCol = new OgreNewt::CollisionPrimitives::Ellipsoid(NF_World, Ogre::Vector3(2,2,2));

or i must set the body world etc?


THANKS IN ADVANCE , AND THANKS FOR THIS GREAT ADDON :)

stoneCold.net

21-12-2006 16:57:07

I'm using://the initial collision primitive
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Box(mWorld, Ogre::Vector3(1,2,3));
OgreNewt::Body* body = new OgreNewt::Body(mWorld, col);

//destroy it for a change
delete col;

//create the new primitive
col = new OgreNewt::CollisionPrimitives::Ellipsoid(mWorld, Ogre::Vector3(3,2,1));

//finally tell the body to use it
body->setCollision(col)


greetings

vilgeits

03-01-2007 08:11:03

Thank you StoneCold :D