Including ODE to Irrlicht.

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
Kande
Posts: 19
Joined: Fri Sep 10, 2004 9:37 pm
Location: Mannheim / Germany
Contact:

Including ODE to Irrlicht.

Post 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
Life is expensive..... but a trip around the sun is included.
juantar

I have the same problem here

Post 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.
juantar
Posts: 9
Joined: Mon Apr 10, 2006 4:02 pm

Fixed it

Post 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.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
Post Reply