Willikus
02-09-2008 12:40:41
Hi.
Recently, I chose to insert OgreNewt into our program. But I meet an error during the use of the setCustomForceAndTorqueCallback.
(I proved the functioning of the motor with a simple setStandardForceCallback)
Sample of cpp : (interim)
Sample of .h :
So, the code compile but the program crash on setCustomForceAndTorqueCallback ?!
I try :
same result.
somebody can to help me?
(sorry for my bad english
EDIT : we use :
-Ogrenewt : last CVS version
-Ogre : 1.4.7
-Newton : 1.53
-boost : 1.35.0
Recently, I chose to insert OgreNewt into our program. But I meet an error during the use of the setCustomForceAndTorqueCallback.
(I proved the functioning of the motor with a simple setStandardForceCallback)
Sample of cpp : (interim)
void camera::add_camera(Ogre::String id)
{
smgr->createCamera(id);
/********** Physique camera *********/
Ogre::SceneNode * nodetrack = smgr->getRootSceneNode()->createChildSceneNode(id);
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Box(parent->get_sg()->get_World(), Ogre::Vector3(15, 40, 15), Ogre::Quaternion::IDENTITY);
OgreNewt::Body* bod = new OgreNewt::Body( parent->get_sg()->get_World(), col );
delete col;
bod->attachToNode(nodetrack);
Ogre::Vector3 inertia = OgreNewt::MomentOfInertia::CalcBoxSolid( 10, Ogre::Vector3(15, 40, 15) );
bod->setMassMatrix(Ogre::Real(10), inertia);
bod->setCustomForceAndTorqueCallback(boost::bind( &camera::camCallback, this, _1 ) );
/****************************************/
}
void camera::camCallback(OgreNewt::Body * me)
{
//empty to restrict errors
}
Sample of .h :
camera(WS::graphic::engine*, Ogre::RenderWindow *);
~camera();
/***Camera***/
void add_camera(Ogre::String);
void camCallback(OgreNewt::Body*);
So, the code compile but the program crash on setCustomForceAndTorqueCallback ?!
I try :
bod->setCustomForceAndTorqueCallback<camera>(&camera::camCallback,this);
same result.
somebody can to help me?
(sorry for my bad english
EDIT : we use :
-Ogrenewt : last CVS version
-Ogre : 1.4.7
-Newton : 1.53
-boost : 1.35.0