#include <b2Fixture.h>
Protected Member Functions | |
b2Fixture () | |
void | Create (b2BlockAllocator *allocator, b2Body *body, const b2FixtureDef *def) |
void | CreateProxies (b2BroadPhase *broadPhase, const b2Transform &xf) |
void | Destroy (b2BlockAllocator *allocator) |
void | DestroyProxies (b2BroadPhase *broadPhase) |
void | Synchronize (b2BroadPhase *broadPhase, const b2Transform &xf1, const b2Transform &xf2) |
Protected Attributes | |
b2Body * | m_body |
float32 | m_density |
b2Filter | m_filter |
float32 | m_friction |
bool | m_isSensor |
b2Fixture * | m_next |
b2FixtureProxy * | m_proxies |
int32 | m_proxyCount |
float32 | m_restitution |
b2Shape * | m_shape |
void * | m_userData |
Friends | |
class | b2Body |
class | b2Contact |
class | b2ContactManager |
class | b2World |
A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via b2Body::CreateFixture.
Definition at line 107 of file b2Fixture.h.
|
protected |
Definition at line 30 of file b2Fixture.cpp.
|
protected |
Definition at line 41 of file b2Fixture.cpp.
|
protected |
Definition at line 122 of file b2Fixture.cpp.
|
protected |
Definition at line 69 of file b2Fixture.cpp.
|
protected |
Definition at line 139 of file b2Fixture.cpp.
Dump this fixture to the log file.
Definition at line 229 of file b2Fixture.cpp.
Get the fixture's AABB. This AABB may be enlarge and/or stale. If you need a more accurate AABB, compute it using the shape and the body transform.
Definition at line 339 of file b2Fixture.h.
|
inline |
Get the parent body of this fixture. This is NULL if the fixture is not attached.
Definition at line 273 of file b2Fixture.h.
Definition at line 278 of file b2Fixture.h.
|
inline |
Get the density of this fixture.
Definition at line 299 of file b2Fixture.h.
Get the contact filtering data.
Definition at line 258 of file b2Fixture.h.
|
inline |
Get the coefficient of friction.
Definition at line 304 of file b2Fixture.h.
|
inline |
Get the mass data for this fixture. The mass data is based on the density and the shape. The rotational inertia is about the shape's origin. This operation may be expensive.
Definition at line 334 of file b2Fixture.h.
|
inline |
Get the next fixture in the parent body's fixture list.
Definition at line 283 of file b2Fixture.h.
Definition at line 288 of file b2Fixture.h.
|
inline |
Get the coefficient of restitution.
Definition at line 314 of file b2Fixture.h.
|
inline |
Get the child shape. You can modify the child shape, however you should not change the number of vertices because this will crash some collision caching mechanisms. Manipulating the shape may lead to non-physical behavior.
Definition at line 243 of file b2Fixture.h.
Definition at line 248 of file b2Fixture.h.
|
inline |
Get the type of the child shape. You can use this to down cast to the concrete shape.
Definition at line 238 of file b2Fixture.h.
|
inline |
Get the user data that was assigned in the fixture definition. Use this to store your application specific data.
Definition at line 263 of file b2Fixture.h.
|
inline |
Is this fixture a sensor (non-solid)?
Definition at line 253 of file b2Fixture.h.
|
inline |
Cast a ray against this shape.
output | the ray-cast results. |
input | the ray-cast input parameters. |
Definition at line 329 of file b2Fixture.h.
void b2Fixture::Refilter | ( | ) |
Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide.
Definition at line 183 of file b2Fixture.cpp.
Set the density of this fixture. This will not automatically adjust the mass of the body. You must call b2Body::ResetMassData to update the body's mass.
Definition at line 293 of file b2Fixture.h.
Set the contact filtering data. This will not update contacts until the next time step when either parent body is active and awake. This automatically calls Refilter.
Definition at line 176 of file b2Fixture.cpp.
Set the coefficient of friction. This will not change the friction of existing contacts.
Definition at line 309 of file b2Fixture.h.
Set the coefficient of restitution. This will not change the restitution of existing contacts.
Definition at line 319 of file b2Fixture.h.
void b2Fixture::SetSensor | ( | bool | sensor | ) |
Set if this fixture is a sensor.
Definition at line 220 of file b2Fixture.cpp.
Set the user data. Use this to store your application specific data.
Definition at line 268 of file b2Fixture.h.
|
protected |
Definition at line 152 of file b2Fixture.cpp.
Test a point for containment in this fixture.
p | a point in world coordinates. |
Definition at line 324 of file b2Fixture.h.
|
friend |
Definition at line 200 of file b2Fixture.h.
|
friend |
Definition at line 202 of file b2Fixture.h.
|
friend |
Definition at line 203 of file b2Fixture.h.
|
friend |
Definition at line 201 of file b2Fixture.h.
|
protected |
Definition at line 221 of file b2Fixture.h.
|
protected |
Definition at line 218 of file b2Fixture.h.
|
protected |
Definition at line 231 of file b2Fixture.h.
|
protected |
Definition at line 225 of file b2Fixture.h.
|
protected |
Definition at line 233 of file b2Fixture.h.
|
protected |
Definition at line 220 of file b2Fixture.h.
|
protected |
Definition at line 228 of file b2Fixture.h.
|
protected |
Definition at line 229 of file b2Fixture.h.
|
protected |
Definition at line 226 of file b2Fixture.h.
|
protected |
Definition at line 223 of file b2Fixture.h.
|
protected |
Definition at line 235 of file b2Fixture.h.