Hi,
I’m making a monster truck game, so I have large exposed wheels, and I need the outer, upper and lateral surfaces to have traction as well as the lower surface, and also wheel width is significant.
The PhysX 3.4 WheelCollider is not a good match for this.
3.4 has a 2D “disc” with a single point of traction that is always (unless you get hacky) pointing down with respect to the vehicle frame.
It also doesn’t do well with wheel-wheel collisions (it ignores them until the traction-point raycasts overlap, at which point it launches the vehicles into space:)
So, it works reasonably for thin wheels that are effectively enclosed by the vehicle body, but not for my monster trucks.
Will PhysX 4.0 provide anything that will “just work”?
I’m embarking upon implementing my own suspension and collider system, but if the problem is already solved, I’d love to hear that:)
I’m using Unity, so I don’t have 4.0 yet to play with yet (as far as I can tell).
(Ah, this is on Windows 10 initially, but I don’t think that matters).
Thanks!
Regards,
RR
PhysX vehicles have supported volumetric wheels since 3.4. It works with a combination of sweeps (to replace raycasts) and contact modification to classify rigid body contacts as drivable contacts and non-drivable contacts. 3.4 ships with a snippet that shows how this works.
I don’t think this is integrated in unity. It is supported in UE4 but I don’t think Unity has integrated this feature.
Cheers,
Gordon
Hi,
Thanks for your reply (& pardon my ignorance:), that sounds promising!
So, I’m looking at this:
https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Vehicles.html#wheel-contact-beyond-raycasts
So I think the wheels in PhysX 3.4 can now be 2D “discs” rather than (effectively) “1D” rays?
So, the wheel will “exist” in the vertical and “forward” directions, but will have no width (so I guess for width I could define several discs)?
I’m wondering how it will cope with contacts on the outer “left and right” surfaces of the wheels, rather than the usual driving surface (the 3.3 rays had an odd wobbling/ “kicking” motion (apologies if this is more of a Unity thing than a PhysX thing) if a truck landed on its side):
Thanks again,
RR
When the wheels are simulated with raycasts they are modelled with planar discs. However, when they are simulated with swept shapes they are modelled as 3d volumes. The key point here is that the sweeps use the PxShape associated with the wheel. The width and radius are embedded into the geometry of the wheel shape.
Ok, thanks again.
Sorry I didn’t understand the difference between sweeps and raycasts:$
I’m reading about this here now: https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/3.3.4/Manual/GeometryQueries.html
A raycast projects a point along a vector until it hits something. A sweep projects a volume along a vector until it hits something. For vehicles, the volume that is projected is the PxShape associated with the wheel. Hope this helps.