67 float frequencyHz = 2.0f;
68 float dampingRatio = 0.0f;
165 for (
int32 i = 0; i < 4; ++i)
177 for (
int32 i = 0; i < 8; ++i)
199 for (
int32 i = 0; i < 8; ++i)
b2Fixture * CreateFixture(const b2FixtureDef *def)
void Step(Settings &settings) override
float Length() const
Get the length of this vector (the norm).
float stiffness
The linear stiffness in N/m.
void Keyboard(int key) override
void DestroyJoint(b2Joint *joint)
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.
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 length
The rest length of this joint. Clamped to a stable minimum value.
void DestroyBody(b2Body *body)
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
void DrawString(int x, int y, const char *string,...)
void JointDestroyed(b2Joint *joint) override
virtual void Step(Settings &settings)
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.