I am making a game with PhysX about planes but I encountered a serious problem that causes my planes to crash dismally…
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