コード例 #1
0
ファイル: PhysicalPlane.cs プロジェクト: Pinksess/Pinball
        public bool IsContact(PhysicalSphere sphere)
        {
            float dot = Vector3.Dot(sphere.Velocity, normal);

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

            return(Distance(sphere) <= sphere.Radius);
        }
コード例 #2
0
ファイル: PhysicalPlane.cs プロジェクト: Pinksess/Pinball
 float Distance(PhysicalSphere sphere)
 {
     return(Vector3.Dot(sphere.Position - position, normal));
 }
コード例 #3
0
ファイル: PhysicalPlane.cs プロジェクト: Pinksess/Pinball
 public Vector3 CorrectedPosition(PhysicalSphere sphere)
 {
     return(ContactPosition(sphere) + normal * sphere.Radius);
 }
コード例 #4
0
ファイル: PhysicalPlane.cs プロジェクト: Pinksess/Pinball
 public Vector3 ContactPosition(PhysicalSphere sphere)
 {
     return(sphere.Position - Distance(sphere) * normal);
 }
コード例 #5
0
ファイル: PhysicalPlane.cs プロジェクト: Pinksess/Pinball
 public void Bounce(PhysicalSphere sphere)
 {
 }