149 float Cdot = wB - wA;
246 b2Dump(
" b2FrictionJointDef jd;\n");
247 b2Dump(
" jd.bodyA = bodies[%d];\n", indexA);
248 b2Dump(
" jd.bodyB = bodies[%d];\n", indexB);
254 b2Dump(
" joints[%d] = m_world->CreateJoint(&jd);\n",
m_index);
float maxForce
The maximum friction force in N.
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
void Dump() override
Dump joint to dmLog.
float maxTorque
The maximum friction torque in N-m.
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
float GetMaxTorque() const
Get the maximum friction torque in N*m.
bool SolvePositionConstraints(const b2SolverData &data) override
void SolveVelocityConstraints(const b2SolverData &data) override
void SetZero()
Set this vector to all zeros.
Friction joint definition.
float GetReactionTorque(float inv_dt) const override
Get the reaction torque on bodyB in N*m.
b2Vec2 localCenter
local center of mass position
A rigid body. These are created via b2World::CreateBody.
b2Mat22 GetInverse() const
void SetMaxForce(float force)
Set the maximum friction force in N.
float LengthSquared() const
float b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
void SetMaxTorque(float torque)
Set the maximum friction torque in N*m.
bool b2IsValid(float x)
This function is used to ensure that a floating point number is not a NaN or infinity.
T b2Clamp(T a, T low, T high)
b2Vec2 GetReactionForce(float inv_dt) const override
Get the reaction force on bodyB at the joint anchor in Newtons.
b2Vec2 GetLocalPoint(const b2Vec2 &worldPoint) const
void b2Dump(const char *string,...)
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
float Normalize()
Convert this vector into a unit vector. Returns the length.
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
b2Vec2 GetAnchorB() const override
Get the anchor point on bodyB in world coordinates.
float GetMaxForce() const
Get the maximum friction force in N.
A 2-by-2 matrix. Stored in column-major order.
void InitVelocityConstraints(const b2SolverData &data) override
b2Body * bodyA
The first attached body.
b2Vec2 GetAnchorA() const override
Get the anchor point on bodyA in world coordinates.
b2FrictionJoint(const b2FrictionJointDef *def)
b2Body * bodyB
The second attached body.