116class B2_API b2Fixture
155 const b2Fixture*
GetNext()
const;
215 friend class b2World;
216 friend class b2Contact;
217 friend class b2ContactManager;
241 float m_restitutionThreshold;
255 return m_shape->GetType();
305 b2Assert(b2IsValid(density) && density >= 0.0f);
321 m_friction = friction;
326 return m_restitution;
331 m_restitution = restitution;
336 return m_restitutionThreshold;
341 m_restitutionThreshold = threshold;
346 return m_shape->TestPoint(m_body->GetTransform(), p);
351 return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex);
356 m_shape->ComputeMass(massData, m_density);
361 b2Assert(0 <= childIndex && childIndex < m_proxyCount);
362 return m_proxies[childIndex].aabb;
#define b2_lengthUnitsPerMeter
Define this macro in your build if you want to override settings.
Definition b2_settings.h:49
Definition b2_block_allocator.h:38
A rigid body. These are created via b2World::CreateBody.
Definition b2_body.h:129
Definition b2_broad_phase.h:41
Definition b2_fixture.h:117
b2Fixture * GetNext()
Definition b2_fixture.h:293
void SetFriction(float friction)
Definition b2_fixture.h:319
const b2AABB & GetAABB(int32 childIndex) const
Definition b2_fixture.h:359
void SetFilterData(const b2Filter &filter)
float GetRestitutionThreshold() const
Get the restitution velocity threshold.
Definition b2_fixture.h:334
float GetFriction() const
Get the coefficient of friction.
Definition b2_fixture.h:314
void GetMassData(b2MassData *massData) const
Definition b2_fixture.h:354
void Refilter()
Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldC...
void SetRestitutionThreshold(float threshold)
Definition b2_fixture.h:339
float GetRestitution() const
Get the coefficient of restitution.
Definition b2_fixture.h:324
void Dump(int32 bodyIndex)
Dump this fixture to the log file.
void SetSensor(bool sensor)
Set if this fixture is a sensor.
void SetDensity(float density)
Definition b2_fixture.h:303
b2Shape::Type GetType() const
Definition b2_fixture.h:253
b2Body * GetBody()
Definition b2_fixture.h:283
bool TestPoint(const b2Vec2 &p) const
Definition b2_fixture.h:344
b2Shape * GetShape()
Definition b2_fixture.h:258
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, int32 childIndex) const
Definition b2_fixture.h:349
void SetRestitution(float restitution)
Definition b2_fixture.h:329
const b2Filter & GetFilterData() const
Get the contact filtering data.
Definition b2_fixture.h:273
float GetDensity() const
Get the density of this fixture.
Definition b2_fixture.h:309
bool IsSensor() const
Definition b2_fixture.h:268
b2FixtureUserData & GetUserData()
Definition b2_fixture.h:278
An axis aligned bounding box.
Definition b2_collision.h:169
This holds contact filtering data.
Definition b2_fixture.h:38
uint16 categoryBits
The collision category bits. Normally you would just set one bit.
Definition b2_fixture.h:47
uint16 maskBits
Definition b2_fixture.h:51
int16 groupIndex
Definition b2_fixture.h:56
Definition b2_fixture.h:62
float friction
The friction coefficient, usually in the range [0,1].
Definition b2_fixture.h:82
const b2Shape * shape
Definition b2_fixture.h:76
float density
The density, usually in kg/m^2.
Definition b2_fixture.h:92
b2FixtureUserData userData
Use this to store application specific fixture data.
Definition b2_fixture.h:79
b2Filter filter
Contact filtering data.
Definition b2_fixture.h:99
float restitution
The restitution (elasticity) usually in the range [0,1].
Definition b2_fixture.h:85
b2FixtureDef()
The constructor sets the default fixture definition values.
Definition b2_fixture.h:64
bool isSensor
Definition b2_fixture.h:96
float restitutionThreshold
Definition b2_fixture.h:89
This proxy is used internally to connect fixtures to the broad-phase.
Definition b2_fixture.h:104
You can define this to inject whatever data you want in b2Fixture.
Definition b2_settings.h:71
This holds the mass data computed for a shape.
Definition b2_shape.h:34
Definition b2_collision.h:162
A 2D column vector.
Definition b2_math.h:42