Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
b2PrismaticJoint Class Reference

#include <b2_prismatic_joint.h>

Inheritance diagram for b2PrismaticJoint:
Inheritance graph
[legend]

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 b2Vec2GetLocalAnchorA () const
 The local anchor point relative to bodyA's origin. More...
 
const b2Vec2GetLocalAnchorB () const
 The local anchor point relative to bodyB's origin. More...
 
const b2Vec2GetLocalAxisA () 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...
 
- Public Member Functions inherited from b2Joint
b2BodyGetBodyA ()
 Get the first body attached to this joint. More...
 
b2BodyGetBodyB ()
 Get the second body attached to this joint. More...
 
bool GetCollideConnected () const
 
b2JointGetNext ()
 Get the next joint the world joint list. More...
 
const b2JointGetNext () const
 
b2JointType GetType () const
 Get the type of the concrete joint. More...
 
b2JointUserDataGetUserData ()
 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
 
- Protected Member Functions inherited from b2Joint
 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
 
- Protected Attributes inherited from b2Joint
b2Bodym_bodyA
 
b2Bodym_bodyB
 
bool m_collideConnected
 
b2JointEdge m_edgeA
 
b2JointEdge m_edgeB
 
int32 m_index
 
bool m_islandFlag
 
b2Jointm_next
 
b2Jointm_prev
 
b2JointType m_type
 
b2JointUserData m_userData
 

Friends

class b2GearJoint
 
class b2Joint
 

Additional Inherited Members

- Static Protected Member Functions inherited from b2Joint
static b2JointCreate (const b2JointDef *def, b2BlockAllocator *allocator)
 
static void Destroy (b2Joint *joint, b2BlockAllocator *allocator)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ b2PrismaticJoint()

b2PrismaticJoint::b2PrismaticJoint ( const b2PrismaticJointDef def)
protected

Definition at line 83 of file b2_prismatic_joint.cpp.

Member Function Documentation

◆ Draw()

void b2PrismaticJoint::Draw ( b2Draw draw) const
overridevirtual

Debug draw this joint.

Reimplemented from b2Joint.

Definition at line 610 of file b2_prismatic_joint.cpp.

◆ Dump()

void b2PrismaticJoint::Dump ( )
overridevirtual

Dump to b2Log.

Reimplemented from b2Joint.

Definition at line 586 of file b2_prismatic_joint.cpp.

◆ EnableLimit()

void b2PrismaticJoint::EnableLimit ( bool  flag)

Enable/disable the joint limit.

Definition at line 510 of file b2_prismatic_joint.cpp.

◆ EnableMotor()

void b2PrismaticJoint::EnableMotor ( bool  flag)

Enable/disable the joint motor.

Definition at line 551 of file b2_prismatic_joint.cpp.

◆ GetAnchorA()

b2Vec2 b2PrismaticJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

Definition at line 453 of file b2_prismatic_joint.cpp.

◆ GetAnchorB()

b2Vec2 b2PrismaticJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

Definition at line 458 of file b2_prismatic_joint.cpp.

◆ GetJointSpeed()

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.

◆ GetJointTranslation()

float b2PrismaticJoint::GetJointTranslation ( ) const

Get the current joint translation, usually in meters.

Definition at line 473 of file b2_prismatic_joint.cpp.

◆ GetLocalAnchorA()

const b2Vec2& b2PrismaticJoint::GetLocalAnchorA ( ) const
inline

The local anchor point relative to bodyA's origin.

Definition at line 101 of file b2_prismatic_joint.h.

◆ GetLocalAnchorB()

const b2Vec2& b2PrismaticJoint::GetLocalAnchorB ( ) const
inline

The local anchor point relative to bodyB's origin.

Definition at line 104 of file b2_prismatic_joint.h.

◆ GetLocalAxisA()

const b2Vec2& b2PrismaticJoint::GetLocalAxisA ( ) const
inline

The local joint axis relative to bodyA.

Definition at line 107 of file b2_prismatic_joint.h.

◆ GetLowerLimit()

float b2PrismaticJoint::GetLowerLimit ( ) const

Get the lower joint limit, usually in meters.

Definition at line 522 of file b2_prismatic_joint.cpp.

◆ GetMaxMotorForce()

float b2PrismaticJoint::GetMaxMotorForce ( ) const
inline

Definition at line 147 of file b2_prismatic_joint.h.

◆ GetMotorForce()

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.

◆ GetMotorSpeed()

float b2PrismaticJoint::GetMotorSpeed ( ) const
inline

Get the motor speed, usually in meters per second.

Definition at line 200 of file b2_prismatic_joint.h.

◆ GetReactionForce()

b2Vec2 b2PrismaticJoint::GetReactionForce ( float  inv_dt) const
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.

◆ GetReactionTorque()

float b2PrismaticJoint::GetReactionTorque ( float  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements b2Joint.

Definition at line 468 of file b2_prismatic_joint.cpp.

◆ GetReferenceAngle()

float b2PrismaticJoint::GetReferenceAngle ( ) const
inline

Get the reference angle.

Definition at line 110 of file b2_prismatic_joint.h.

◆ GetUpperLimit()

float b2PrismaticJoint::GetUpperLimit ( ) const

Get the upper joint limit, usually in meters.

Definition at line 527 of file b2_prismatic_joint.cpp.

◆ InitVelocityConstraints()

void b2PrismaticJoint::InitVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 114 of file b2_prismatic_joint.cpp.

◆ IsLimitEnabled()

bool b2PrismaticJoint::IsLimitEnabled ( ) const

Is the joint limit enabled?

Definition at line 505 of file b2_prismatic_joint.cpp.

◆ IsMotorEnabled()

bool b2PrismaticJoint::IsMotorEnabled ( ) const

Is the joint motor enabled?

Definition at line 546 of file b2_prismatic_joint.cpp.

◆ SetLimits()

void b2PrismaticJoint::SetLimits ( float  lower,
float  upper 
)

Set the joint limits, usually in meters.

Definition at line 532 of file b2_prismatic_joint.cpp.

◆ SetMaxMotorForce()

void b2PrismaticJoint::SetMaxMotorForce ( float  force)

Set the maximum motor force, usually in N.

Definition at line 571 of file b2_prismatic_joint.cpp.

◆ SetMotorSpeed()

void b2PrismaticJoint::SetMotorSpeed ( float  speed)

Set the motor speed, usually in meters per second.

Definition at line 561 of file b2_prismatic_joint.cpp.

◆ SolvePositionConstraints()

bool b2PrismaticJoint::SolvePositionConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 332 of file b2_prismatic_joint.cpp.

◆ SolveVelocityConstraints()

void b2PrismaticJoint::SolveVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 226 of file b2_prismatic_joint.cpp.

Friends And Related Function Documentation

◆ b2GearJoint

friend class b2GearJoint
friend

Definition at line 160 of file b2_prismatic_joint.h.

◆ b2Joint

friend class b2Joint
friend

Definition at line 159 of file b2_prismatic_joint.h.

Member Data Documentation

◆ m_a1

float b2PrismaticJoint::m_a1
protected

Definition at line 194 of file b2_prismatic_joint.h.

◆ m_a2

float b2PrismaticJoint::m_a2
protected

Definition at line 194 of file b2_prismatic_joint.h.

◆ m_axialMass

float b2PrismaticJoint::m_axialMass
protected

Definition at line 197 of file b2_prismatic_joint.h.

◆ m_axis

b2Vec2 b2PrismaticJoint::m_axis
protected

Definition at line 192 of file b2_prismatic_joint.h.

◆ m_enableLimit

bool b2PrismaticJoint::m_enableLimit
protected

Definition at line 180 of file b2_prismatic_joint.h.

◆ m_enableMotor

bool b2PrismaticJoint::m_enableMotor
protected

Definition at line 181 of file b2_prismatic_joint.h.

◆ m_impulse

b2Vec2 b2PrismaticJoint::m_impulse
protected

Definition at line 172 of file b2_prismatic_joint.h.

◆ m_indexA

int32 b2PrismaticJoint::m_indexA
protected

Definition at line 184 of file b2_prismatic_joint.h.

◆ m_indexB

int32 b2PrismaticJoint::m_indexB
protected

Definition at line 185 of file b2_prismatic_joint.h.

◆ m_invIA

float b2PrismaticJoint::m_invIA
protected

Definition at line 190 of file b2_prismatic_joint.h.

◆ m_invIB

float b2PrismaticJoint::m_invIB
protected

Definition at line 191 of file b2_prismatic_joint.h.

◆ m_invMassA

float b2PrismaticJoint::m_invMassA
protected

Definition at line 188 of file b2_prismatic_joint.h.

◆ m_invMassB

float b2PrismaticJoint::m_invMassB
protected

Definition at line 189 of file b2_prismatic_joint.h.

◆ m_K

b2Mat22 b2PrismaticJoint::m_K
protected

Definition at line 195 of file b2_prismatic_joint.h.

◆ m_localAnchorA

b2Vec2 b2PrismaticJoint::m_localAnchorA
protected

Definition at line 167 of file b2_prismatic_joint.h.

◆ m_localAnchorB

b2Vec2 b2PrismaticJoint::m_localAnchorB
protected

Definition at line 168 of file b2_prismatic_joint.h.

◆ m_localCenterA

b2Vec2 b2PrismaticJoint::m_localCenterA
protected

Definition at line 186 of file b2_prismatic_joint.h.

◆ m_localCenterB

b2Vec2 b2PrismaticJoint::m_localCenterB
protected

Definition at line 187 of file b2_prismatic_joint.h.

◆ m_localXAxisA

b2Vec2 b2PrismaticJoint::m_localXAxisA
protected

Definition at line 169 of file b2_prismatic_joint.h.

◆ m_localYAxisA

b2Vec2 b2PrismaticJoint::m_localYAxisA
protected

Definition at line 170 of file b2_prismatic_joint.h.

◆ m_lowerImpulse

float b2PrismaticJoint::m_lowerImpulse
protected

Definition at line 174 of file b2_prismatic_joint.h.

◆ m_lowerTranslation

float b2PrismaticJoint::m_lowerTranslation
protected

Definition at line 176 of file b2_prismatic_joint.h.

◆ m_maxMotorForce

float b2PrismaticJoint::m_maxMotorForce
protected

Definition at line 178 of file b2_prismatic_joint.h.

◆ m_motorImpulse

float b2PrismaticJoint::m_motorImpulse
protected

Definition at line 173 of file b2_prismatic_joint.h.

◆ m_motorSpeed

float b2PrismaticJoint::m_motorSpeed
protected

Definition at line 179 of file b2_prismatic_joint.h.

◆ m_perp

b2Vec2 b2PrismaticJoint::m_perp
protected

Definition at line 192 of file b2_prismatic_joint.h.

◆ m_referenceAngle

float b2PrismaticJoint::m_referenceAngle
protected

Definition at line 171 of file b2_prismatic_joint.h.

◆ m_s1

float b2PrismaticJoint::m_s1
protected

Definition at line 193 of file b2_prismatic_joint.h.

◆ m_s2

float b2PrismaticJoint::m_s2
protected

Definition at line 193 of file b2_prismatic_joint.h.

◆ m_translation

float b2PrismaticJoint::m_translation
protected

Definition at line 196 of file b2_prismatic_joint.h.

◆ m_upperImpulse

float b2PrismaticJoint::m_upperImpulse
protected

Definition at line 175 of file b2_prismatic_joint.h.

◆ m_upperTranslation

float b2PrismaticJoint::m_upperTranslation
protected

Definition at line 177 of file b2_prismatic_joint.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22