59 for (
int32 i = 0; i < childCount; ++i)
101 s->~b2PolygonShape();
170 b2Vec2 displacement = transform2.
p - transform1.
p;
197 if (fixtureA ==
this || fixtureB ==
this)
231 b2Log(
" b2FixtureDef fd;\n");
245 b2Log(
" b2CircleShape shape;\n");
247 b2Log(
" shape.m_p.Set(%.15lef, %.15lef);\n", s->
m_p.
x, s->
m_p.
y);
254 b2Log(
" b2EdgeShape shape;\n");
268 b2Log(
" b2PolygonShape shape;\n");
281 b2Log(
" b2ChainShape shape;\n");
300 b2Log(
" fd.shape = &shape;\n");
302 b2Log(
" bodies[%d]->CreateFixture(&fd);\n", bodyIndex);
void Combine(const b2AABB &aabb)
Combine an AABB into this one.
b2Vec2 * m_vertices
The vertices. Owned by this class.
void b2Log(const char *string,...)
Logging function.
void Create(b2BlockAllocator *allocator, b2Body *body, const b2FixtureDef *def)
b2ContactManager m_contactManager
virtual b2Shape * Clone(b2BlockAllocator *allocator) const =0
Clone the concrete shape using the provided allocator.
void Dump(int32 bodyIndex)
Dump this fixture to the log file.
void Refilter()
Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldC...
b2ContactEdge * GetContactList()
void Synchronize(b2BroadPhase *broadPhase, const b2Transform &xf1, const b2Transform &xf2)
b2Vec2 m_vertex0
Optional adjacent vertices. These are used for smooth collision.
void Free(void *p, int32 size)
Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.
void SetFilterData(const b2Filter &filter)
~b2ChainShape()
The destructor frees the vertices using b2Free.
This proxy is used internally to connect fixtures to the broad-phase.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
virtual int32 GetChildCount() const =0
Get the number of child primitives.
A rigid body. These are created via b2World::CreateBody.
void * Allocate(int32 size)
Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.
int32 CreateProxy(const b2AABB &aabb, void *userData)
b2Filter filter
Contact filtering data.
This holds contact filtering data.
b2Vec2 m_vertices[b2_maxPolygonVertices]
void DestroyProxy(int32 proxyId)
Destroy a proxy. It is up to the client to remove any pairs.
void Destroy(b2BlockAllocator *allocator)
#define b2_maxPolygonVertices
void SetSensor(bool sensor)
Set if this fixture is a sensor.
float32 density
The density, usually in kg/m^2.
void * userData
Use this to store application specific fixture data.
An axis aligned bounding box.
void TouchProxy(int32 proxyId)
Call to trigger a re-processing of it's pairs on the next call to UpdatePairs.
b2Vec2 m_vertex1
These are the edge vertices.
void DestroyProxies(b2BroadPhase *broadPhase)
float32 restitution
The restitution (elasticity) usually in the range [0,1].
void CreateProxies(b2BroadPhase *broadPhase, const b2Transform &xf)
b2FixtureProxy * m_proxies
int32 m_count
The vertex count.
void MoveProxy(int32 proxyId, const b2AABB &aabb, const b2Vec2 &displacement)
virtual void ComputeAABB(b2AABB *aabb, const b2Transform &xf, int32 childIndex) const =0
uint16 categoryBits
The collision category bits. Normally you would just set one bit.
float32 friction
The friction coefficient, usually in the range [0,1].
b2World * GetWorld()
Get the parent world of this body.