static bool GetSingleSingleCollision(CircleCollisionSystem c1, CircleCollisionSystem c2) { return c1.IsCollision(c1.GetCollisionTarget(), c2.GetCollisionTarget()); }
static bool GetSingleMultiCollision(CircleCollisionSystem single, CircleCollisionSystem multi) { if (!GetSingleMultiCollisionPredict(single, multi)) { return false; } return GetSingleMultiCollision(single.GetCollisionTarget(), multi); }
static bool GetSingleMultiCollisionPredict(CircleCollisionSystem single, CircleCollisionSystem multi) { if (multi.IsNeedPredict()) { return single.IsCollision(multi.GetPredictateCollisionTarget(), single.GetCollisionTarget()); } else { return true; } }
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(); }