60 for (
int i = 0; i < 10; ++i)
108 anchor.
Set(-2.0
f, 1.0
f);
125 anchor.
Set(-7.0
f, 15.0
f);
153 anchor.
Set(6.0
f, 2.0
f);
169 anchor.
Set(7.5
f, 4.0
f);
203 for (
int32 i = 0; i < 4; ++i)
b2Fixture * CreateFixture(const b2FixtureDef *def)
float density
The density, usually in kg/m^2.
B2_API const b2Vec2 b2Vec2_zero
Useful constant.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
float Length() const
Get the length of this vector (the norm).
float stiffness
The linear stiffness in N/m.
void SetTwoSided(const b2Vec2 &v1, const b2Vec2 &v2)
Set this as an isolated edge. Collision is two-sided.
void SetAsBox(float hx, float hy)
A rigid body. These are created via b2World::CreateBody.
b2Joint * CreateJoint(const b2JointDef *def)
bool collideConnected
Set this flag to true if the attached bodies should collide.
void Set(float x_, float y_)
Set this vector to some specified coordinates.
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
B2_API void b2LinearStiffness(float &stiffness, float &damping, float frequencyHertz, float dampingRatio, const b2Body *bodyA, const b2Body *bodyB)
Utility to compute linear stiffness values from frequency and damping ratio.
float angle
The world angle of the body in radians.
float length
The rest length of this joint. Clamped to a stable minimum value.
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
b2Body * bodyA
The first attached body.
float damping
The linear damping in N*s/m.
b2Body * CreateBody(const b2BodyDef *def)
b2Body * bodyB
The second attached body.
float friction
The friction coefficient, usually in the range [0,1].