Problem Revolute Joint - Plane Simulation

Hello o/

I am making a game with PhysX about planes but I encountered a serious problem that causes my planes to crash dismally…

Description:
I make my plane of boxes (rigid dynamics) jointed using FixedJoints and two RevoluteJoints for attaching ailerons. I also use scripts for adding propulsion forces, wings (lift and drag forces) and managing the rotation of my ailerons. However as soon as I take off, one of my ailerons loses its drive.

I use an homemade game engine. So I reproduced this problem with the following minimal code:


(deps are OpenGL 3.3, PhysX, SDL2 and glm)
Note that in this code, I set the targeted speed of my aileron drives to 0 after 1 second. This is for simulating the user input. I would like these drives to act as brakes (as described in the documentation).

I also recorded a video if you want to see this quickly:

Some weird facts:

  • if I continue to fly, after few minutes my aileron’s drive works again as usual.
  • it seems that if I add/remove other rigid dynamics to the scene, the result is different (and sometimes it works)

I don’t know if it’s a bug. My current hypothesis is that I am wrong with the scale of force/or drive limit/or mass (I don’t know). Do you have an idea ?

PhysX Version: 3.3
OS Version: 4.4.0-53-generic #74~14.04.1-Ubuntu SMP Fri Dec 2 03:43:31 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

No reply ? Well, there is what I found.

My guess is my plane is too complex. All these fixed joints put too much pressure
on the “constraint solver”. I understand this solver has not been designed to
produce perfect results but to be fast (a good trade off approx/fast vs perfect/slow).

Thus there is the solution I found to simplify my plane system:
A) Instead of using PxFixedJoint, add multiple shape to the same PxRigidDynamic
B) Use PxArticulation (more precise/and slow)
C) Use PxRigidDynamic::setSolverIterationCounts to improve computation results for this body

(Additionally “make the lighter body the second actor in the joint”)

Using A) was enough to solve my problem.

Nice to see there are plenty of adjustments to achieve what we want.
But it’s sad there is no support from Nvidia/PhysX team…

Lokfry