43 fixtureDef.
shape = &circle;
54 const float mg = massData.
mass * gravity.
y;
75 const float timeStep = 1.f / 60.f;
76 const float invTimeStep = 60.0f;
77 const int32 velocityIterations = 6;
78 const int32 positionIterations = 2;
80 world.
Step(timeStep, velocityIterations, positionIterations);
82 const float tol = 1e-5
f;
float mass
The mass of the shape, usually in kilograms.
b2Fixture * CreateFixture(const b2FixtureDef *def)
float density
The density, usually in kg/m^2.
void ComputeMass(b2MassData *massData, float density) const override
float GetReactionTorque(float inv_dt) const override
b2Vec2 GetReactionForce(float inv_dt) const override
Get the reaction force on bodyB at the joint anchor in Newtons.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
float minLength
Minimum length. Clamped to a stable minimum value.
b2Vec2 GetReactionForce(float inv_dt) const override
float GetReactionTorque(float inv_dt) const override
A rigid body. These are created via b2World::CreateBody.
DOCTEST_TEST_CASE("joint reactions")
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchorA, const b2Vec2 &anchorB)
b2Filter filter
Contact filtering data.
b2Joint * CreateJoint(const b2JointDef *def)
void Set(float x_, float y_)
Set this vector to some specified coordinates.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
float length
The rest length of this joint. Clamped to a stable minimum value.
b2Vec2 GetReactionForce(float inv_dt) const override
float maxLength
Maximum length. Must be greater than or equal to the minimum length.
void Step(float timeStep, int32 velocityIterations, int32 positionIterations)
This holds the mass data computed for a shape.
b2Body * CreateBody(const b2BodyDef *def)
float GetReactionTorque(float inv_dt) const override
Get the reaction torque on bodyB in N*m.