Box2D
2.3.0
A 2D Physics Engine for Games
Main Page
Classes
Files
File List
File Members
Box2D
Dynamics
b2WorldCallbacks.h
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
22
#include <
Box2D/Common/b2Settings.h
>
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
36
class
b2DestructionListener
37
{
38
public
:
39
virtual
~
b2DestructionListener
() {}
40
43
virtual
void
SayGoodbye
(
b2Joint
* joint) = 0;
44
47
virtual
void
SayGoodbye
(
b2Fixture
* fixture) = 0;
48
};
49
52
class
b2ContactFilter
53
{
54
public
:
55
virtual
~
b2ContactFilter
() {}
56
59
virtual
bool
ShouldCollide
(
b2Fixture
* fixtureA,
b2Fixture
* fixtureB);
60
};
61
65
struct
b2ContactImpulse
66
{
67
float32 normalImpulses[
b2_maxManifoldPoints
];
68
float32 tangentImpulses[
b2_maxManifoldPoints
];
69
int32 count;
70
};
71
81
class
b2ContactListener
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
123
class
b2QueryCallback
124
{
125
public
:
126
virtual
~
b2QueryCallback
() {}
127
130
virtual
bool
ReportFixture
(
b2Fixture
* fixture) = 0;
131
};
132
135
class
b2RayCastCallback
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
Generated on Mon Apr 20 2015 17:57:20 for Box2D by
1.8.8