Example #1
0
 protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
 {
     GroupIgnorer value = other as GroupIgnorer;
     return
         value == null ||
         CanCollideInternal(value);
 }
Example #2
0
        protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
        {
            if (otherBody.IgnoresPhysicsLogics ||
                otherBody.IsBroadPhaseOnly)
            {
                return(true);
            }
            Wrapper wrapper;

            if (wrappers.TryGetValue(otherBody, out wrapper))
            {
                if (wrapper.lastUpdate == lastUpdate)
                {
                    return(wrapper.canCollide);
                }
                else
                {
                    wrapper.lastUpdate = lastUpdate;
                    wrapper.canCollide = true;
                    for (int index = 0; index < wrapper.bodies.Length; ++index)
                    {
                        if (!CanCollideInternal(thisBody, wrapper.bodies[index]))
                        {
                            wrapper.canCollide = false;
                            break;
                        }
                    }
                    return(wrapper.canCollide);
                }
            }
            else
            {
                return(CanCollideInternal(thisBody, otherBody));
            }
        }
Example #3
0
        protected override bool CanCollide(Body thisBody, Body otherBody, Physics2DDotNet.Ignorers.Ignorer other)
        {
            var body1        = (Jypeli.PhysicsBody)(thisBody.Tag);
            var body2        = (Jypeli.PhysicsBody)(otherBody.Tag);
            var otherIgnorer = other == null ? null : ((CollisionIgnorerAdapter)other).innerIgnorer;

            return(innerIgnorer.CanCollide(body1, body2, otherIgnorer));
        }
Example #4
0
        protected override bool CanCollide(Ignorer other)
        {
            GroupIgnorer value = other as GroupIgnorer;

            return
                (value == null ||
                 CanCollideInternal(value));
        }
Example #5
0
        protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
        {
            AdvGroupIgnorer value = other as AdvGroupIgnorer;

            return
                (value == null ||
                 CanCollideInternal(value));
        }
 protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
 {
     if (otherBody.IgnoresPhysicsLogics ||
         otherBody.IsBroadPhaseOnly)
     {
         return true;
     }
     Matrix2x3 m1, m2;
     Matrix2x3.Multiply(ref directionMatrix, ref thisBody.Matrices.ToWorld, out m1);
     Matrix2x3.Multiply(ref directionMatrix, ref otherBody.Matrices.ToWorld, out m2);
     BoundingRectangle r1, r2;
     thisBody.Shape.CalcBoundingRectangle(ref m1, out r1);
     otherBody.Shape.CalcBoundingRectangle(ref m2, out r2);
     return r1.Min.X + depthAllowed > r2.Max.X;
 }
Example #7
0
        protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
        {
            if (otherBody.IgnoresPhysicsLogics ||
                otherBody.IsBroadPhaseOnly)
            {
                return(true);
            }
            Matrix2x3 m1, m2;

            Matrix2x3.Multiply(ref directionMatrix, ref thisBody.Matrices.ToWorld, out m1);
            Matrix2x3.Multiply(ref directionMatrix, ref otherBody.Matrices.ToWorld, out m2);
            BoundingRectangle r1, r2;

            thisBody.Shape.CalcBoundingRectangle(ref m1, out r1);
            otherBody.Shape.CalcBoundingRectangle(ref m2, out r2);
            return(r1.Min.X + depthAllowed > r2.Max.X);
        }
Example #8
0
 internal static bool CanCollide(Ignorer left, Ignorer right)
 {
     return(left.CanCollideInternal(right));
 }
Example #9
0
 private bool CanCollideInternal(Body thisBody, Body otherBody, Ignorer other)
 {
     return isInverted ^ CanCollide(thisBody, otherBody, other);
 }
Example #10
0
 protected abstract bool CanCollide(Body thisBody, Body otherBody, Ignorer other);
Example #11
0
 internal static bool CanCollide(Body leftBody, Body rightBody, Ignorer left, Ignorer right)
 {
     return left.CanCollideInternal(leftBody, rightBody, right);
 }
Example #12
0
 protected Ignorer(Ignorer copy)
 {
     this.isInverted = copy.isInverted;
 }
Example #13
0
 protected abstract bool CanCollide(Ignorer other);
Example #14
0
 protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
 {
     return(other != this);
 }
Example #15
0
 protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
 {
     return other!= this;
 }
Example #16
0
        protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
        {
            if (otherBody.Tag == (object)"BulletTag")
            {
                return false;
            }

            return true;
        }
 protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other)
 {
     if (otherBody.IgnoresPhysicsLogics ||
         otherBody.IsBroadPhaseOnly)
     {
         return true;
     }
     Wrapper wrapper;
     if (wrappers.TryGetValue(otherBody, out wrapper))
     {
         if (wrapper.lastUpdate == lastUpdate)
         {
             return wrapper.canCollide;
         }
         else
         {
             wrapper.lastUpdate = lastUpdate;
             wrapper.canCollide = true;
             for (int index = 0; index < wrapper.bodies.Length; ++index)
             {
                 if (!CanCollideInternal(thisBody, wrapper.bodies[index]))
                 {
                     wrapper.canCollide = false;
                     break;
                 }
             }
             return wrapper.canCollide;
         }
     }
     else
     {
         return CanCollideInternal(thisBody,otherBody);
     }
 }
Example #18
0
 protected override bool CanCollide(Ignorer other)
 {
     return(other != this);
 }
Example #19
0
 private bool CanCollideInternal(Ignorer other)
 {
     return(isInverted ^ CanCollide(other));
 }
Example #20
0
 internal static bool CanCollide(Body leftBody, Body rightBody, Ignorer left, Ignorer right)
 {
     return(left.CanCollideInternal(leftBody, rightBody, right));
 }
Example #21
0
 protected abstract bool CanCollide(Body thisBody, Body otherBody, Ignorer other);
Example #22
0
 private bool CanCollideInternal(Body thisBody, Body otherBody, Ignorer other)
 {
     return(isInverted ^ CanCollide(thisBody, otherBody, other));
 }
Example #23
0
 protected Ignorer(Ignorer copy)
 {
     this.isInverted = copy.isInverted;
 }