Solved-Crash of program with setCustomForceAndTorqueCallback

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)

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

micken

02-09-2008 14:09:48

Have you debugged this at all? You should be able to tell why it's crashing by looking at the callstack. Your code looks fine but if you can't make any sense of the call stack at the time of the crash then the problem most likely has something to do with boost. More info?

Willikus

02-09-2008 15:39:19

The problem comes from boost... to compile and to executer correctly program, I must compil with the 2 versions of boost (boost 1.35 + boost OgreNewt) and when there is in conflict, abolished boost Ogrenewt for go on the compil.

I am going to try to isolate conflict.

Thank for your help !

Solved : I abolished the folder " Detail " and now it works.