Example #1
0
        public bool IsContact(PhysicalSphere sphere)
        {
            float dot = Vector3.Dot(sphere.Velocity, normal);

            if (dot > 0f)
            {
                return(false);
            }

            return(Distance(sphere) <= sphere.Radius);
        }
Example #2
0
 float Distance(PhysicalSphere sphere)
 {
     return(Vector3.Dot(sphere.Position - position, normal));
 }
Example #3
0
 public Vector3 CorrectedPosition(PhysicalSphere sphere)
 {
     return(ContactPosition(sphere) + normal * sphere.Radius);
 }
Example #4
0
 public Vector3 ContactPosition(PhysicalSphere sphere)
 {
     return(sphere.Position - Distance(sphere) * normal);
 }
Example #5
0
 public void Bounce(PhysicalSphere sphere)
 {
 }