#include <b2MotorJoint.h>
Public Member Functions | |
void | Dump () |
Dump to b2Log. | |
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 | GetAngularOffset () const |
float32 | GetCorrectionFactor () const |
Get the position correction factor in the range [0,1]. | |
const b2Vec2 & | GetLinearOffset () const |
float32 | GetMaxForce () const |
Get the maximum friction force in N. | |
float32 | GetMaxTorque () const |
Get the maximum friction torque in N*m. | |
b2Vec2 | GetReactionForce (float32 inv_dt) const |
Get the reaction force on bodyB at the joint anchor in Newtons. | |
float32 | GetReactionTorque (float32 inv_dt) const |
Get the reaction torque on bodyB in N*m. | |
void | SetAngularOffset (float32 angularOffset) |
Set/get the target angular offset, in radians. | |
void | SetCorrectionFactor (float32 factor) |
Set the position correction factor in the range [0,1]. | |
void | SetLinearOffset (const b2Vec2 &linearOffset) |
Set/get the target linear offset, in frame A, in meters. | |
void | SetMaxForce (float32 force) |
Set the maximum friction force in N. | |
void | SetMaxTorque (float32 torque) |
Set the maximum friction torque in N*m. | |
Protected Member Functions | |
b2MotorJoint (const b2MotorJointDef *def) | |
void | InitVelocityConstraints (const b2SolverData &data) |
bool | SolvePositionConstraints (const b2SolverData &data) |
void | SolveVelocityConstraints (const b2SolverData &data) |
Protected Attributes | |
float32 | m_angularError |
float32 | m_angularImpulse |
float32 | m_angularMass |
float32 | m_angularOffset |
float32 | m_correctionFactor |
int32 | m_indexA |
int32 | m_indexB |
float32 | m_invIA |
float32 | m_invIB |
float32 | m_invMassA |
float32 | m_invMassB |
b2Vec2 | m_linearError |
b2Vec2 | m_linearImpulse |
b2Mat22 | m_linearMass |
b2Vec2 | m_linearOffset |
b2Vec2 | m_localCenterA |
b2Vec2 | m_localCenterB |
float32 | m_maxForce |
float32 | m_maxTorque |
b2Vec2 | m_rA |
b2Vec2 | m_rB |
Friends | |
class | b2Joint |
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 59 of file b2MotorJoint.h.
b2MotorJoint::b2MotorJoint | ( | const b2MotorJointDef * | def | ) | [protected] |
Definition at line 47 of file b2MotorJoint.cpp.
void b2MotorJoint::Dump | ( | ) | [virtual] |
b2Vec2 b2MotorJoint::GetAnchorA | ( | ) | const [virtual] |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 206 of file b2MotorJoint.cpp.
b2Vec2 b2MotorJoint::GetAnchorB | ( | ) | const [virtual] |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 211 of file b2MotorJoint.cpp.
float32 b2MotorJoint::GetAngularOffset | ( | ) | const |
Definition at line 284 of file b2MotorJoint.cpp.
float32 b2MotorJoint::GetCorrectionFactor | ( | ) | const |
Get the position correction factor in the range [0,1].
Definition at line 254 of file b2MotorJoint.cpp.
const b2Vec2 & b2MotorJoint::GetLinearOffset | ( | ) | const |
Definition at line 269 of file b2MotorJoint.cpp.
float32 b2MotorJoint::GetMaxForce | ( | ) | const |
Get the maximum friction force in N.
Definition at line 232 of file b2MotorJoint.cpp.
float32 b2MotorJoint::GetMaxTorque | ( | ) | const |
Get the maximum friction torque in N*m.
Definition at line 243 of file b2MotorJoint.cpp.
b2Vec2 b2MotorJoint::GetReactionForce | ( | float32 | inv_dt | ) | const [virtual] |
Get the reaction force on bodyB at the joint anchor in Newtons.
Implements b2Joint.
Definition at line 216 of file b2MotorJoint.cpp.
float32 b2MotorJoint::GetReactionTorque | ( | float32 | inv_dt | ) | const [virtual] |
Get the reaction torque on bodyB in N*m.
Implements b2Joint.
Definition at line 221 of file b2MotorJoint.cpp.
void b2MotorJoint::InitVelocityConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 61 of file b2MotorJoint.cpp.
void b2MotorJoint::SetAngularOffset | ( | float32 | angularOffset | ) |
Set/get the target angular offset, in radians.
Definition at line 274 of file b2MotorJoint.cpp.
void b2MotorJoint::SetCorrectionFactor | ( | float32 | factor | ) |
Set the position correction factor in the range [0,1].
Definition at line 248 of file b2MotorJoint.cpp.
void b2MotorJoint::SetLinearOffset | ( | const b2Vec2 & | linearOffset | ) |
Set/get the target linear offset, in frame A, in meters.
Definition at line 259 of file b2MotorJoint.cpp.
void b2MotorJoint::SetMaxForce | ( | float32 | force | ) |
Set the maximum friction force in N.
Definition at line 226 of file b2MotorJoint.cpp.
void b2MotorJoint::SetMaxTorque | ( | float32 | torque | ) |
Set the maximum friction torque in N*m.
Definition at line 237 of file b2MotorJoint.cpp.
bool b2MotorJoint::SolvePositionConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 199 of file b2MotorJoint.cpp.
void b2MotorJoint::SolveVelocityConstraints | ( | const b2SolverData & | data | ) | [protected, virtual] |
Implements b2Joint.
Definition at line 141 of file b2MotorJoint.cpp.
friend class b2Joint [friend] |
Definition at line 99 of file b2MotorJoint.h.
float32 b2MotorJoint::m_angularError [protected] |
Definition at line 124 of file b2MotorJoint.h.
float32 b2MotorJoint::m_angularImpulse [protected] |
Definition at line 111 of file b2MotorJoint.h.
float32 b2MotorJoint::m_angularMass [protected] |
Definition at line 130 of file b2MotorJoint.h.
float32 b2MotorJoint::m_angularOffset [protected] |
Definition at line 109 of file b2MotorJoint.h.
float32 b2MotorJoint::m_correctionFactor [protected] |
Definition at line 114 of file b2MotorJoint.h.
int32 b2MotorJoint::m_indexA [protected] |
Definition at line 117 of file b2MotorJoint.h.
int32 b2MotorJoint::m_indexB [protected] |
Definition at line 118 of file b2MotorJoint.h.
float32 b2MotorJoint::m_invIA [protected] |
Definition at line 127 of file b2MotorJoint.h.
float32 b2MotorJoint::m_invIB [protected] |
Definition at line 128 of file b2MotorJoint.h.
float32 b2MotorJoint::m_invMassA [protected] |
Definition at line 125 of file b2MotorJoint.h.
float32 b2MotorJoint::m_invMassB [protected] |
Definition at line 126 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_linearError [protected] |
Definition at line 123 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_linearImpulse [protected] |
Definition at line 110 of file b2MotorJoint.h.
b2Mat22 b2MotorJoint::m_linearMass [protected] |
Definition at line 129 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_linearOffset [protected] |
Definition at line 108 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_localCenterA [protected] |
Definition at line 121 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_localCenterB [protected] |
Definition at line 122 of file b2MotorJoint.h.
float32 b2MotorJoint::m_maxForce [protected] |
Definition at line 112 of file b2MotorJoint.h.
float32 b2MotorJoint::m_maxTorque [protected] |
Definition at line 113 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_rA [protected] |
Definition at line 119 of file b2MotorJoint.h.
b2Vec2 b2MotorJoint::m_rB [protected] |
Definition at line 120 of file b2MotorJoint.h.