41 categoryBits = 0x0001;
127 const b2Shape* GetShape()
const;
130 void SetSensor(
bool sensor);
134 bool IsSensor()
const;
139 void SetFilterData(
const b2Filter& filter);
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);
210 void Dump(
int32 bodyIndex);
255 return m_shape->GetType();
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;
const b2Filter & GetFilterData() const
Get the contact filtering data.
float density
The density, usually in kg/m^2.
void SetFriction(float friction)
void SetDensity(float density)
float GetRestitutionThreshold() const
Get the restitution velocity threshold.
#define b2_lengthUnitsPerMeter
Define this macro in your build if you want to override settings.
You can define this to inject whatever data you want in b2Fixture.
const b2AABB & GetAABB(int32 childIndex) const
This proxy is used internally to connect fixtures to the broad-phase.
b2FixtureUserData & GetUserData()
A rigid body. These are created via b2World::CreateBody.
void GetMassData(b2MassData *massData) const
b2Filter filter
Contact filtering data.
float GetFriction() const
Get the coefficient of friction.
This holds contact filtering data.
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, int32 childIndex) const
float restitutionThreshold
b2FixtureUserData userData
Use this to store application specific fixture data.
bool TestPoint(const b2Vec2 &p) const
bool b2IsValid(float x)
This function is used to ensure that a floating point number is not a NaN or infinity.
void SetRestitutionThreshold(float threshold)
float GetDensity() const
Get the density of this fixture.
b2FixtureDef()
The constructor sets the default fixture definition values.
float GetRestitution() const
Get the coefficient of restitution.
An axis aligned bounding box.
b2FixtureUserData m_userData
b2FixtureProxy * m_proxies
uint16 categoryBits
The collision category bits. Normally you would just set one bit.
float restitution
The restitution (elasticity) usually in the range [0,1].
This holds the mass data computed for a shape.
float m_restitutionThreshold
b2Shape::Type GetType() const
float friction
The friction coefficient, usually in the range [0,1].
void SetRestitution(float restitution)