Implementing a proper suspension movement and physics – Math and Physics


After spending some time with built vehicle components in Unreal Engine (WheelHandler) and Unity3D (WheelCollider), I found that both don’t have proper suspension movement. The wheels only move up and down on a vertical axis, as if the spring damper were connected directly above the wheel. But in reality it should move on an arc and affect camber depending on the type of suspension (leaf spring, double wishbone, strout).
In my suspension implementation, I have a WheelHub component that stays in the body and acts as the suspension wheel system. I’m just using a raycast model, just how WheelHandler and WheelCollider work. The WheelHub acts as a frame of reference, then other things like head angle, camber and spring compression are integrated into a virtual wheel position and rotation using Vector3 and Quaternion mathematics. Then the resulting rotation and position is applied to the actual mesh. Something like:

public void GetWheelPose(out Quaternion rotation, out Vector3 position)
{
   // Maths here. Use wheelhub as reference frame since it doesn't move
   // For example, steering
   Quaternion upRotation = Quaternion.AngleAxis(wheelUpVector, steeringAngle);
   rotation = wheelhub.rotation * upRotation;
   // wheel position based on suspension compression
   position = wheelhub.position + wheelhub.up * suspensionCompression;
}

Then the wheel mesh gets the approximate result to set its position and rotation (world coordinate).

GetWheelPose(out wheelMesh.rotation, out wheelMesh.position);

So my questions are:

Also Read :  OPPO Design In Tech: Making technology more nature-inspired yet human-centric

1- When the wheel moves along an arc, does it also change its lateral position a bit, does the tire on the wheel experience slip/scuff and wear out over time? Assuming the tire is very sticky and doesn’t move/slip sideways when the wheel is at a point in the arc, how would the body respond to the force the tire generates to hold it in place? Now, is this suspension movement even correct in real life?
2 – What would be the Vector3 and Quaternion math to calculate the position and rotation of the wheel based on travel? I don’t want to use methods in Transform like Transform.RotateAround() and just want to use Quaternion and Vector3. Currently I need a rotation around a virtual axis, like the image below, then how can I do that using quaternion math?

Also Read :  Listening in on 'the call' for Nobel Prize

Many thanks for your help. I’m sorry if I’m difficult to understand. English is not my first language but I will try my best to explain myself.

Images from Unreal Documentation. They’re not the most accurate, but they get the idea across.

Also Read :  Colonoscopy: What to know after study questions its effectiveness



Source link