NVIDIAGameWorks/PhysX

"Steered wheel" joint from the documentation doesn't work when powered

Opened this issue · 1 comments

I've noticed a very strange issue trying to use the D6 joint to make a "steered wheel" in Unreal Engine. According to the documentation, this is supposed to be supported:

https://gameworksdocs.nvidia.com/PhysX/4.1/documentation/physxguide/Manual/Joints.html#d6-joint

In vehicle applications, these joints can be used as 'steered wheel' joints in which the child actor is the wheel, free to rotate about its twist axis, while the free swing axis in the parent acts as the steering axis.

However, it seems that when you actually try to do that, it goes crazy when you then try to use the swing drive to steer the wheel.

Here is one such joint set up in Unreal Engine:
image
image
image

This is supposed to make a steered wheel that slowly spins without steering. However, the result is this, flapping about without any input at runtime:

UE4Editor_2022-06-29_19-23-33.mp4

In the end I tracked it down to the swing drive (accidentally?) being computed with the pose of the child actor rather than the parent one. To me this only makes sense for the twist drive, but not the swing one. After making this change: Zeblote@f3d4f0c I am able to control my wheel as intended, using the swing and twist drives separately to steer and drive.

UE4Editor_2022-06-29_22-19-06.mp4

I don't have a good understanding of that code, it would be nice for someone to clarify what the intended behavior is and whether this was a bug.

Thanks for reporting. I'm going through the code and I think you're right about this being an error. The swing axes should be in bodyA frame while the twist axis should be in body B frame.