Hi,
I am using PhysX to simulate simple rigid bodies and i am getting this weird problem: There is a plane and several objects placed on top of it; when i apply a force on one of them, the force direction gradually moves toward one of the axis: X or Z (depending on which one is closer to the original force direction), please look:
I am using C# and PhysX:
Vector3 lookDirection = new Vector3();
lookDirection = currentCamera.LookAt.Position - currentCamera.Position;
lookDirection.Y = 0.0f; // removes the Y part, as i want to apply a horizontal force;
lookDirection.Normalize();
lookDirection = lookDirection * strength;
physicsManager.addForce(obj, lookDirection, currentCamera.LookAt.Position);
And inside physicsManager:
public void addForce(Object3D obj, Vector3 force, Vector3 pos)
{
if (bodies.ContainsKey(obj))
{
NxActor actor = bodies[obj];
actor.addForceAtPos(force, pos, NxForceMode.NX_FORCE);
}
}
I don't know what could be causing this, or what i am doing wrong. Well, thanks in advance for any tips! :)
Cheers,
Leandro