Page 1 of 1

Including ODE to Irrlicht.

Posted: Thu Sep 23, 2004 1:20 pm
by Kande
Hi,

this is not an irrlicht specific question but i guess it fits here anyways.

I wanted to implement some ode physics like it is shown in the tutorial in the tutorial section. But i have a problem, everytime when a object collides with another the nearCollisionCallback() Function is called by ode. In this function the two colliding bodys are attached to a contact joint. This seems to work wonderful. Also until then everything works fine, the body falls down because of gravity, just great. But then something strage happens. When i call the function UpdateEntitiesAfterPhysics() to move and rotate the bodys like it was calculated by ode i get a strange Position after calling:

ode_pos=(dReal*)dGeomGetPosition(geom);

ode_pos has the following value:

-1.#IND000

What does this mean? This value surely cant really be converted in an irrlicht vector3df so the object just disapears somewhere in the deep spaces of my memory. Somebody had this problem before?

Ciao
Kande

I have the same problem here

Posted: Sat Apr 08, 2006 3:16 pm
by juantar
I also followed the structure of the Bounce example. However, even if I set the position of the body with dBodySetPosition(_body,pos._x,pos._y,pos._z), ODE seems like it is ignoring this vector values and leaving the position of the body to "-1.IND000". I have that value for the position even before executing the simulation loop (where the collision check occurs). It is pretty strange and I have not been able to solve the problem.

Is there anybody there that can help us??? Please??

By the way I am using -1.0 as the gravity value.

Fixed it

Posted: Wed May 24, 2006 9:25 pm
by juantar
Two things I did:

I changed the code so that the mass structure of the object is initialized to 0 by using dMassSetZero (&_mass).

Then I found that when I was setting the mass of the body I was using the wrong variable:
dBodySetMass(_body,&mass);
instead of
dBodySetMass(_body,&_mass);

It now works without the giving me the nasty IND000.

Posted: Thu May 25, 2006 12:09 am
by CuteAlien
-1.#IND000 is an invalid float value. Maybe caused by a division by zero or some similar invalid calculation. Further calculations with that value will usually only result in further -1.#IND000's.