public static bool Test(Object2D objA, Object2D objB, bool onlyLoFiTest) { return Test(objA.BoundingBoxes, objB.BoundingBoxes, onlyLoFiTest); }
public static bool TestWithInfo(Object2D objA, Object2D objB, out GameLibBoundingBox sourceBoundingBox, out GameLibBoundingBox targetBoundingBox) { bool useSat = (objA.CollisionMode == CollisionModes.SatBox && objB.CollisionMode == CollisionModes.SatBox); foreach (var boxA in objA.BoundingBoxes) { foreach (var boxB in objB.BoundingBoxes) { if (Test(boxA, boxB, !useSat)) { sourceBoundingBox = boxA; targetBoundingBox = boxB; return true; } } } sourceBoundingBox = null; targetBoundingBox = null; return false; }
//public virtual void OnObjectCollision(Object2D collidingObject) { collidingObjects.Add(collidingObject); } public virtual void OnObjectCollision(Object2D collidingObject, GameLibBoundingBox sourceBoundingBox, GameLibBoundingBox targetBoundingBox) { collidingObjects.Add(collidingObject); }