public bool IsContact(PhysicalSphere sphere) { float dot = Vector3.Dot(sphere.Velocity, normal); if (dot > 0f) { return(false); } return(Distance(sphere) <= sphere.Radius); }
float Distance(PhysicalSphere sphere) { return(Vector3.Dot(sphere.Position - position, normal)); }
public Vector3 CorrectedPosition(PhysicalSphere sphere) { return(ContactPosition(sphere) + normal * sphere.Radius); }
public Vector3 ContactPosition(PhysicalSphere sphere) { return(sphere.Position - Distance(sphere) * normal); }
public void Bounce(PhysicalSphere sphere) { }