148 m_impulse += impulse;
150 if (m_impulse.LengthSquared() > maxImpulse * maxImpulse)
152 m_impulse *= maxImpulse / m_impulse.Length();
154 impulse = m_impulse - oldImpulse;
186 return inv_dt * 0.0f;
const b2Transform & GetTransform() const
bool SolvePositionConstraints(const b2SolverData &data) override
float damping
The linear damping in N*s/m.
void SolveVelocityConstraints(const b2SolverData &data) override
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
float GetMaxForce() const
void ShiftOrigin(const b2Vec2 &newOrigin) override
Implement b2Joint::ShiftOrigin.
void InitVelocityConstraints(const b2SolverData &data) override
float stiffness
The linear stiffness in N/m.
void SetZero()
Set this vector to all zeros.
b2Vec2 localCenter
local center of mass position
b2Mat22 GetInverse() const
b2Vec2 GetAnchorB() const override
Implements b2Joint.
float b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
void SetMaxForce(float force)
Set/get the maximum force in Newtons.
const b2Vec2 & GetTarget() const
float GetReactionTorque(float inv_dt) const override
Implements b2Joint.
b2Vec2 GetReactionForce(float inv_dt) const override
Implements b2Joint.
b2Vec2 b2MulT(const b2Mat22 &A, const b2Vec2 &v)
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
A 2-by-2 matrix. Stored in column-major order.
b2MouseJoint(const b2MouseJointDef *def)
void SetTarget(const b2Vec2 &target)
Use this to update the target point.
b2Vec2 GetAnchorA() const override
Implements b2Joint.