#include <b2PrismaticJoint.h>
Public Member Functions | |
void | Dump () |
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 |
Get the anchor point on bodyA in world coordinates. More... | |
b2Vec2 | GetAnchorB () const |
Get the anchor point on bodyB in world coordinates. More... | |
float32 | GetJointSpeed () const |
Get the current joint translation speed, usually in meters per second. More... | |
float32 | 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... | |
float32 | GetLowerLimit () const |
Get the lower joint limit, usually in meters. More... | |
float32 | GetMaxMotorForce () const |
float32 | GetMotorForce (float32 inv_dt) const |
Get the current motor force given the inverse time step, usually in N. More... | |
float32 | GetMotorSpeed () const |
Get the motor speed, usually in meters per second. More... | |
b2Vec2 | GetReactionForce (float32 inv_dt) const |
Get the reaction force on bodyB at the joint anchor in Newtons. More... | |
float32 | GetReactionTorque (float32 inv_dt) const |
Get the reaction torque on bodyB in N*m. More... | |
float32 | GetReferenceAngle () const |
Get the reference angle. More... | |
float32 | 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 (float32 lower, float32 upper) |
Set the joint limits, usually in meters. More... | |
void | SetMaxMotorForce (float32 force) |
Set the maximum motor force, usually in N. More... | |
void | SetMotorSpeed (float32 speed) |
Set the motor speed, usually in meters per second. More... | |
Public Member Functions inherited from b2Joint | |
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... | |
void * | GetUserData () const |
Get the user data pointer. More... | |
bool | IsActive () const |
Short-cut function to determine if either body is inactive. More... | |
void | SetUserData (void *data) |
Set the user data pointer. 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) |
bool | SolvePositionConstraints (const b2SolverData &data) |
void | SolveVelocityConstraints (const b2SolverData &data) |
Protected Member Functions inherited from b2Joint | |
b2Joint (const b2JointDef *def) | |
virtual | ~b2Joint () |
Protected Attributes | |
float32 | m_a1 |
float32 | m_a2 |
b2Vec2 | m_axis |
bool | m_enableLimit |
bool | m_enableMotor |
b2Vec3 | m_impulse |
int32 | m_indexA |
int32 | m_indexB |
float32 | m_invIA |
float32 | m_invIB |
float32 | m_invMassA |
float32 | m_invMassB |
b2Mat33 | m_K |
b2LimitState | m_limitState |
b2Vec2 | m_localAnchorA |
b2Vec2 | m_localAnchorB |
b2Vec2 | m_localCenterA |
b2Vec2 | m_localCenterB |
b2Vec2 | m_localXAxisA |
b2Vec2 | m_localYAxisA |
float32 | m_lowerTranslation |
float32 | m_maxMotorForce |
float32 | m_motorImpulse |
float32 | m_motorMass |
float32 | m_motorSpeed |
b2Vec2 | m_perp |
float32 | m_referenceAngle |
float32 | m_s1 |
float32 | m_s2 |
float32 | m_upperTranslation |
Protected Attributes inherited from b2Joint | |
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 |
void * | m_userData |
Friends | |
class | b2GearJoint |
class | b2Joint |
Additional Inherited Members | |
Static Protected Member Functions inherited from b2Joint | |
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 86 of file b2PrismaticJoint.h.
|
protected |
Definition at line 100 of file b2PrismaticJoint.cpp.
|
virtual |
void b2PrismaticJoint::EnableLimit | ( | bool | flag | ) |
Enable/disable the joint limit.
Definition at line 544 of file b2PrismaticJoint.cpp.
void b2PrismaticJoint::EnableMotor | ( | bool | flag | ) |
Enable/disable the joint motor.
Definition at line 583 of file b2PrismaticJoint.cpp.
|
virtual |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 487 of file b2PrismaticJoint.cpp.
|
virtual |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 492 of file b2PrismaticJoint.cpp.
float32 b2PrismaticJoint::GetJointSpeed | ( | ) | const |
Get the current joint translation speed, usually in meters per second.
Definition at line 518 of file b2PrismaticJoint.cpp.
float32 b2PrismaticJoint::GetJointTranslation | ( | ) | const |
Get the current joint translation, usually in meters.
Definition at line 507 of file b2PrismaticJoint.cpp.
|
inline |
The local anchor point relative to bodyA's origin.
Definition at line 96 of file b2PrismaticJoint.h.
|
inline |
The local anchor point relative to bodyB's origin.
Definition at line 99 of file b2PrismaticJoint.h.
|
inline |
The local joint axis relative to bodyA.
Definition at line 102 of file b2PrismaticJoint.h.
float32 b2PrismaticJoint::GetLowerLimit | ( | ) | const |
Get the lower joint limit, usually in meters.
Definition at line 555 of file b2PrismaticJoint.cpp.
|
inline |
Definition at line 142 of file b2PrismaticJoint.h.
Get the current motor force given the inverse time step, usually in N.
Definition at line 604 of file b2PrismaticJoint.cpp.
|
inline |
Get the motor speed, usually in meters per second.
Definition at line 191 of file b2PrismaticJoint.h.
Get the reaction force on bodyB at the joint anchor in Newtons.
Implements b2Joint.
Definition at line 497 of file b2PrismaticJoint.cpp.
Get the reaction torque on bodyB in N*m.
Implements b2Joint.
Definition at line 502 of file b2PrismaticJoint.cpp.
|
inline |
Get the reference angle.
Definition at line 105 of file b2PrismaticJoint.h.
float32 b2PrismaticJoint::GetUpperLimit | ( | ) | const |
Get the upper joint limit, usually in meters.
Definition at line 560 of file b2PrismaticJoint.cpp.
|
protectedvirtual |
Implements b2Joint.
Definition at line 126 of file b2PrismaticJoint.cpp.
bool b2PrismaticJoint::IsLimitEnabled | ( | ) | const |
Is the joint limit enabled?
Definition at line 539 of file b2PrismaticJoint.cpp.
bool b2PrismaticJoint::IsMotorEnabled | ( | ) | const |
Is the joint motor enabled?
Definition at line 578 of file b2PrismaticJoint.cpp.
Set the joint limits, usually in meters.
Definition at line 565 of file b2PrismaticJoint.cpp.
void b2PrismaticJoint::SetMaxMotorForce | ( | float32 | force | ) |
Set the maximum motor force, usually in N.
Definition at line 597 of file b2PrismaticJoint.cpp.
void b2PrismaticJoint::SetMotorSpeed | ( | float32 | speed | ) |
Set the motor speed, usually in meters per second.
Definition at line 590 of file b2PrismaticJoint.cpp.
|
protectedvirtual |
Implements b2Joint.
Definition at line 363 of file b2PrismaticJoint.cpp.
|
protectedvirtual |
Implements b2Joint.
Definition at line 266 of file b2PrismaticJoint.cpp.
|
friend |
Definition at line 152 of file b2PrismaticJoint.h.
|
friend |
Definition at line 151 of file b2PrismaticJoint.h.
|
protected |
Definition at line 186 of file b2PrismaticJoint.h.
|
protected |
Definition at line 186 of file b2PrismaticJoint.h.
|
protected |
Definition at line 184 of file b2PrismaticJoint.h.
|
protected |
Definition at line 171 of file b2PrismaticJoint.h.
|
protected |
Definition at line 172 of file b2PrismaticJoint.h.
|
protected |
Definition at line 165 of file b2PrismaticJoint.h.
|
protected |
Definition at line 176 of file b2PrismaticJoint.h.
|
protected |
Definition at line 177 of file b2PrismaticJoint.h.
|
protected |
Definition at line 182 of file b2PrismaticJoint.h.
|
protected |
Definition at line 183 of file b2PrismaticJoint.h.
|
protected |
Definition at line 180 of file b2PrismaticJoint.h.
|
protected |
Definition at line 181 of file b2PrismaticJoint.h.
|
protected |
Definition at line 187 of file b2PrismaticJoint.h.
|
protected |
Definition at line 173 of file b2PrismaticJoint.h.
|
protected |
Definition at line 160 of file b2PrismaticJoint.h.
|
protected |
Definition at line 161 of file b2PrismaticJoint.h.
|
protected |
Definition at line 178 of file b2PrismaticJoint.h.
|
protected |
Definition at line 179 of file b2PrismaticJoint.h.
|
protected |
Definition at line 162 of file b2PrismaticJoint.h.
|
protected |
Definition at line 163 of file b2PrismaticJoint.h.
|
protected |
Definition at line 167 of file b2PrismaticJoint.h.
|
protected |
Definition at line 169 of file b2PrismaticJoint.h.
|
protected |
Definition at line 166 of file b2PrismaticJoint.h.
|
protected |
Definition at line 188 of file b2PrismaticJoint.h.
|
protected |
Definition at line 170 of file b2PrismaticJoint.h.
|
protected |
Definition at line 184 of file b2PrismaticJoint.h.
|
protected |
Definition at line 164 of file b2PrismaticJoint.h.
|
protected |
Definition at line 185 of file b2PrismaticJoint.h.
|
protected |
Definition at line 185 of file b2PrismaticJoint.h.
|
protected |
Definition at line 168 of file b2PrismaticJoint.h.