63 for (
int32 i = 0; i < childCount; ++i)
105 s->~b2PolygonShape();
201 if (fixtureA ==
this || fixtureB ==
this)
211 if (world ==
nullptr)
235 b2Dump(
" b2FixtureDef fd;\n");
250 b2Dump(
" b2CircleShape shape;\n");
259 b2Dump(
" b2EdgeShape shape;\n");
272 b2Dump(
" b2PolygonShape shape;\n");
285 b2Dump(
" b2ChainShape shape;\n");
302 b2Dump(
" fd.shape = &shape;\n");
304 b2Dump(
" 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 Create(b2BlockAllocator *allocator, b2Body *body, const b2FixtureDef *def)
float density
The density, usually in kg/m^2.
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.
b2Vec2 GetCenter() const
Get the center of the AABB.
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.
float restitutionThreshold
b2FixtureUserData userData
Use this to store application specific fixture 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)
void SetSensor(bool sensor)
Set if this fixture is a sensor.
An axis aligned bounding box.
b2FixtureUserData m_userData
void TouchProxy(int32 proxyId)
Call to trigger a re-processing of it's pairs on the next call to UpdatePairs.
void b2Dump(const char *string,...)
b2Vec2 m_vertex1
These are the edge vertices.
void DestroyProxies(b2BroadPhase *broadPhase)
void CreateProxies(b2BroadPhase *broadPhase, const b2Transform &xf)
#define b2_maxPolygonVertices
bool m_oneSided
Uses m_vertex0 and m_vertex3 to create smooth collision.
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.
float restitution
The restitution (elasticity) usually in the range [0,1].
float m_restitutionThreshold
float friction
The friction coefficient, usually in the range [0,1].
b2World * GetWorld()
Get the parent world of this body.