How to reinit physix in irrOde?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
askona
Posts: 14
Joined: Wed Jun 01, 2011 3:45 pm
Location: Ukraine

How to reinit physix in irrOde?

Post 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();
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Probably better asked in the thread for the specific library, not an irrlicht related question.
askona
Posts: 14
Joined: Wed Jun 01, 2011 3:45 pm
Location: Ukraine

Post by askona »

I think brainsaw can answer this simple question
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

It would probably be easier for him to find in his own thread, is what I'm saying.
askona
Posts: 14
Joined: Wed Jun 01, 2011 3:45 pm
Location: Ukraine

Post by askona »

yeah you are right)
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post 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.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Post Reply