Basically I have a concave heightfield for the ground, and box that I'm trying to drop on it.
For simplicities sake, I decided only the corners of the box were substainatal. I binary search through time in order to find the collision point(s).
Once I do, I go through each corner, and, if it is within a certain distance of the ground it is directly over, I compute the following
Code: Select all
ComponentOfLinearVelocityFromAngular = AngularVelocity cross ArmInWorldSpace
LinearVelocity = PureLinearVelocity + ComponentOfLinearVelocityFromAngular
NormalVelocity = LinearSpeed projected onto Normal.
TangentalVelocity = LinearVelocity - NormalVelocity
CorrectionVelocity = -1.5 * NormalVelocity;
CorrectionTorque = ArmInWorldSpace cross CorrectionVelocity
Any ideas?[/i][/code]