93 linearOffset.
x = 6.0f * sinf(2.0
f *
m_time);
94 linearOffset.
y = 8.0f + 4.0f * sinf(1.0
f * m_time);
96 float angularOffset = 4.0f *
m_time;
b2Fixture * CreateFixture(const b2FixtureDef *def)
void SetAngularOffset(float angularOffset)
Set/get the target angular offset, in radians.
float density
The density, usually in kg/m^2.
void DrawPoint(const b2Vec2 &p, float size, const b2Color &color) override
Draw a point.
void Initialize(b2Body *bodyA, b2Body *bodyB)
Initialize the bodies and offsets using the current transforms.
float maxForce
The maximum motor force in N.
void SetTwoSided(const b2Vec2 &v1, const b2Vec2 &v2)
Set this as an isolated edge. Collision is two-sided.
Color for debug drawing. Each value has the range [0,1].
void SetAsBox(float hx, float hy)
A rigid body. These are created via b2World::CreateBody.
void Step(Settings &settings) override
b2Joint * CreateJoint(const b2JointDef *def)
void SetLinearOffset(const b2Vec2 &linearOffset)
Set/get the target linear offset, in frame A, in meters.
float maxTorque
The maximum motor torque in N-m.
void Set(float x_, float y_)
Set this vector to some specified coordinates.
void Keyboard(int key) override
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
void DrawString(int x, int y, const char *string,...)
virtual void Step(Settings &settings)
b2Body * CreateBody(const b2BodyDef *def)
float friction
The friction coefficient, usually in the range [0,1].