19 #ifndef B2_PRISMATIC_JOINT_H 20 #define B2_PRISMATIC_JOINT_H 22 #include <Box2D/Dynamics/Joints/b2Joint.h> 34 type = e_prismaticJoint;
92 b2Vec2 GetReactionForce(float32 inv_dt)
const;
93 float32 GetReactionTorque(float32 inv_dt)
const;
108 float32 GetJointTranslation()
const;
111 float32 GetJointSpeed()
const;
114 bool IsLimitEnabled()
const;
117 void EnableLimit(
bool flag);
120 float32 GetLowerLimit()
const;
123 float32 GetUpperLimit()
const;
126 void SetLimits(float32 lower, float32 upper);
129 bool IsMotorEnabled()
const;
132 void EnableMotor(
bool flag);
135 void SetMotorSpeed(float32 speed);
138 float32 GetMotorSpeed()
const;
141 void SetMaxMotorForce(float32 force);
142 float32 GetMaxMotorForce()
const {
return m_maxMotorForce; }
145 float32 GetMotorForce(float32 inv_dt)
const;
156 void SolveVelocityConstraints(
const b2SolverData& data);
157 bool SolvePositionConstraints(
const b2SolverData& data);
164 float32 m_referenceAngle;
166 float32 m_motorImpulse;
167 float32 m_lowerTranslation;
168 float32 m_upperTranslation;
169 float32 m_maxMotorForce;
170 float32 m_motorSpeed;
173 b2LimitState m_limitState;
const b2Vec2 & GetLocalAnchorB() const
The local anchor point relative to bodyB's origin.
Definition: b2PrismaticJoint.h:99
const b2Vec2 & GetLocalAnchorA() const
The local anchor point relative to bodyA's origin.
Definition: b2PrismaticJoint.h:96
A 2D column vector with 3 elements.
Definition: b2Math.h:144
bool enableMotor
Enable/disable the joint motor.
Definition: b2PrismaticJoint.h:73
bool enableLimit
Enable/disable the joint limit.
Definition: b2PrismaticJoint.h:64
b2Body * bodyA
The first attached body.
Definition: b2Joint.h:92
A 3-by-3 matrix. Stored in column-major order.
Definition: b2Math.h:257
float32 lowerTranslation
The lower translation limit, usually in meters.
Definition: b2PrismaticJoint.h:67
float32 upperTranslation
The upper translation limit, usually in meters.
Definition: b2PrismaticJoint.h:70
Definition: b2PrismaticJoint.h:30
b2Body * bodyB
The second attached body.
Definition: b2Joint.h:95
Definition: b2Joint.h:103
b2Vec2 localAxisA
The local translation unit axis in bodyA.
Definition: b2PrismaticJoint.h:58
Definition: b2PrismaticJoint.h:86
const b2Vec2 & GetLocalAxisA() const
The local joint axis relative to bodyA.
Definition: b2PrismaticJoint.h:102
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:65
float32 motorSpeed
The desired motor speed in radians per second.
Definition: b2PrismaticJoint.h:79
void SetZero()
Set this vector to all zeros.
Definition: b2Math.h:62
float32 maxMotorForce
The maximum motor torque, usually in N-m.
Definition: b2PrismaticJoint.h:76
Definition: b2GearJoint.h:56
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
Solver Data.
Definition: b2TimeStep.h:63
b2Vec2 localAnchorA
The local anchor point relative to bodyA's origin.
Definition: b2PrismaticJoint.h:52
b2Vec2 localAnchorB
The local anchor point relative to bodyB's origin.
Definition: b2PrismaticJoint.h:55
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
A rigid body. These are created via b2World::CreateBody.
Definition: b2Body.h:126
float32 referenceAngle
The constrained angle between the bodies: bodyB_angle - bodyA_angle.
Definition: b2PrismaticJoint.h:61
float32 GetReferenceAngle() const
Get the reference angle.
Definition: b2PrismaticJoint.h:105
A 2D column vector.
Definition: b2Math.h:53
void Initialize(b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
Definition: b2PrismaticJoint.cpp:90
float32 GetMotorSpeed() const
Get the motor speed, usually in meters per second.
Definition: b2PrismaticJoint.h:191