19 #ifndef B2_MOTOR_JOINT_H 20 #define B2_MOTOR_JOINT_H 22 #include <Box2D/Dynamics/Joints/b2Joint.h> 65 b2Vec2 GetReactionForce(float32 inv_dt)
const;
66 float32 GetReactionTorque(float32 inv_dt)
const;
70 const b2Vec2& GetLinearOffset()
const;
74 float32 GetAngularOffset()
const;
77 void SetMaxForce(float32 force);
80 float32 GetMaxForce()
const;
83 void SetMaxTorque(float32 torque);
86 float32 GetMaxTorque()
const;
89 void SetCorrectionFactor(float32 factor);
92 float32 GetCorrectionFactor()
const;
104 void SolveVelocityConstraints(
const b2SolverData& data);
105 bool SolvePositionConstraints(
const b2SolverData& data);
109 float32 m_angularOffset;
111 float32 m_angularImpulse;
114 float32 m_correctionFactor;
124 float32 m_angularError;
130 float32 m_angularMass;
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
Definition: b2MotorJoint.h:59
b2Body * bodyB
The second attached body.
Definition: b2Joint.h:95
float32 maxTorque
The maximum motor torque in N-m.
Definition: b2MotorJoint.h:50
Motor joint definition.
Definition: b2MotorJoint.h:25
Definition: b2Joint.h:103
void SetZero()
Set this vector to all zeros.
Definition: b2Math.h:62
float32 angularOffset
The bodyB angle minus bodyA angle in radians.
Definition: b2MotorJoint.h:44
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
Solver Data.
Definition: b2TimeStep.h:63
float32 maxForce
The maximum motor force in N.
Definition: b2MotorJoint.h:47
A 2-by-2 matrix. Stored in column-major order.
Definition: b2Math.h:183
float32 correctionFactor
Position correction factor in the range [0,1].
Definition: b2MotorJoint.h:53
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
A 2D column vector.
Definition: b2Math.h:53
b2Vec2 linearOffset
Position of bodyB minus the position of bodyA, in bodyA's frame, in meters.
Definition: b2MotorJoint.h:41
void Initialize(b2Body *bodyA, b2Body *bodyB)
Initialize the bodies and offsets using the current transforms.
Definition: b2MotorJoint.cpp:35