b2Fixture Class Reference
#include <b2Fixture.h>
List of all members.
Detailed Description
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.
- Warning:
- you cannot reuse fixtures.
Constructor & Destructor Documentation
b2Fixture::b2Fixture |
( |
|
) |
[protected] |
b2Fixture::~b2Fixture |
( |
|
) |
[protected] |
Member Function Documentation
void b2Fixture::DestroyProxy |
( |
b2BroadPhase * |
broadPhase |
) |
[protected] |
const b2AABB & b2Fixture::GetAABB |
( |
|
) |
const [inline] |
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.
const b2Body * b2Fixture::GetBody |
( |
|
) |
const [inline] |
b2Body * b2Fixture::GetBody |
( |
|
) |
[inline] |
Get the parent body of this fixture. This is NULL if the fixture is not attached.
- Returns:
- the parent body.
float32 b2Fixture::GetDensity |
( |
|
) |
const [inline] |
Get the density of this fixture.
const b2Filter & b2Fixture::GetFilterData |
( |
|
) |
const [inline] |
Get the contact filtering data.
float32 b2Fixture::GetFriction |
( |
|
) |
const [inline] |
Get the coefficient of friction.
void b2Fixture::GetMassData |
( |
b2MassData * |
massData |
) |
const [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.
const b2Fixture * b2Fixture::GetNext |
( |
|
) |
const [inline] |
Get the next fixture in the parent body's fixture list.
- Returns:
- the next shape.
float32 b2Fixture::GetRestitution |
( |
|
) |
const [inline] |
Get the coefficient of restitution.
const b2Shape * b2Fixture::GetShape |
( |
|
) |
const [inline] |
b2Shape * b2Fixture::GetShape |
( |
|
) |
[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.
Get the type of the child shape. You can use this to down cast to the concrete shape.
- Returns:
- the shape type.
void * b2Fixture::GetUserData |
( |
|
) |
const [inline] |
Get the user data that was assigned in the fixture definition. Use this to store your application specific data.
bool b2Fixture::IsSensor |
( |
|
) |
const [inline] |
Is this fixture a sensor (non-solid)?
- Returns:
- the true if the shape is a sensor.
Cast a ray against this shape.
- Parameters:
-
| output | the ray-cast results. |
| input | the ray-cast input parameters. |
void b2Fixture::SetDensity |
( |
float32 |
density |
) |
[inline] |
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.
void b2Fixture::SetFilterData |
( |
const b2Filter & |
filter |
) |
|
Set the contact filtering data. This will not update contacts until the next time step when either parent body is active and awake.
void b2Fixture::SetFriction |
( |
float32 |
friction |
) |
[inline] |
Set the coefficient of friction.
void b2Fixture::SetRestitution |
( |
float32 |
restitution |
) |
[inline] |
Set the coefficient of restitution.
void b2Fixture::SetSensor |
( |
bool |
sensor |
) |
|
Set if this fixture is a sensor.
void b2Fixture::SetUserData |
( |
void * |
data |
) |
[inline] |
Set the user data. Use this to store your application specific data.
bool b2Fixture::TestPoint |
( |
const b2Vec2 & |
p |
) |
const [inline] |
Test a point for containment in this fixture.
- Parameters:
-
| xf | the shape world transform. |
| p | a point in world coordinates. |
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following files: