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