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;
164 bool TestPoint(
const b2Vec2& p)
const;
179 void SetDensity(
float density);
182 float GetDensity()
const;
185 float GetFriction()
const;
189 void SetFriction(
float friction);
192 float GetRestitution()
const;
196 void SetRestitution(
float restitution);
199 float GetRestitutionThreshold()
const;
203 void SetRestitutionThreshold(
float threshold);
208 const b2AABB& GetAABB(int32 childIndex)
const;
242 float m_restitutionThreshold;
311 b2Assert(b2IsValid(density) && density >= 0.0f);
327 m_friction = friction;
332 return m_restitution;
337 m_restitution = restitution;
342 return m_restitutionThreshold;
347 m_restitutionThreshold = threshold;
367 b2Assert(0 <= childIndex && childIndex < m_proxyCount);
368 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:476
Definition b2_broad_phase.h:41
Definition b2_fixture.h:117
b2Fixture * GetNext()
Definition b2_fixture.h:299
void SetFriction(float friction)
Definition b2_fixture.h:325
const b2AABB & GetAABB(int32 childIndex) const
Definition b2_fixture.h:365
void SetFilterData(const b2Filter &filter)
float GetRestitutionThreshold() const
Get the restitution velocity threshold.
Definition b2_fixture.h:340
float GetFriction() const
Get the coefficient of friction.
Definition b2_fixture.h:320
void GetMassData(b2MassData *massData) const
Definition b2_fixture.h:360
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:345
float GetRestitution() const
Get the coefficient of restitution.
Definition b2_fixture.h:330
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:309
b2Shape::Type GetType() const
Definition b2_fixture.h:254
b2Body * GetBody()
Definition b2_fixture.h:289
bool TestPoint(const b2Vec2 &p) const
Definition b2_fixture.h:350
b2Shape * GetShape()
Definition b2_fixture.h:259
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, int32 childIndex) const
Definition b2_fixture.h:355
void SetRestitution(float restitution)
Definition b2_fixture.h:335
const b2Filter & GetFilterData() const
Get the contact filtering data.
Definition b2_fixture.h:274
float GetDensity() const
Get the density of this fixture.
Definition b2_fixture.h:315
bool IsSensor() const
Definition b2_fixture.h:269
b2FixtureUserData & GetUserData()
Definition b2_fixture.h:279
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
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