101 b2Rot qA(aA), qB(aB);
287 b2Rot qA(aA), qB(aB);
291 b2Vec2 d = (cB - cA) + rB - rA;
406 b2Log(
" b2WheelJointDef jd;\n");
407 b2Log(
" jd.bodyA = bodies[%d];\n", indexA);
408 b2Log(
" jd.bodyB = bodies[%d];\n", indexB);
418 b2Log(
" joints[%d] = m_world->CreateJoint(&jd);\n",
m_index);
float32 GetJointSpeed() const
Get the current joint translation speed, usually in meters per second.
float32 b2Dot(const b2Vec2 &a, const b2Vec2 &b)
Perform the dot product on two vectors.
b2WheelJoint(const b2WheelJointDef *def)
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
bool SolvePositionConstraints(const b2SolverData &data)
b2Vec2 GetAnchorA() const
Get the anchor point on bodyA in world coordinates.
void b2Log(const char *string,...)
Logging function.
void SolveVelocityConstraints(const b2SolverData &data)
b2Vec2 GetAnchorB() const
Get the anchor point on bodyB in world coordinates.
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
void SetZero()
Set this vector to all zeros.
b2Vec2 localCenter
local center of mass position
float32 b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
float32 frequencyHz
Suspension frequency, zero indicates no suspension.
void SetMotorSpeed(float32 speed)
Set the motor speed, usually in radians per second.
A rigid body. These are created via b2World::CreateBody.
float32 motorSpeed
The desired motor speed in radians per second.
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
void SetMaxMotorTorque(float32 torque)
Set/Get the maximum motor force, usually in N-m.
b2Vec2 localAxisA
The local translation axis in bodyA.
b2Vec2 GetWorldVector(const b2Vec2 &localVector) const
bool enableMotor
Enable/disable the joint motor.
void Dump()
Dump to b2Log.
float32 maxMotorTorque
The maximum motor torque, usually in N-m.
float32 GetJointTranslation() const
Get the current joint translation, usually in meters.
b2Vec2 GetLocalPoint(const b2Vec2 &worldPoint) const
b2Vec2 GetLocalVector(const b2Vec2 &worldVector) const
T b2Clamp(T a, T low, T high)
void InitVelocityConstraints(const b2SolverData &data)
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
void EnableMotor(bool flag)
Enable/disable the joint motor.
float32 m_angularVelocity
b2Vec2 GetReactionForce(float32 inv_dt) const
Get the reaction force on bodyB at the joint anchor in Newtons.
bool IsMotorEnabled() const
Is the joint motor enabled?
float32 GetMotorTorque(float32 inv_dt) const
Get the current motor torque given the inverse time step, usually in N-m.
float32 GetReactionTorque(float32 inv_dt) const
Get the reaction torque on bodyB in N*m.
b2Body * bodyA
The first attached body.
b2Body * bodyB
The second attached body.
float32 dampingRatio
Suspension damping ratio, one indicates critical damping.