Applying Coefficient of Restitution in a collision resolution method
问题 I have a collision resolution method in my physics engine, that goes like this: Vector2 n1pos = n1.NonLinearSpace != null ? n1.NonLinearPosition : n1.Position; Vector2 n2pos = n2.NonLinearSpace != null ? n2.NonLinearPosition : n2.Position; Vector2 posDiff = n2pos - n1pos; Vector2 posDiffNormal = posDiff; posDiffNormal.Normalize(); float totalRadius = n1.Radius + n2.Radius; float posDiffLength = posDiff.Length(); float interPenetration = totalRadius - posDiffLength; float averageRestitution =