This should work, it totally negates the direction of the wind force if
hitting the "front" of the object.
objnorm = VecNorm(GetRot);
dot = wind.x * objnorm.x + wind.y * objnorm.y + + wind.z * objnorm.z;
if dot < 0
wind = -wind;
SetForce (wind);
Or did you want only the component of the wind perpendicular to the wall to
be negated?
if dot < 0
Wind = wind - 2 * dot * objnorm;
Or did you want the component of wind perpendicular to the wall to be zero
(as I think John explained)?
if dot < 0
Wind = wind - dot * objnorm;
Post a reply to this message
|