protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other) { GroupIgnorer value = other as GroupIgnorer; return value == null || CanCollideInternal(value); }
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)); } }
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)); }
protected override bool CanCollide(Ignorer other) { GroupIgnorer value = other as GroupIgnorer; return (value == null || CanCollideInternal(value)); }
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; }
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); }
internal static bool CanCollide(Ignorer left, Ignorer right) { return(left.CanCollideInternal(right)); }
private bool CanCollideInternal(Body thisBody, Body otherBody, Ignorer other) { return isInverted ^ CanCollide(thisBody, otherBody, other); }
protected abstract bool CanCollide(Body thisBody, Body otherBody, Ignorer other);
internal static bool CanCollide(Body leftBody, Body rightBody, Ignorer left, Ignorer right) { return left.CanCollideInternal(leftBody, rightBody, right); }
protected Ignorer(Ignorer copy) { this.isInverted = copy.isInverted; }
protected abstract bool CanCollide(Ignorer other);
protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other) { return(other != this); }
protected override bool CanCollide(Body thisBody, Body otherBody, Ignorer other) { return other!= this; }
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); } }
protected override bool CanCollide(Ignorer other) { return(other != this); }
private bool CanCollideInternal(Ignorer other) { return(isInverted ^ CanCollide(other)); }
internal static bool CanCollide(Body leftBody, Body rightBody, Ignorer left, Ignorer right) { return(left.CanCollideInternal(leftBody, rightBody, right)); }
private bool CanCollideInternal(Body thisBody, Body otherBody, Ignorer other) { return(isInverted ^ CanCollide(thisBody, otherBody, other)); }