#include <b2_wheel_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 translation 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 | GetDamping () const |
float | GetJointAngle () const |
Get the current joint angle in radians. More... | |
float | GetJointAngularSpeed () const |
Get the current joint angular speed in radians per second. More... | |
float | GetJointLinearSpeed () const |
Get the current joint linear 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 translation limit, usually in meters. More... | |
float | GetMaxMotorTorque () const |
float | GetMotorSpeed () const |
Get the motor speed, usually in radians per second. More... | |
float | GetMotorTorque (float inv_dt) const |
Get the current motor torque given the inverse time step, usually 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... | |
float | GetStiffness () const |
float | GetUpperLimit () const |
Get the upper joint translation limit, usually in meters. More... | |
bool | IsLimitEnabled () const |
Is the joint limit enabled? More... | |
bool | IsMotorEnabled () const |
Is the joint motor enabled? More... | |
void | SetDamping (float damping) |
Access damping. More... | |
void | SetLimits (float lower, float upper) |
Set the joint translation limits, usually in meters. More... | |
void | SetMaxMotorTorque (float torque) |
Set/Get the maximum motor force, usually in N-m. More... | |
void | SetMotorSpeed (float speed) |
Set the motor speed, usually in radians per second. More... | |
void | SetStiffness (float stiffness) |
Access spring stiffness. 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 | |
b2WheelJoint (const b2WheelJointDef *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 | |
b2Vec2 | m_ax |
float | m_axialMass |
b2Vec2 | m_ay |
float | m_bias |
float | m_damping |
bool | m_enableLimit |
bool | m_enableMotor |
float | m_gamma |
float | m_impulse |
int32 | m_indexA |
int32 | m_indexB |
float | m_invIA |
float | m_invIB |
float | m_invMassA |
float | m_invMassB |
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_mass |
float | m_maxMotorTorque |
float | m_motorImpulse |
float | m_motorMass |
float | m_motorSpeed |
float | m_sAx |
float | m_sAy |
float | m_sBx |
float | m_sBy |
float | m_springImpulse |
float | m_springMass |
float | m_stiffness |
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 | b2Joint |
Additional Inherited Members | |
![]() | |
static b2Joint * | Create (const b2JointDef *def, b2BlockAllocator *allocator) |
static void | Destroy (b2Joint *joint, b2BlockAllocator *allocator) |
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. The spring/damper is initialized upon creation. This joint is designed for vehicle suspensions.
Definition at line 95 of file b2_wheel_joint.h.
|
protected |
Definition at line 53 of file b2_wheel_joint.cpp.
Debug draw this joint.
Reimplemented from b2Joint.
Definition at line 639 of file b2_wheel_joint.cpp.
|
overridevirtual |
void b2WheelJoint::EnableLimit | ( | bool | flag | ) |
Enable/disable the joint translation limit.
Definition at line 520 of file b2_wheel_joint.cpp.
void b2WheelJoint::EnableMotor | ( | bool | flag | ) |
Enable/disable the joint motor.
Definition at line 561 of file b2_wheel_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 446 of file b2_wheel_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 451 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetDamping | ( | ) | const |
Definition at line 611 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetJointAngle | ( | ) | const |
Get the current joint angle in radians.
Definition at line 501 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetJointAngularSpeed | ( | ) | const |
Get the current joint angular speed in radians per second.
Definition at line 508 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetJointLinearSpeed | ( | ) | const |
Get the current joint linear speed, usually in meters per second.
Definition at line 480 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetJointTranslation | ( | ) | const |
Get the current joint translation, usually in meters.
Definition at line 466 of file b2_wheel_joint.cpp.
|
inline |
The local anchor point relative to bodyA's origin.
Definition at line 105 of file b2_wheel_joint.h.
|
inline |
The local anchor point relative to bodyB's origin.
Definition at line 108 of file b2_wheel_joint.h.
|
inline |
The local joint axis relative to bodyA.
Definition at line 111 of file b2_wheel_joint.h.
float b2WheelJoint::GetLowerLimit | ( | ) | const |
Get the lower joint translation limit, usually in meters.
Definition at line 532 of file b2_wheel_joint.cpp.
|
inline |
Definition at line 235 of file b2_wheel_joint.h.
|
inline |
Get the motor speed, usually in radians per second.
Definition at line 230 of file b2_wheel_joint.h.
float b2WheelJoint::GetMotorTorque | ( | float | inv_dt | ) | const |
Get the current motor torque given the inverse time step, usually in N-m.
Definition at line 591 of file b2_wheel_joint.cpp.
|
overridevirtual |
Get the reaction force on bodyB at the joint anchor in Newtons.
Implements b2Joint.
Definition at line 456 of file b2_wheel_joint.cpp.
|
overridevirtual |
Get the reaction torque on bodyB in N*m.
Implements b2Joint.
Definition at line 461 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetStiffness | ( | ) | const |
Definition at line 601 of file b2_wheel_joint.cpp.
float b2WheelJoint::GetUpperLimit | ( | ) | const |
Get the upper joint translation limit, usually in meters.
Definition at line 537 of file b2_wheel_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 89 of file b2_wheel_joint.cpp.
bool b2WheelJoint::IsLimitEnabled | ( | ) | const |
Is the joint limit enabled?
Definition at line 515 of file b2_wheel_joint.cpp.
bool b2WheelJoint::IsMotorEnabled | ( | ) | const |
Is the joint motor enabled?
Definition at line 556 of file b2_wheel_joint.cpp.
void b2WheelJoint::SetDamping | ( | float | damping | ) |
Access damping.
Definition at line 606 of file b2_wheel_joint.cpp.
void b2WheelJoint::SetLimits | ( | float | lower, |
float | upper | ||
) |
Set the joint translation limits, usually in meters.
Definition at line 542 of file b2_wheel_joint.cpp.
void b2WheelJoint::SetMaxMotorTorque | ( | float | torque | ) |
Set/Get the maximum motor force, usually in N-m.
Definition at line 581 of file b2_wheel_joint.cpp.
void b2WheelJoint::SetMotorSpeed | ( | float | speed | ) |
Set the motor speed, usually in radians per second.
Definition at line 571 of file b2_wheel_joint.cpp.
void b2WheelJoint::SetStiffness | ( | float | stiffness | ) |
Access spring stiffness.
Definition at line 596 of file b2_wheel_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 344 of file b2_wheel_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 237 of file b2_wheel_joint.cpp.
|
friend |
Definition at line 175 of file b2_wheel_joint.h.
|
protected |
Definition at line 216 of file b2_wheel_joint.h.
|
protected |
Definition at line 222 of file b2_wheel_joint.h.
|
protected |
Definition at line 216 of file b2_wheel_joint.h.
|
protected |
Definition at line 225 of file b2_wheel_joint.h.
|
protected |
Definition at line 204 of file b2_wheel_joint.h.
|
protected |
Definition at line 200 of file b2_wheel_joint.h.
|
protected |
Definition at line 201 of file b2_wheel_joint.h.
|
protected |
Definition at line 226 of file b2_wheel_joint.h.
|
protected |
Definition at line 187 of file b2_wheel_joint.h.
|
protected |
Definition at line 207 of file b2_wheel_joint.h.
|
protected |
Definition at line 208 of file b2_wheel_joint.h.
|
protected |
Definition at line 213 of file b2_wheel_joint.h.
|
protected |
Definition at line 214 of file b2_wheel_joint.h.
|
protected |
Definition at line 211 of file b2_wheel_joint.h.
|
protected |
Definition at line 212 of file b2_wheel_joint.h.
|
protected |
Definition at line 182 of file b2_wheel_joint.h.
|
protected |
Definition at line 183 of file b2_wheel_joint.h.
|
protected |
Definition at line 209 of file b2_wheel_joint.h.
|
protected |
Definition at line 210 of file b2_wheel_joint.h.
|
protected |
Definition at line 184 of file b2_wheel_joint.h.
|
protected |
Definition at line 185 of file b2_wheel_joint.h.
|
protected |
Definition at line 191 of file b2_wheel_joint.h.
|
protected |
Definition at line 194 of file b2_wheel_joint.h.
|
protected |
Definition at line 220 of file b2_wheel_joint.h.
|
protected |
Definition at line 197 of file b2_wheel_joint.h.
|
protected |
Definition at line 188 of file b2_wheel_joint.h.
|
protected |
Definition at line 221 of file b2_wheel_joint.h.
|
protected |
Definition at line 198 of file b2_wheel_joint.h.
|
protected |
Definition at line 217 of file b2_wheel_joint.h.
|
protected |
Definition at line 218 of file b2_wheel_joint.h.
|
protected |
Definition at line 217 of file b2_wheel_joint.h.
|
protected |
Definition at line 218 of file b2_wheel_joint.h.
|
protected |
Definition at line 189 of file b2_wheel_joint.h.
|
protected |
Definition at line 223 of file b2_wheel_joint.h.
|
protected |
Definition at line 203 of file b2_wheel_joint.h.
|
protected |
Definition at line 193 of file b2_wheel_joint.h.
|
protected |
Definition at line 192 of file b2_wheel_joint.h.
|
protected |
Definition at line 195 of file b2_wheel_joint.h.