 |
Box2D
2.3.0
A 2D Physics Engine for Games
|
19 #ifndef B2_REVOLUTE_JOINT_H
20 #define B2_REVOLUTE_JOINT_H
22 #include <Box2D/Dynamics/Joints/b2Joint.h>
39 type = e_revoluteJoint;
124 void SetLimits(float32 lower, float32 upper);
140 float32 GetMaxMotorTorque()
const {
return m_maxMotorTorque; }
165 void SolveVelocityConstraints(
const b2SolverData& data);
166 bool SolvePositionConstraints(
const b2SolverData& data);
172 float32 m_motorImpulse;
175 float32 m_maxMotorTorque;
176 float32 m_motorSpeed;
179 float32 m_referenceAngle;
180 float32 m_lowerAngle;
181 float32 m_upperAngle;
196 b2LimitState m_limitState;
A 2D column vector.
Definition: b2Math.h:54
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:127
float32 GetReactionTorque(float32 inv_dt) const
Definition: b2RevoluteJoint.cpp:393
float32 GetLowerLimit() const
Get the lower joint limit in radians.
Definition: b2RevoluteJoint.cpp:459
void SetLimits(float32 lower, float32 upper)
Set the joint limits in radians.
Definition: b2RevoluteJoint.cpp:469
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:65
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2RevoluteJoint.h:59
void SetMaxMotorTorque(float32 torque)
Set the maximum motor torque, usually in N-m.
Definition: b2RevoluteJoint.cpp:436
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2RevoluteJoint.h:56
bool enableMotor
A flag to enable the joint motor.
Definition: b2RevoluteJoint.h:74
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
Definition: b2RevoluteJoint.cpp:36
b2Vec2 GetAnchorB() const
Get the anchor point on bodyB in world coordinates.
Definition: b2RevoluteJoint.cpp:382
void EnableMotor(bool flag)
Enable/disable the joint motor.
Definition: b2RevoluteJoint.cpp:417
float32 GetReferenceAngle() const
Get the reference angle.
Definition: b2RevoluteJoint.h:103
Joint definitions are used to construct joints.
Definition: b2Joint.h:75
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
A 2D column vector with 3 elements.
Definition: b2Math.h:145
float32 referenceAngle
The bodyB angle minus bodyA angle in the reference state (radians).
Definition: b2RevoluteJoint.h:62
bool IsLimitEnabled() const
Is the joint limit enabled?
Definition: b2RevoluteJoint.cpp:443
A 3-by-3 matrix. Stored in column-major order.
Definition: b2Math.h:258
bool enableLimit
A flag to enable joint limits.
Definition: b2RevoluteJoint.h:65
float32 upperAngle
The upper angle for the joint limit (radians).
Definition: b2RevoluteJoint.h:71
float32 GetMotorSpeed() const
Get the motor speed in radians per second.
Definition: b2RevoluteJoint.h:199
float32 motorSpeed
The desired motor speed. Usually in radians per second.
Definition: b2RevoluteJoint.h:77
float32 GetUpperLimit() const
Get the upper joint limit in radians.
Definition: b2RevoluteJoint.cpp:464
b2Vec2 GetAnchorA() const
Get the anchor point on bodyA in world coordinates.
Definition: b2RevoluteJoint.cpp:377
bool IsMotorEnabled() const
Is the joint motor enabled?
Definition: b2RevoluteJoint.cpp:412
b2Body * bodyB
The second attached body.
Definition: b2Joint.h:95
Definition: b2RevoluteJoint.h:36
void SetMotorSpeed(float32 speed)
Set the motor speed in radians per second.
Definition: b2RevoluteJoint.cpp:429
Definition: b2RevoluteJoint.h:91
void Dump()
Dump to b2Log.
Definition: b2RevoluteJoint.cpp:483
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
Definition: b2RevoluteJoint.h:97
float32 GetMotorTorque(float32 inv_dt) const
Definition: b2RevoluteJoint.cpp:424
float32 lowerAngle
The lower angle for the joint limit (radians).
Definition: b2RevoluteJoint.h:68
float32 GetJointSpeed() const
Get the current joint angle speed in radians per second.
Definition: b2RevoluteJoint.cpp:405
Definition: b2GearJoint.h:57
Solver Data.
Definition: b2TimeStep.h:64
float32 maxMotorTorque
Definition: b2RevoluteJoint.h:81
void EnableLimit(bool flag)
Enable/disable the joint limit.
Definition: b2RevoluteJoint.cpp:448
b2Vec2 GetReactionForce(float32 inv_dt) const
Definition: b2RevoluteJoint.cpp:387
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
Definition: b2Joint.h:104
float32 GetJointAngle() const
Get the current joint angle in radians.
Definition: b2RevoluteJoint.cpp:398
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
Definition: b2RevoluteJoint.h:100