private bool OnCollidedWith(Fixture f1, WorldGeometry2 collidedWith, Fixture f2, Contact contact) { this.PatrolDirection *= -1; return true; }
void OnSeparation(Fixture f, WorldGeometry2 wg, Fixture wF) { collided.RemoveWhere(x => x.Item1 == wF); }
bool HitWorld(Fixture wheel, WorldGeometry2 w, Fixture wFix, Contact c) { if (!wheel.IsSensor && midLunge && waitForWorldContact) { midLunge = false; waitForWorldContact = false; var force = character.Position - Physics.Position; if (force.X > 0 && WheelSpeed < 0 || force.X < 0 && WheelSpeed > 0) WheelSpeed *= -1; } return c.Enabled; }
bool OnCollidedWith(Fixture f, WorldGeometry2 wg, Fixture wF, Contact info) { Vector2 norm; FarseerPhysics.Common.FixedArray2<Vector2> pts; info.GetWorldManifold(out norm, out pts); norm.Normalize(); if (!collided.Any(x => x.Item1 == wF)) collided.Add(Tuple.Create(wF, norm)); Physics.IgnoreGravity = true; return info.Enabled; }
void LeftWorld(Fixture wheel, WorldGeometry2 w, Fixture wFix) { if (midLunge && !waitForWorldContact) { waitForWorldContact = true; } }