242 b2Log(
" b2FrictionJointDef jd;\n");
243 b2Log(
" jd.bodyA = bodies[%d];\n", indexA);
244 b2Log(
" jd.bodyB = bodies[%d];\n", indexB);
250 b2Log(
" joints[%d] = m_world->CreateJoint(&jd);\n",
m_index);
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
void b2Log(const char *string,...)
Logging function.
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
float32 GetMaxTorque() const
Get the maximum friction torque in N*m.
float32 maxForce
The maximum friction force in N.
float32 LengthSquared() const
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
void SetZero()
Set this vector to all zeros.
Friction joint definition.
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.
A rigid body. These are created via b2World::CreateBody.
bool b2IsValid(float32 x)
This function is used to ensure that a floating point number is not a NaN or infinity.
void SetMaxForce(float32 force)
Set the maximum friction force in N.
void InitVelocityConstraints(const b2SolverData &data)
float32 maxTorque
The maximum friction torque in N-m.
float32 GetReactionTorque(float32 inv_dt) const
Get the reaction torque on bodyB in N*m.
b2Vec2 GetLocalPoint(const b2Vec2 &worldPoint) const
float32 GetMaxForce() const
Get the maximum friction force in N.
void SetMaxTorque(float32 torque)
Set the maximum friction torque in N*m.
T b2Clamp(T a, T low, T high)
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
b2Vec2 GetAnchorA() const
Get the anchor point on bodyA in world coordinates.
void SolveVelocityConstraints(const b2SolverData &data)
A 2-by-2 matrix. Stored in column-major order.
b2Body * bodyA
The first attached body.
float32 Normalize()
Convert this vector into a unit vector. Returns the length.
b2Mat22 GetInverse() const
void Dump()
Dump joint to dmLog.
bool SolvePositionConstraints(const b2SolverData &data)
b2FrictionJoint(const b2FrictionJointDef *def)
b2Body * bodyB
The second attached body.
b2Vec2 GetAnchorB() const
Get the anchor point on bodyB in world coordinates.
b2Vec2 GetReactionForce(float32 inv_dt) const
Get the reaction force on bodyB at the joint anchor in Newtons.