getVelocityReflection method

Vector2 getVelocityReflection(
  1. PositionComponent other,
  2. CollisionData data
)

Implementation

Vector2 getVelocityReflection(
  PositionComponent other,
  CollisionData data,
) {
  if (_bodyType.isStatic) {
    return velocity;
  }
  return data.normal * velocity.dot(data.normal);
}