示例#1
0
 public static bool Test(Object2D objA, Object2D objB, bool onlyLoFiTest)
 {
     return Test(objA.BoundingBoxes, objB.BoundingBoxes, onlyLoFiTest);
 }
示例#2
0
        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;
        }
示例#3
0
 //public virtual void OnObjectCollision(Object2D collidingObject) { collidingObjects.Add(collidingObject); }
 public virtual void OnObjectCollision(Object2D collidingObject, GameLibBoundingBox sourceBoundingBox, GameLibBoundingBox targetBoundingBox)
 {
     collidingObjects.Add(collidingObject);
 }