41 categoryBits = 0x0001;
121 b2Shape::Type GetType()
const;
127 const b2Shape* GetShape()
const;
134 bool IsSensor()
const;
142 const b2Filter& GetFilterData()
const;
150 const b2Body* GetBody()
const;
163 bool TestPoint(
const b2Vec2& p)
const;
178 void SetDensity(
float density);
181 float GetDensity()
const;
184 float GetFriction()
const;
188 void SetFriction(
float friction);
191 float GetRestitution()
const;
195 void SetRestitution(
float restitution);
198 float GetRestitutionThreshold()
const;
202 void SetRestitutionThreshold(
float threshold);
207 const b2AABB& GetAABB(int32 childIndex)
const;
241 float m_restitutionThreshold;
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;
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
const b2Transform & GetTransform() const
Definition: b2_body.h:479
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
Definition: b2_shape.h:49
virtual void ComputeMass(b2MassData *massData, float density) const =0
Type GetType() const
Definition: b2_shape.h:105
virtual bool TestPoint(const b2Transform &xf, const b2Vec2 &p) const =0
virtual bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const =0
Definition: b2_world.h:47
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