b2WorldCallbacks.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 * 1. The origin of this software must not be misrepresented; you must not
11 * claim that you wrote the original software. If you use this software
12 * in a product, an acknowledgment in the product documentation would be
13 * appreciated but is not required.
14 * 2. Altered source versions must be plainly marked as such, and must not be
15 * misrepresented as being the original software.
16 * 3. This notice may not be removed or altered from any source distribution.
17 */
18 
19 #ifndef B2_WORLD_CALLBACKS_H
20 #define B2_WORLD_CALLBACKS_H
21 
23 
24 struct b2Vec2;
25 struct b2Transform;
26 class b2Fixture;
27 class b2Body;
28 class b2Joint;
29 class b2Contact;
30 struct b2ContactResult;
31 struct b2Manifold;
32 
37 {
38 public:
40 
43  virtual void SayGoodbye(b2Joint* joint) = 0;
44 
47  virtual void SayGoodbye(b2Fixture* fixture) = 0;
48 };
49 
53 {
54 public:
55  virtual ~b2ContactFilter() {}
56 
59  virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB);
60 };
61 
66 {
67  float32 normalImpulses[b2_maxManifoldPoints];
68  float32 tangentImpulses[b2_maxManifoldPoints];
70 };
71 
82 {
83 public:
84  virtual ~b2ContactListener() {}
85 
87  virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); }
88 
90  virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); }
91 
102  virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
103  {
104  B2_NOT_USED(contact);
105  B2_NOT_USED(oldManifold);
106  }
107 
114  virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)
115  {
116  B2_NOT_USED(contact);
117  B2_NOT_USED(impulse);
118  }
119 };
120 
124 {
125 public:
126  virtual ~b2QueryCallback() {}
127 
130  virtual bool ReportFixture(b2Fixture* fixture) = 0;
131 };
132 
136 {
137 public:
138  virtual ~b2RayCastCallback() {}
139 
151  virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point,
152  const b2Vec2& normal, float32 fraction) = 0;
153 };
154 
155 #endif
virtual void EndContact(b2Contact *contact)
Called when two fixtures cease to touch.
virtual ~b2QueryCallback()
virtual void PostSolve(b2Contact *contact, const b2ContactImpulse *impulse)
virtual void BeginContact(b2Contact *contact)
Called when two fixtures begin to touch.
virtual ~b2ContactFilter()
virtual ~b2RayCastCallback()
#define B2_NOT_USED(x)
Definition: b2Settings.h:26
#define b2_maxManifoldPoints
Definition: b2Settings.h:50
A 2D column vector.
Definition: b2Math.h:52
virtual void SayGoodbye(b2Joint *joint)=0
signed int int32
Definition: b2Settings.h:31
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
virtual ~b2DestructionListener()
virtual ~b2ContactListener()
virtual void PreSolve(b2Contact *contact, const b2Manifold *oldManifold)
float float32
Definition: b2Settings.h:35


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:51