Gear joint definition. More...
#include <GearJointConf.hpp>
Public Types | |
using | super = JointBuilder< GearJointConf > |
Super type. | |
Public Types inherited from playrho::d2::JointBuilder< GearJointConf > | |
using | value_type = GearJointConf |
Value type. | |
using | reference = value_type & |
Reference type. | |
Public Member Functions | |
constexpr | GearJointConf ()=default |
Default constructor. | |
GearJointConf (BodyID bA, BodyID bB, BodyID bC, BodyID bD) noexcept | |
Initializing constructor. | |
constexpr auto & | UseRatio (Real v) noexcept |
Uses the given ratio value. | |
Public Member Functions inherited from playrho::d2::JointBuilder< GearJointConf > | |
constexpr reference | UseBodyA (BodyID b) noexcept |
Use value for body A setting. | |
constexpr reference | UseBodyB (BodyID b) noexcept |
Use value for body B setting. | |
constexpr reference | UseCollideConnected (bool v) noexcept |
Use value for collide connected setting. | |
Public Attributes | |
BodyID | bodyC = InvalidBodyID |
Identifier of body C. | |
BodyID | bodyD = InvalidBodyID |
Identifier of body D. | |
TypeID | type1 = GetTypeID<void>() |
Type of the first joint. | |
TypeID | type2 = GetTypeID<void>() |
Type of the second joint. | |
Length2 | localAnchorA {} |
Local anchor A. | |
Length2 | localAnchorB {} |
Local anchor B. | |
Length2 | localAnchorC {} |
Local anchor C. | |
Length2 | localAnchorD {} |
Local anchor D. | |
UnitVec | localAxis1 |
Local axis 1. Used when type1 is not Revolute. | |
UnitVec | localAxis2 |
Local axis 2. Used when type2 is not Revolute. | |
Angle | referenceAngle1 = 0_deg |
Reference angle of joint 1. Used when type1 is Revolute. | |
Angle | referenceAngle2 = 0_deg |
Reference angle of joint 2. Used when type2 is Revolute. | |
Real | ratio = Real{1} |
The gear ratio. More... | |
Real | constant = Real{0} |
Constant applied with the ratio. More... | |
Momentum | impulse = 0_Ns |
Impulse. | |
Vec2 | JvAC = Vec2{} |
AC Jv data. | |
Vec2 | JvBD = {} |
BD Jv data. | |
Length | JwA = 0_m |
A Jw data. | |
Length | JwB = 0_m |
B Jw data. | |
Length | JwC = 0_m |
C Jw data. | |
Length | JwD = 0_m |
D Jw data. | |
Real | mass = 0 |
Either linear mass or angular mass. | |
Public Attributes inherited from playrho::d2::JointConf | |
BodyID | bodyA = InvalidBodyID |
1st attached body. | |
BodyID | bodyB = InvalidBodyID |
2nd attached body. | |
bool | collideConnected = false |
Collide connected. More... | |
Related Functions | |
(Note that these are not member functions.) | |
constexpr Momentum2 | GetLinearReaction (const GearJointConf &object) |
Gets the current linear reaction for the given configuration. | |
constexpr AngularMomentum | GetAngularReaction (const GearJointConf &object) |
Gets the current angular reaction for the given configuration. | |
constexpr bool | ShiftOrigin (GearJointConf &, Length2) noexcept |
Shifts the origin notion of the given configuration. | |
void | InitVelocity (GearJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) |
Initializes velocity constraint data based on the given solver data. More... | |
bool | SolveVelocity (GearJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step) |
Solves velocity constraint. More... | |
bool | SolvePosition (const GearJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
Solves the position constraint. More... | |
constexpr auto | GetRatio (const GearJointConf &object) noexcept |
Free function for getting the ratio value of the given configuration. | |
constexpr auto | SetRatio (GearJointConf &object, Real value) noexcept |
Free function for setting the ratio value of the given configuration. | |
constexpr auto | GetConstant (const GearJointConf &object) noexcept |
Free function for getting the constant value of the given configuration. | |
constexpr auto | GetType1 (const GearJointConf &object) noexcept |
Free function for getting joint 1 type value of the given configuration. | |
constexpr auto | GetType2 (const GearJointConf &object) noexcept |
Free function for getting joint 2 type value of the given configuration. | |
Related Functions inherited from playrho::d2::JointConf | |
void | Set (JointConf &def, const Joint &joint) noexcept |
Sets the joint definition data for the given joint. | |
Gear joint definition.
A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant
. The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length.
|
related |
Initializes velocity constraint data based on the given solver data.
SolveVelocity
.
|
related |
Solves the position constraint.
true
if the position errors are within tolerance.
|
related |
Solves velocity constraint.
InitVelocity
has been called. true
if velocity is "solved", false
otherwise.