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

#include <b2_motor_joint.h>

Inheritance diagram for b2MotorJoint:
Inheritance graph
[legend]

Public Member Functions

void Dump () override
 Dump to b2Log. 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 GetAngularOffset () const
 
float GetCorrectionFactor () const
 Get the position correction factor in the range [0,1]. More...
 
const b2Vec2GetLinearOffset () const
 
float GetMaxForce () const
 Get the maximum friction force in N. More...
 
float GetMaxTorque () const
 Get the maximum friction torque in N*m. 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...
 
void SetAngularOffset (float angularOffset)
 Set/get the target angular offset, in radians. More...
 
void SetCorrectionFactor (float factor)
 Set the position correction factor in the range [0,1]. More...
 
void SetLinearOffset (const b2Vec2 &linearOffset)
 Set/get the target linear offset, in frame A, in meters. More...
 
void SetMaxForce (float force)
 Set the maximum friction force in N. More...
 
void SetMaxTorque (float torque)
 Set the maximum friction torque in N*m. More...
 
- Public Member Functions inherited from b2Joint
virtual void Draw (b2Draw *draw) const
 Debug draw this joint. More...
 
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

 b2MotorJoint (const b2MotorJointDef *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_angularError
 
float m_angularImpulse
 
float m_angularMass
 
float m_angularOffset
 
float m_correctionFactor
 
int32 m_indexA
 
int32 m_indexB
 
float m_invIA
 
float m_invIB
 
float m_invMassA
 
float m_invMassB
 
b2Vec2 m_linearError
 
b2Vec2 m_linearImpulse
 
b2Mat22 m_linearMass
 
b2Vec2 m_linearOffset
 
b2Vec2 m_localCenterA
 
b2Vec2 m_localCenterB
 
float m_maxForce
 
float m_maxTorque
 
b2Vec2 m_rA
 
b2Vec2 m_rB
 
- 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 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 motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.

Definition at line 64 of file b2_motor_joint.h.

Constructor & Destructor Documentation

◆ b2MotorJoint()

b2MotorJoint::b2MotorJoint ( const b2MotorJointDef def)
protected

Definition at line 54 of file b2_motor_joint.cpp.

Member Function Documentation

◆ Dump()

void b2MotorJoint::Dump ( )
overridevirtual

Dump to b2Log.

Reimplemented from b2Joint.

Definition at line 296 of file b2_motor_joint.cpp.

◆ GetAnchorA()

b2Vec2 b2MotorJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

Definition at line 213 of file b2_motor_joint.cpp.

◆ GetAnchorB()

b2Vec2 b2MotorJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

Definition at line 218 of file b2_motor_joint.cpp.

◆ GetAngularOffset()

float b2MotorJoint::GetAngularOffset ( ) const

Definition at line 291 of file b2_motor_joint.cpp.

◆ GetCorrectionFactor()

float b2MotorJoint::GetCorrectionFactor ( ) const

Get the position correction factor in the range [0,1].

Definition at line 261 of file b2_motor_joint.cpp.

◆ GetLinearOffset()

const b2Vec2 & b2MotorJoint::GetLinearOffset ( ) const

Definition at line 276 of file b2_motor_joint.cpp.

◆ GetMaxForce()

float b2MotorJoint::GetMaxForce ( ) const

Get the maximum friction force in N.

Definition at line 239 of file b2_motor_joint.cpp.

◆ GetMaxTorque()

float b2MotorJoint::GetMaxTorque ( ) const

Get the maximum friction torque in N*m.

Definition at line 250 of file b2_motor_joint.cpp.

◆ GetReactionForce()

b2Vec2 b2MotorJoint::GetReactionForce ( float  inv_dt) const
overridevirtual

Get the reaction force on bodyB at the joint anchor in Newtons.

Implements b2Joint.

Definition at line 223 of file b2_motor_joint.cpp.

◆ GetReactionTorque()

float b2MotorJoint::GetReactionTorque ( float  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements b2Joint.

Definition at line 228 of file b2_motor_joint.cpp.

◆ InitVelocityConstraints()

void b2MotorJoint::InitVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 68 of file b2_motor_joint.cpp.

◆ SetAngularOffset()

void b2MotorJoint::SetAngularOffset ( float  angularOffset)

Set/get the target angular offset, in radians.

Definition at line 281 of file b2_motor_joint.cpp.

◆ SetCorrectionFactor()

void b2MotorJoint::SetCorrectionFactor ( float  factor)

Set the position correction factor in the range [0,1].

Definition at line 255 of file b2_motor_joint.cpp.

◆ SetLinearOffset()

void b2MotorJoint::SetLinearOffset ( const b2Vec2 linearOffset)

Set/get the target linear offset, in frame A, in meters.

Definition at line 266 of file b2_motor_joint.cpp.

◆ SetMaxForce()

void b2MotorJoint::SetMaxForce ( float  force)

Set the maximum friction force in N.

Definition at line 233 of file b2_motor_joint.cpp.

◆ SetMaxTorque()

void b2MotorJoint::SetMaxTorque ( float  torque)

Set the maximum friction torque in N*m.

Definition at line 244 of file b2_motor_joint.cpp.

◆ SolvePositionConstraints()

bool b2MotorJoint::SolvePositionConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 206 of file b2_motor_joint.cpp.

◆ SolveVelocityConstraints()

void b2MotorJoint::SolveVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 148 of file b2_motor_joint.cpp.

Friends And Related Function Documentation

◆ b2Joint

friend class b2Joint
friend

Definition at line 104 of file b2_motor_joint.h.

Member Data Documentation

◆ m_angularError

float b2MotorJoint::m_angularError
protected

Definition at line 129 of file b2_motor_joint.h.

◆ m_angularImpulse

float b2MotorJoint::m_angularImpulse
protected

Definition at line 116 of file b2_motor_joint.h.

◆ m_angularMass

float b2MotorJoint::m_angularMass
protected

Definition at line 135 of file b2_motor_joint.h.

◆ m_angularOffset

float b2MotorJoint::m_angularOffset
protected

Definition at line 114 of file b2_motor_joint.h.

◆ m_correctionFactor

float b2MotorJoint::m_correctionFactor
protected

Definition at line 119 of file b2_motor_joint.h.

◆ m_indexA

int32 b2MotorJoint::m_indexA
protected

Definition at line 122 of file b2_motor_joint.h.

◆ m_indexB

int32 b2MotorJoint::m_indexB
protected

Definition at line 123 of file b2_motor_joint.h.

◆ m_invIA

float b2MotorJoint::m_invIA
protected

Definition at line 132 of file b2_motor_joint.h.

◆ m_invIB

float b2MotorJoint::m_invIB
protected

Definition at line 133 of file b2_motor_joint.h.

◆ m_invMassA

float b2MotorJoint::m_invMassA
protected

Definition at line 130 of file b2_motor_joint.h.

◆ m_invMassB

float b2MotorJoint::m_invMassB
protected

Definition at line 131 of file b2_motor_joint.h.

◆ m_linearError

b2Vec2 b2MotorJoint::m_linearError
protected

Definition at line 128 of file b2_motor_joint.h.

◆ m_linearImpulse

b2Vec2 b2MotorJoint::m_linearImpulse
protected

Definition at line 115 of file b2_motor_joint.h.

◆ m_linearMass

b2Mat22 b2MotorJoint::m_linearMass
protected

Definition at line 134 of file b2_motor_joint.h.

◆ m_linearOffset

b2Vec2 b2MotorJoint::m_linearOffset
protected

Definition at line 113 of file b2_motor_joint.h.

◆ m_localCenterA

b2Vec2 b2MotorJoint::m_localCenterA
protected

Definition at line 126 of file b2_motor_joint.h.

◆ m_localCenterB

b2Vec2 b2MotorJoint::m_localCenterB
protected

Definition at line 127 of file b2_motor_joint.h.

◆ m_maxForce

float b2MotorJoint::m_maxForce
protected

Definition at line 117 of file b2_motor_joint.h.

◆ m_maxTorque

float b2MotorJoint::m_maxTorque
protected

Definition at line 118 of file b2_motor_joint.h.

◆ m_rA

b2Vec2 b2MotorJoint::m_rA
protected

Definition at line 124 of file b2_motor_joint.h.

◆ m_rB

b2Vec2 b2MotorJoint::m_rB
protected

Definition at line 125 of file b2_motor_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