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
Including ODE to Irrlicht.
Including ODE to Irrlicht.
Life is expensive..... but a trip around the sun is included.
I have the same problem here
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.
Is there anybody there that can help us??? Please??
By the way I am using -1.0 as the gravity value.
Fixed it
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.
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.