When compute wheelBottomVel why wheelBottomVel -= hitActorVelocity ?

``````//Compute the speed of the rigid body along the suspension travel dir at the
//bottom of the wheel.
const PxVec3 wheelBottomPos=v+w*(restT - jounce);
const PxVec3 r=wheelBottomPos-carChassisTrnsfm.p;
PxVec3 wheelBottomVel=carChassisLinVel;
wheelBottomVel+=carChassisAngVel.cross(r);

PxRigidDynamic* dynamicHitActor=NULL;
PxVec3 hitActorVelocity(0,0,0);
if(hitContactActors4[i] && ((dynamicHitActor = hitContactActors4[i]->is<PxRigidDynamic>()) != NULL))
{
hitActorVelocity = PxRigidBodyExt::getVelocityAtPos(*dynamicHitActor,wheelBottomPos);
wheelBottomVel -= hitActorVelocity;
}
``````

in the func processSuspTireWheels
after compute the suspension jounce
iterate 4 wheels and compute so many things
here is my question:

1. What’s the meaning of carChassisAngVel.cross® ,r is a vector from the center to the wheel bottom?
2. Why wheelBottomVel-=hitActorVelocity when the wheel hit dynamicRigidActor?
1. Rigid body mechanics allows us to compute the velocity of a rigid body at any point in space

v§ = vLinear + omega*(P - x)

where P is a point in space, vLinear is the linear velocity of the rigid body, omega is the angular
velocity of the rigid body, x is the position of the rigid body. This is used to compute the velocity of the rigid body at the bottom of each wheel:

``````const PxVec3 r=wheelBottomPos-carChassisTrnsfm.p;
PxVec3 wheelBottomVel=carChassisLinVel;
wheelBottomVel+=carChassisAngVel.cross(r);
``````
1. We are interested in the relative velocity of the wheel. If it hits a static object then the relative velocity is just the velocity of the wheel itself because it is in contact with another rigid body with zero velocity. When the wheel hits a dynamic actor we need to subtract off the actor’s velocity at the contact point to compute the relative velocity.

Hope this helps.

Thanks a lot ,very helpful