#include <b2RevoluteJoint.h>
Public Member Functions | |
void | Dump () |
Dump to b2Log. | |
void | EnableLimit (bool flag) |
Enable/disable the joint limit. | |
void | EnableMotor (bool flag) |
Enable/disable the joint motor. | |
b2Vec2 | GetAnchorA () const |
Get the anchor point on bodyA in world coordinates. | |
b2Vec2 | GetAnchorB () const |
Get the anchor point on bodyB in world coordinates. | |
float32 | GetJointAngle () const |
Get the current joint angle in radians. | |
float32 | GetJointSpeed () const |
Get the current joint angle speed in radians per second. | |
const b2Vec2 & | GetLocalAnchorA () const |
The local anchor point relative to bodyA's origin. | |
const b2Vec2 & | GetLocalAnchorB () const |
The local anchor point relative to bodyB's origin. | |
float32 | GetLowerLimit () const |
Get the lower joint limit in radians. | |
float32 | GetMaxMotorTorque () const |
float32 | GetMotorSpeed () const |
Get the motor speed in radians per second. | |
float32 | GetMotorTorque (float32 inv_dt) const |
b2Vec2 | GetReactionForce (float32 inv_dt) const |
float32 | GetReactionTorque (float32 inv_dt) const |
float32 | GetReferenceAngle () const |
Get the reference angle. | |
float32 | GetUpperLimit () const |
Get the upper joint limit in radians. | |
bool | IsLimitEnabled () const |
Is the joint limit enabled? | |
bool | IsMotorEnabled () const |
Is the joint motor enabled? | |
void | SetLimits (float32 lower, float32 upper) |
Set the joint limits in radians. | |
void | SetMaxMotorTorque (float32 torque) |
Set the maximum motor torque, usually in N-m. | |
void | SetMotorSpeed (float32 speed) |
Set the motor speed in radians per second. | |
Protected Member Functions | |
b2RevoluteJoint (const b2RevoluteJointDef *def) | |
void | InitVelocityConstraints (const b2SolverData &data) |
bool | SolvePositionConstraints (const b2SolverData &data) |
void | SolveVelocityConstraints (const b2SolverData &data) |
Protected Attributes | |
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 |
b2LimitState | m_limitState |
b2Vec2 | m_localAnchorA |
b2Vec2 | m_localAnchorB |
b2Vec2 | m_localCenterA |
b2Vec2 | m_localCenterB |
float32 | m_lowerAngle |
b2Mat33 | m_mass |
float32 | m_maxMotorTorque |
float32 | m_motorImpulse |
float32 | m_motorMass |
float32 | m_motorSpeed |
b2Vec2 | m_rA |
b2Vec2 | m_rB |
float32 | m_referenceAngle |
float32 | m_upperAngle |
Friends | |
class | b2GearJoint |
class | b2Joint |
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Definition at line 90 of file b2RevoluteJoint.h.
b2RevoluteJoint::b2RevoluteJoint | ( | const b2RevoluteJointDef * | def | ) | [protected] |
Definition at line 45 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::Dump | ( | ) | [virtual] |
void b2RevoluteJoint::EnableLimit | ( | bool | flag | ) |
Enable/disable the joint limit.
Definition at line 448 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::EnableMotor | ( | bool | flag | ) |
Enable/disable the joint motor.
Definition at line 417 of file b2RevoluteJoint.cpp.
b2Vec2 b2RevoluteJoint::GetAnchorA | ( | ) | const [virtual] |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 377 of file b2RevoluteJoint.cpp.
b2Vec2 b2RevoluteJoint::GetAnchorB | ( | ) | const [virtual] |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 382 of file b2RevoluteJoint.cpp.
float32 b2RevoluteJoint::GetJointAngle | ( | ) | const |
Get the current joint angle in radians.
Definition at line 398 of file b2RevoluteJoint.cpp.
float32 b2RevoluteJoint::GetJointSpeed | ( | ) | const |
Get the current joint angle speed in radians per second.
Definition at line 405 of file b2RevoluteJoint.cpp.
const b2Vec2& b2RevoluteJoint::GetLocalAnchorA | ( | ) | const [inline] |
The local anchor point relative to bodyA's origin.
Definition at line 97 of file b2RevoluteJoint.h.
const b2Vec2& b2RevoluteJoint::GetLocalAnchorB | ( | ) | const [inline] |
The local anchor point relative to bodyB's origin.
Definition at line 100 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::GetLowerLimit | ( | ) | const |
Get the lower joint limit in radians.
Definition at line 459 of file b2RevoluteJoint.cpp.
float32 b2RevoluteJoint::GetMaxMotorTorque | ( | ) | const [inline] |
Definition at line 140 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::GetMotorSpeed | ( | ) | const [inline] |
Get the motor speed in radians per second.
Definition at line 199 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::GetMotorTorque | ( | float32 | inv_dt | ) | const |
Get the current motor torque given the inverse time step. Unit is N*m.
Definition at line 424 of file b2RevoluteJoint.cpp.
b2Vec2 b2RevoluteJoint::GetReactionForce | ( | float32 | inv_dt | ) | const [virtual] |
Get the reaction force given the inverse time step. Unit is N.
Implements b2Joint.
Definition at line 387 of file b2RevoluteJoint.cpp.
float32 b2RevoluteJoint::GetReactionTorque | ( | float32 | inv_dt | ) | const [virtual] |
Get the reaction torque due to the joint limit given the inverse time step. Unit is N*m.
Implements b2Joint.
Definition at line 393 of file b2RevoluteJoint.cpp.
float32 b2RevoluteJoint::GetReferenceAngle | ( | ) | const [inline] |
Get the reference angle.
Definition at line 103 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::GetUpperLimit | ( | ) | const |
Get the upper joint limit in radians.
Definition at line 464 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::InitVelocityConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 64 of file b2RevoluteJoint.cpp.
bool b2RevoluteJoint::IsLimitEnabled | ( | ) | const |
Is the joint limit enabled?
Definition at line 443 of file b2RevoluteJoint.cpp.
bool b2RevoluteJoint::IsMotorEnabled | ( | ) | const |
Is the joint motor enabled?
Definition at line 412 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::SetLimits | ( | float32 | lower, |
float32 | upper | ||
) |
Set the joint limits in radians.
Definition at line 469 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::SetMaxMotorTorque | ( | float32 | torque | ) |
Set the maximum motor torque, usually in N-m.
Definition at line 436 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::SetMotorSpeed | ( | float32 | speed | ) |
Set the motor speed in radians per second.
Definition at line 429 of file b2RevoluteJoint.cpp.
bool b2RevoluteJoint::SolvePositionConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 291 of file b2RevoluteJoint.cpp.
void b2RevoluteJoint::SolveVelocityConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 183 of file b2RevoluteJoint.cpp.
friend class b2GearJoint [friend] |
Reimplemented from b2Joint.
Definition at line 160 of file b2RevoluteJoint.h.
friend class b2Joint [friend] |
Definition at line 159 of file b2RevoluteJoint.h.
bool b2RevoluteJoint::m_enableLimit [protected] |
Definition at line 178 of file b2RevoluteJoint.h.
bool b2RevoluteJoint::m_enableMotor [protected] |
Definition at line 174 of file b2RevoluteJoint.h.
b2Vec3 b2RevoluteJoint::m_impulse [protected] |
Definition at line 171 of file b2RevoluteJoint.h.
int32 b2RevoluteJoint::m_indexA [protected] |
Definition at line 184 of file b2RevoluteJoint.h.
int32 b2RevoluteJoint::m_indexB [protected] |
Definition at line 185 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_invIA [protected] |
Definition at line 192 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_invIB [protected] |
Definition at line 193 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_invMassA [protected] |
Definition at line 190 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_invMassB [protected] |
Definition at line 191 of file b2RevoluteJoint.h.
b2LimitState b2RevoluteJoint::m_limitState [protected] |
Definition at line 196 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_localAnchorA [protected] |
Definition at line 169 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_localAnchorB [protected] |
Definition at line 170 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_localCenterA [protected] |
Definition at line 188 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_localCenterB [protected] |
Definition at line 189 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_lowerAngle [protected] |
Definition at line 180 of file b2RevoluteJoint.h.
b2Mat33 b2RevoluteJoint::m_mass [protected] |
Definition at line 194 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_maxMotorTorque [protected] |
Definition at line 175 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_motorImpulse [protected] |
Definition at line 172 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_motorMass [protected] |
Definition at line 195 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_motorSpeed [protected] |
Definition at line 176 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_rA [protected] |
Definition at line 186 of file b2RevoluteJoint.h.
b2Vec2 b2RevoluteJoint::m_rB [protected] |
Definition at line 187 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_referenceAngle [protected] |
Definition at line 179 of file b2RevoluteJoint.h.
float32 b2RevoluteJoint::m_upperAngle [protected] |
Definition at line 181 of file b2RevoluteJoint.h.