Page 1 of 1

How to reinit physix in irrOde?

Posted: Wed Jun 22, 2011 6:19 pm
by askona
If i have initialized physix like that

Code: Select all

 worldNode->initPhysics();
and then add an object, my new objects are freezed. BUT if i do this code again my new objects are still freezed. as i understood i cant simply write worldNode->initPhysics(); after each adding physix objects, so what i should to do? i tried worldNode->removeFromPhysics() and later worldNode->initPhysics(); again but if i do that, i got error in

Code: Select all

 CIrrOdeManager::getSharedInstance()->step();

Posted: Thu Jun 23, 2011 6:37 am
by Lonesome Ducky
Probably better asked in the thread for the specific library, not an irrlicht related question.

Posted: Thu Jun 23, 2011 6:56 am
by askona
I think brainsaw can answer this simple question

Posted: Thu Jun 23, 2011 10:02 pm
by Lonesome Ducky
It would probably be easier for him to find in his own thread, is what I'm saying.

Posted: Fri Jun 24, 2011 5:59 am
by askona
yeah you are right)

Posted: Fri Jun 24, 2011 6:21 am
by Brainsaw
Have to agree, writing this to the IrrODE thread would be a good idea.

Back to topic: there is a "initPhysics" method in all IrrOde specific scenenodes. It should be enough to call that method of the newly created node (if it's a combination of more than one nodes, e.g. a car, calling the method of the root node should do the job) to init the physical representation of the node, after that it should work.

You could take a look at the "CPlane" and "CProjectile" classes in the IrrOdeCar demo. The planes shoot missiles. Although I don't load the scenenodes but have templates in the scene and clone them.