Пример #1
0
 static bool GetSingleSingleCollision(CircleCollisionSystem c1, CircleCollisionSystem c2)
 {
     return c1.IsCollision(c1.GetCollisionTarget(), c2.GetCollisionTarget());
 }
Пример #2
0
 static bool GetSingleMultiCollision(CircleCollisionSystem single, CircleCollisionSystem multi)
 {
     if (!GetSingleMultiCollisionPredict(single, multi))
     {
         return false;
     }
     return GetSingleMultiCollision(single.GetCollisionTarget(), multi);
 }
Пример #3
0
 static bool GetSingleMultiCollisionPredict(CircleCollisionSystem single, CircleCollisionSystem multi)
 {
     if (multi.IsNeedPredict())
     {
         return single.IsCollision(multi.GetPredictateCollisionTarget(), single.GetCollisionTarget());
     }
     else
     {
         return true;
     }
 }
Пример #4
0
 public bool GetCollision(CircleCollisionSystem target)
 {
     if (IsCollision(GetCollisionTarget(), target.GetCollisionTarget()))//コア判定
     {
         return true;
     }
     bool mul1 = IsMultiCollision();
     bool mul2 = target.IsMultiCollision();
     if (!mul1 && !mul2)//single-singleならend
     {
         return false;
     }
     if (mul1 && mul2)
     {
         return GetMultiMultiCollision(this, target);
     }
     if (!mul1 && mul2)
     {
         return GetSingleMultiCollision(this, target);
     }
     if (mul1 && !mul2)
     {
         return GetSingleMultiCollision(target, this);
     }
     throw new Exception();
 }