WorldCallbacks.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Farseer Physics Engine based on Box2D.XNA port:
  3. * Copyright (c) 2010 Ian Qvist
  4. *
  5. * Box2D.XNA port of Box2D:
  6. * Copyright (c) 2009 Brandon Furtwangler, Nathan Furtwangler
  7. *
  8. * Original source Box2D:
  9. * Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com
  10. *
  11. * This software is provided 'as-is', without any express or implied
  12. * warranty. In no event will the authors be held liable for any damages
  13. * arising from the use of this software.
  14. * Permission is granted to anyone to use this software for any purpose,
  15. * including commercial applications, and to alter it and redistribute it
  16. * freely, subject to the following restrictions:
  17. * 1. The origin of this software must not be misrepresented; you must not
  18. * claim that you wrote the original software. If you use this software
  19. * in a product, an acknowledgment in the product documentation would be
  20. * appreciated but is not required.
  21. * 2. Altered source versions must be plainly marked as such, and must not be
  22. * misrepresented as being the original software.
  23. * 3. This notice may not be removed or altered from any source distribution.
  24. */
  25. using FarseerPhysics.Collision;
  26. using FarseerPhysics.Controllers;
  27. using FarseerPhysics.Dynamics.Contacts;
  28. using FarseerPhysics.Dynamics.Joints;
  29. using Microsoft.Xna.Framework;
  30. namespace FarseerPhysics.Dynamics
  31. {
  32. /// <summary>
  33. /// Called for each fixture found in the query. You control how the ray cast
  34. /// proceeds by returning a float:
  35. /// <returns>-1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue</returns>
  36. /// </summary>
  37. public delegate float RayCastCallback(Fixture fixture, Vector2 point, Vector2 normal, float fraction);
  38. /// <summary>
  39. /// This delegate is called when a contact is deleted
  40. /// </summary>
  41. public delegate void EndContactDelegate(Contact contact);
  42. /// <summary>
  43. /// This delegate is called when a contact is created
  44. /// </summary>
  45. public delegate bool BeginContactDelegate(Contact contact);
  46. public delegate void PreSolveDelegate(Contact contact, ref Manifold oldManifold);
  47. public delegate void PostSolveDelegate(Contact contact, ContactConstraint impulse);
  48. public delegate void FixtureDelegate(Fixture fixture);
  49. public delegate void JointDelegate(Joint joint);
  50. public delegate void BodyDelegate(Body body);
  51. public delegate void ControllerDelegate(Controller controller);
  52. public delegate bool CollisionFilterDelegate(Fixture fixtureA, Fixture fixtureB);
  53. public delegate void BroadphaseDelegate(ref FixtureProxy proxyA, ref FixtureProxy proxyB);
  54. public delegate bool BeforeCollisionEventHandler(Fixture fixtureA, Fixture fixtureB);
  55. public delegate bool OnCollisionEventHandler(Fixture fixtureA, Fixture fixtureB, Contact contact);
  56. public delegate void AfterCollisionEventHandler(Fixture fixtureA, Fixture fixtureB, Contact contact);
  57. public delegate void OnSeparationEventHandler(Fixture fixtureA, Fixture fixtureB);
  58. }