86 float frequencyHz = 5.0f;
87 float dampingRatio = 0.7f;
90 for (
int32 i = 0; i < 3; ++i)
117 b2Body* prevBody = ground;
146 float frequencyHz = 8.0f;
147 float dampingRatio = 0.7f;
149 b2Body* prevBody = ground;
172 for (
int32 i = 0; i < 2; ++i)
175 vertices[0].
Set(-0.5
f, 0.0
f);
176 vertices[1].
Set(0.5
f, 0.0
f);
177 vertices[2].
Set(0.0
f, 1.5
f);
180 shape.
Set(vertices, 3);
193 for (
int32 i = 0; i < 2; ++i)
b2Fixture * CreateFixture(const b2FixtureDef *def)
float density
The density, usually in kg/m^2.
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)
void Set(float x_, float y_)
Set this vector to some specified coordinates.
float damping
The rotational damping in N*m*s.
void Set(const b2Vec2 *points, int32 count)
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
b2Body * bodyA
The first attached body.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
B2_API void b2AngularStiffness(float &stiffness, float &damping, float frequencyHertz, float dampingRatio, const b2Body *bodyA, const b2Body *bodyB)
Utility to compute rotational stiffness values frequency and damping ratio.
b2Body * CreateBody(const b2BodyDef *def)
b2Body * bodyB
The second attached body.