#include <b2_prismatic_joint.h>
Public Member Functions | |
void | Draw (b2Draw *draw) const override |
Debug draw this joint. More... | |
void | Dump () override |
Dump to b2Log. More... | |
void | EnableLimit (bool flag) |
Enable/disable the joint limit. More... | |
void | EnableMotor (bool flag) |
Enable/disable the joint motor. More... | |
b2Vec2 | GetAnchorA () const override |
Get the anchor point on bodyA in world coordinates. More... | |
b2Vec2 | GetAnchorB () const override |
Get the anchor point on bodyB in world coordinates. More... | |
float | GetJointSpeed () const |
Get the current joint translation speed, usually in meters per second. More... | |
float | GetJointTranslation () const |
Get the current joint translation, usually in meters. More... | |
const b2Vec2 & | GetLocalAnchorA () const |
The local anchor point relative to bodyA's origin. More... | |
const b2Vec2 & | GetLocalAnchorB () const |
The local anchor point relative to bodyB's origin. More... | |
const b2Vec2 & | GetLocalAxisA () const |
The local joint axis relative to bodyA. More... | |
float | GetLowerLimit () const |
Get the lower joint limit, usually in meters. More... | |
float | GetMaxMotorForce () const |
float | GetMotorForce (float inv_dt) const |
Get the current motor force given the inverse time step, usually in N. More... | |
float | GetMotorSpeed () const |
Get the motor speed, usually in meters per second. More... | |
b2Vec2 | GetReactionForce (float inv_dt) const override |
Get the reaction force on bodyB at the joint anchor in Newtons. More... | |
float | GetReactionTorque (float inv_dt) const override |
Get the reaction torque on bodyB in N*m. More... | |
float | GetReferenceAngle () const |
Get the reference angle. More... | |
float | GetUpperLimit () const |
Get the upper joint limit, usually in meters. More... | |
bool | IsLimitEnabled () const |
Is the joint limit enabled? More... | |
bool | IsMotorEnabled () const |
Is the joint motor enabled? More... | |
void | SetLimits (float lower, float upper) |
Set the joint limits, usually in meters. More... | |
void | SetMaxMotorForce (float force) |
Set the maximum motor force, usually in N. More... | |
void | SetMotorSpeed (float speed) |
Set the motor speed, usually in meters per second. More... | |
![]() | |
b2Body * | GetBodyA () |
Get the first body attached to this joint. More... | |
b2Body * | GetBodyB () |
Get the second body attached to this joint. More... | |
bool | GetCollideConnected () const |
b2Joint * | GetNext () |
Get the next joint the world joint list. More... | |
const b2Joint * | GetNext () const |
b2JointType | GetType () const |
Get the type of the concrete joint. More... | |
b2JointUserData & | GetUserData () |
Get the user data pointer. More... | |
bool | IsEnabled () const |
Short-cut function to determine if either body is enabled. More... | |
virtual void | ShiftOrigin (const b2Vec2 &newOrigin) |
Shift the origin for any points stored in world coordinates. More... | |
Protected Member Functions | |
b2PrismaticJoint (const b2PrismaticJointDef *def) | |
void | InitVelocityConstraints (const b2SolverData &data) override |
bool | SolvePositionConstraints (const b2SolverData &data) override |
void | SolveVelocityConstraints (const b2SolverData &data) override |
![]() | |
b2Joint (const b2JointDef *def) | |
virtual | ~b2Joint () |
Protected Attributes | |
float | m_a1 |
float | m_a2 |
float | m_axialMass |
b2Vec2 | m_axis |
bool | m_enableLimit |
bool | m_enableMotor |
b2Vec2 | m_impulse |
int32 | m_indexA |
int32 | m_indexB |
float | m_invIA |
float | m_invIB |
float | m_invMassA |
float | m_invMassB |
b2Mat22 | m_K |
b2Vec2 | m_localAnchorA |
b2Vec2 | m_localAnchorB |
b2Vec2 | m_localCenterA |
b2Vec2 | m_localCenterB |
b2Vec2 | m_localXAxisA |
b2Vec2 | m_localYAxisA |
float | m_lowerImpulse |
float | m_lowerTranslation |
float | m_maxMotorForce |
float | m_motorImpulse |
float | m_motorSpeed |
b2Vec2 | m_perp |
float | m_referenceAngle |
float | m_s1 |
float | m_s2 |
float | m_translation |
float | m_upperImpulse |
float | m_upperTranslation |
![]() | |
b2Body * | m_bodyA |
b2Body * | m_bodyB |
bool | m_collideConnected |
b2JointEdge | m_edgeA |
b2JointEdge | m_edgeB |
int32 | m_index |
bool | m_islandFlag |
b2Joint * | m_next |
b2Joint * | m_prev |
b2JointType | m_type |
b2JointUserData | m_userData |
Friends | |
class | b2GearJoint |
class | b2Joint |
Additional Inherited Members | |
![]() | |
static b2Joint * | Create (const b2JointDef *def, b2BlockAllocator *allocator) |
static void | Destroy (b2Joint *joint, b2BlockAllocator *allocator) |
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Definition at line 91 of file b2_prismatic_joint.h.
|
protected |
Definition at line 83 of file b2_prismatic_joint.cpp.
Debug draw this joint.
Reimplemented from b2Joint.
Definition at line 610 of file b2_prismatic_joint.cpp.
|
overridevirtual |
void b2PrismaticJoint::EnableLimit | ( | bool | flag | ) |
Enable/disable the joint limit.
Definition at line 510 of file b2_prismatic_joint.cpp.
void b2PrismaticJoint::EnableMotor | ( | bool | flag | ) |
Enable/disable the joint motor.
Definition at line 551 of file b2_prismatic_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 453 of file b2_prismatic_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 458 of file b2_prismatic_joint.cpp.
float b2PrismaticJoint::GetJointSpeed | ( | ) | const |
Get the current joint translation speed, usually in meters per second.
Definition at line 484 of file b2_prismatic_joint.cpp.
float b2PrismaticJoint::GetJointTranslation | ( | ) | const |
Get the current joint translation, usually in meters.
Definition at line 473 of file b2_prismatic_joint.cpp.
|
inline |
The local anchor point relative to bodyA's origin.
Definition at line 101 of file b2_prismatic_joint.h.
|
inline |
The local anchor point relative to bodyB's origin.
Definition at line 104 of file b2_prismatic_joint.h.
|
inline |
The local joint axis relative to bodyA.
Definition at line 107 of file b2_prismatic_joint.h.
float b2PrismaticJoint::GetLowerLimit | ( | ) | const |
Get the lower joint limit, usually in meters.
Definition at line 522 of file b2_prismatic_joint.cpp.
|
inline |
Definition at line 147 of file b2_prismatic_joint.h.
float b2PrismaticJoint::GetMotorForce | ( | float | inv_dt | ) | const |
Get the current motor force given the inverse time step, usually in N.
Definition at line 581 of file b2_prismatic_joint.cpp.
|
inline |
Get the motor speed, usually in meters per second.
Definition at line 200 of file b2_prismatic_joint.h.
|
overridevirtual |
Get the reaction force on bodyB at the joint anchor in Newtons.
Implements b2Joint.
Definition at line 463 of file b2_prismatic_joint.cpp.
|
overridevirtual |
Get the reaction torque on bodyB in N*m.
Implements b2Joint.
Definition at line 468 of file b2_prismatic_joint.cpp.
|
inline |
Get the reference angle.
Definition at line 110 of file b2_prismatic_joint.h.
float b2PrismaticJoint::GetUpperLimit | ( | ) | const |
Get the upper joint limit, usually in meters.
Definition at line 527 of file b2_prismatic_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 114 of file b2_prismatic_joint.cpp.
bool b2PrismaticJoint::IsLimitEnabled | ( | ) | const |
Is the joint limit enabled?
Definition at line 505 of file b2_prismatic_joint.cpp.
bool b2PrismaticJoint::IsMotorEnabled | ( | ) | const |
Is the joint motor enabled?
Definition at line 546 of file b2_prismatic_joint.cpp.
void b2PrismaticJoint::SetLimits | ( | float | lower, |
float | upper | ||
) |
Set the joint limits, usually in meters.
Definition at line 532 of file b2_prismatic_joint.cpp.
void b2PrismaticJoint::SetMaxMotorForce | ( | float | force | ) |
Set the maximum motor force, usually in N.
Definition at line 571 of file b2_prismatic_joint.cpp.
void b2PrismaticJoint::SetMotorSpeed | ( | float | speed | ) |
Set the motor speed, usually in meters per second.
Definition at line 561 of file b2_prismatic_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 332 of file b2_prismatic_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 226 of file b2_prismatic_joint.cpp.
|
friend |
Definition at line 160 of file b2_prismatic_joint.h.
|
friend |
Definition at line 159 of file b2_prismatic_joint.h.
|
protected |
Definition at line 194 of file b2_prismatic_joint.h.
|
protected |
Definition at line 194 of file b2_prismatic_joint.h.
|
protected |
Definition at line 197 of file b2_prismatic_joint.h.
|
protected |
Definition at line 192 of file b2_prismatic_joint.h.
|
protected |
Definition at line 180 of file b2_prismatic_joint.h.
|
protected |
Definition at line 181 of file b2_prismatic_joint.h.
|
protected |
Definition at line 172 of file b2_prismatic_joint.h.
|
protected |
Definition at line 184 of file b2_prismatic_joint.h.
|
protected |
Definition at line 185 of file b2_prismatic_joint.h.
|
protected |
Definition at line 190 of file b2_prismatic_joint.h.
|
protected |
Definition at line 191 of file b2_prismatic_joint.h.
|
protected |
Definition at line 188 of file b2_prismatic_joint.h.
|
protected |
Definition at line 189 of file b2_prismatic_joint.h.
|
protected |
Definition at line 195 of file b2_prismatic_joint.h.
|
protected |
Definition at line 167 of file b2_prismatic_joint.h.
|
protected |
Definition at line 168 of file b2_prismatic_joint.h.
|
protected |
Definition at line 186 of file b2_prismatic_joint.h.
|
protected |
Definition at line 187 of file b2_prismatic_joint.h.
|
protected |
Definition at line 169 of file b2_prismatic_joint.h.
|
protected |
Definition at line 170 of file b2_prismatic_joint.h.
|
protected |
Definition at line 174 of file b2_prismatic_joint.h.
|
protected |
Definition at line 176 of file b2_prismatic_joint.h.
|
protected |
Definition at line 178 of file b2_prismatic_joint.h.
|
protected |
Definition at line 173 of file b2_prismatic_joint.h.
|
protected |
Definition at line 179 of file b2_prismatic_joint.h.
|
protected |
Definition at line 192 of file b2_prismatic_joint.h.
|
protected |
Definition at line 171 of file b2_prismatic_joint.h.
|
protected |
Definition at line 193 of file b2_prismatic_joint.h.
|
protected |
Definition at line 193 of file b2_prismatic_joint.h.
|
protected |
Definition at line 196 of file b2_prismatic_joint.h.
|
protected |
Definition at line 175 of file b2_prismatic_joint.h.
|
protected |
Definition at line 177 of file b2_prismatic_joint.h.