bool fixedRotation
Should this body be prevented from rotating? Useful for characters.
b2Fixture * CreateFixture(const b2FixtureDef *def)
void Step(Settings &settings) override
bool IsMotorEnabled() const
Is the joint motor enabled?
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
float GetMotorTorque(float inv_dt) const
b2Body * GetBodyB()
Get the second body attached to this 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)
void EnableMotor(bool flag)
Enable/disable the joint motor.
A rigid body. These are created via b2World::CreateBody.
float maxMotorForce
The maximum motor torque, usually in N-m.
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)
bool enableMotor
A flag to enable the joint motor.
b2PrismaticJoint * m_joint2
void Keyboard(int key) override
float motorSpeed
The desired motor speed. Usually in radians per second.
b2RevoluteJoint * m_joint1
bool enableMotor
Enable/disable the joint motor.
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
void EnableMotor(bool flag)
Enable/disable the joint motor.
void DrawString(int x, int y, const char *string,...)
virtual void Step(Settings &settings)
bool IsMotorEnabled() const
Is the joint motor enabled?
b2Body * CreateBody(const b2BodyDef *def)