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

#include <b2WheelJoint.h>

Inheritance diagram for b2WheelJoint:
Inheritance graph
[legend]

Public Member Functions

void Dump ()
 Dump to b2Log. 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 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...
 
float32 GetMaxMotorTorque () const
 
float32 GetMotorSpeed () const
 Get the motor speed, usually in radians per second. More...
 
float32 GetMotorTorque (float32 inv_dt) const
 Get the current motor torque given the inverse time step, usually in N-m. 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 GetSpringDampingRatio () const
 
float32 GetSpringFrequencyHz () const
 
bool IsMotorEnabled () const
 Is the joint motor enabled? More...
 
void SetMaxMotorTorque (float32 torque)
 Set/Get the maximum motor force, usually in N-m. More...
 
void SetMotorSpeed (float32 speed)
 Set the motor speed, usually in radians per second. More...
 
void SetSpringDampingRatio (float32 ratio)
 Set/Get the spring damping ratio. More...
 
void SetSpringFrequencyHz (float32 hz)
 Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. 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...
 
voidGetUserData () 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

 b2WheelJoint (const b2WheelJointDef *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

b2Vec2 m_ax
 
b2Vec2 m_ay
 
float32 m_bias
 
float32 m_dampingRatio
 
bool m_enableMotor
 
float32 m_frequencyHz
 
float32 m_gamma
 
float32 m_impulse
 
int32 m_indexA
 
int32 m_indexB
 
float32 m_invIA
 
float32 m_invIB
 
float32 m_invMassA
 
float32 m_invMassB
 
b2Vec2 m_localAnchorA
 
b2Vec2 m_localAnchorB
 
b2Vec2 m_localCenterA
 
b2Vec2 m_localCenterB
 
b2Vec2 m_localXAxisA
 
b2Vec2 m_localYAxisA
 
float32 m_mass
 
float32 m_maxMotorTorque
 
float32 m_motorImpulse
 
float32 m_motorMass
 
float32 m_motorSpeed
 
float32 m_sAx
 
float32 m_sAy
 
float32 m_sBx
 
float32 m_sBy
 
float32 m_springImpulse
 
float32 m_springMass
 
- 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
 
voidm_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 wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. In other words, it is a point to line constraint with a rotational motor and a linear spring/damper. This joint is designed for vehicle suspensions.

Definition at line 78 of file b2WheelJoint.h.

Constructor & Destructor Documentation

b2WheelJoint::b2WheelJoint ( const b2WheelJointDef def)
protected

Definition at line 48 of file b2WheelJoint.cpp.

Member Function Documentation

void b2WheelJoint::Dump ( )
virtual

Dump to b2Log.

Reimplemented from b2Joint.

Definition at line 401 of file b2WheelJoint.cpp.

void b2WheelJoint::EnableMotor ( bool  flag)

Enable/disable the joint motor.

Definition at line 375 of file b2WheelJoint.cpp.

b2Vec2 b2WheelJoint::GetAnchorA ( ) const
virtual

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

Definition at line 329 of file b2WheelJoint.cpp.

b2Vec2 b2WheelJoint::GetAnchorB ( ) const
virtual

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

Definition at line 334 of file b2WheelJoint.cpp.

float32 b2WheelJoint::GetJointSpeed ( ) const

Get the current joint translation speed, usually in meters per second.

Definition at line 363 of file b2WheelJoint.cpp.

float32 b2WheelJoint::GetJointTranslation ( ) const

Get the current joint translation, usually in meters.

Definition at line 349 of file b2WheelJoint.cpp.

const b2Vec2& b2WheelJoint::GetLocalAnchorA ( ) const
inline

The local anchor point relative to bodyA's origin.

Definition at line 88 of file b2WheelJoint.h.

const b2Vec2& b2WheelJoint::GetLocalAnchorB ( ) const
inline

The local anchor point relative to bodyB's origin.

Definition at line 91 of file b2WheelJoint.h.

const b2Vec2& b2WheelJoint::GetLocalAxisA ( ) const
inline

The local joint axis relative to bodyA.

Definition at line 94 of file b2WheelJoint.h.

float32 b2WheelJoint::GetMaxMotorTorque ( ) const
inline

Definition at line 185 of file b2WheelJoint.h.

float32 b2WheelJoint::GetMotorSpeed ( ) const
inline

Get the motor speed, usually in radians per second.

Definition at line 180 of file b2WheelJoint.h.

float32 b2WheelJoint::GetMotorTorque ( float32  inv_dt) const

Get the current motor torque given the inverse time step, usually in N-m.

Definition at line 396 of file b2WheelJoint.cpp.

b2Vec2 b2WheelJoint::GetReactionForce ( float32  inv_dt) const
virtual

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

Implements b2Joint.

Definition at line 339 of file b2WheelJoint.cpp.

float32 b2WheelJoint::GetReactionTorque ( float32  inv_dt) const
virtual

Get the reaction torque on bodyB in N*m.

Implements b2Joint.

Definition at line 344 of file b2WheelJoint.cpp.

float32 b2WheelJoint::GetSpringDampingRatio ( ) const
inline

Definition at line 205 of file b2WheelJoint.h.

float32 b2WheelJoint::GetSpringFrequencyHz ( ) const
inline

Definition at line 195 of file b2WheelJoint.h.

void b2WheelJoint::InitVelocityConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 77 of file b2WheelJoint.cpp.

bool b2WheelJoint::IsMotorEnabled ( ) const

Is the joint motor enabled?

Definition at line 370 of file b2WheelJoint.cpp.

void b2WheelJoint::SetMaxMotorTorque ( float32  torque)

Set/Get the maximum motor force, usually in N-m.

Definition at line 389 of file b2WheelJoint.cpp.

void b2WheelJoint::SetMotorSpeed ( float32  speed)

Set the motor speed, usually in radians per second.

Definition at line 382 of file b2WheelJoint.cpp.

void b2WheelJoint::SetSpringDampingRatio ( float32  ratio)
inline

Set/Get the spring damping ratio.

Definition at line 200 of file b2WheelJoint.h.

void b2WheelJoint::SetSpringFrequencyHz ( float32  hz)
inline

Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring.

Definition at line 190 of file b2WheelJoint.h.

bool b2WheelJoint::SolvePositionConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 280 of file b2WheelJoint.cpp.

void b2WheelJoint::SolveVelocityConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 216 of file b2WheelJoint.cpp.

Friends And Related Function Documentation

friend class b2Joint
friend

Definition at line 134 of file b2WheelJoint.h.

Member Data Documentation

b2Vec2 b2WheelJoint::m_ax
protected

Definition at line 168 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_ay
protected

Definition at line 168 of file b2WheelJoint.h.

float32 b2WheelJoint::m_bias
protected

Definition at line 176 of file b2WheelJoint.h.

float32 b2WheelJoint::m_dampingRatio
protected

Definition at line 142 of file b2WheelJoint.h.

bool b2WheelJoint::m_enableMotor
protected

Definition at line 156 of file b2WheelJoint.h.

float32 b2WheelJoint::m_frequencyHz
protected

Definition at line 141 of file b2WheelJoint.h.

float32 b2WheelJoint::m_gamma
protected

Definition at line 177 of file b2WheelJoint.h.

float32 b2WheelJoint::m_impulse
protected

Definition at line 150 of file b2WheelJoint.h.

int32 b2WheelJoint::m_indexA
protected

Definition at line 159 of file b2WheelJoint.h.

int32 b2WheelJoint::m_indexB
protected

Definition at line 160 of file b2WheelJoint.h.

float32 b2WheelJoint::m_invIA
protected

Definition at line 165 of file b2WheelJoint.h.

float32 b2WheelJoint::m_invIB
protected

Definition at line 166 of file b2WheelJoint.h.

float32 b2WheelJoint::m_invMassA
protected

Definition at line 163 of file b2WheelJoint.h.

float32 b2WheelJoint::m_invMassB
protected

Definition at line 164 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localAnchorA
protected

Definition at line 145 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localAnchorB
protected

Definition at line 146 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localCenterA
protected

Definition at line 161 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localCenterB
protected

Definition at line 162 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localXAxisA
protected

Definition at line 147 of file b2WheelJoint.h.

b2Vec2 b2WheelJoint::m_localYAxisA
protected

Definition at line 148 of file b2WheelJoint.h.

float32 b2WheelJoint::m_mass
protected

Definition at line 172 of file b2WheelJoint.h.

float32 b2WheelJoint::m_maxMotorTorque
protected

Definition at line 154 of file b2WheelJoint.h.

float32 b2WheelJoint::m_motorImpulse
protected

Definition at line 151 of file b2WheelJoint.h.

float32 b2WheelJoint::m_motorMass
protected

Definition at line 173 of file b2WheelJoint.h.

float32 b2WheelJoint::m_motorSpeed
protected

Definition at line 155 of file b2WheelJoint.h.

float32 b2WheelJoint::m_sAx
protected

Definition at line 169 of file b2WheelJoint.h.

float32 b2WheelJoint::m_sAy
protected

Definition at line 170 of file b2WheelJoint.h.

float32 b2WheelJoint::m_sBx
protected

Definition at line 169 of file b2WheelJoint.h.

float32 b2WheelJoint::m_sBy
protected

Definition at line 170 of file b2WheelJoint.h.

float32 b2WheelJoint::m_springImpulse
protected

Definition at line 152 of file b2WheelJoint.h.

float32 b2WheelJoint::m_springMass
protected

Definition at line 174 of file b2WheelJoint.h.


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


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:52