# Weird problem with PhysX

## Recommended Posts

leandro81    192
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;


And inside physicsManager:
public void addForce(Object3D obj, Vector3 force, Vector3 pos)
{
if (bodies.ContainsKey(obj))
{
NxActor actor = bodies[obj];
}
}


I don't know what could be causing this, or what i am doing wrong. Well, thanks in advance for any tips! :) Cheers, Leandro

##### Share on other sites
jezham    204
Unless this is happening in a hardware scene then you need to force cone friction, for the advanced friction model.

when creating actors, use this flag:
NX_AF_FORCE_CONE_FRICTION

or for the whole scene:

##### Share on other sites
leandro81    192
WOW! Thanks, this really seems to be the solution!

But now I have another problem, I am using this wrapper and it's linked against version 2.4.4 of PhysX library and this flag appeared only on version 2.6.1 :(

Does anyone know another .NET wrapper for a recent version of PhysX?

Leandro

##### Share on other sites
jezham    204
Yeah the newer friction model has a real nice feel to it :)

Can't help with wrappers, perhaps start making your own as a side project, e.g. draw everything with the debug code to start, etc? It takes years though, I'm doing everything (within reason) custom and it feels like I'm doing a whole team's effort!