Wheel joint definition. More...
#include <WheelJointConf.hpp>
Public Types | |
using | super = JointBuilder< WheelJointConf > |
Super type. | |
Public Types inherited from playrho::d2::JointBuilder< WheelJointConf > | |
using | value_type = WheelJointConf |
Value type. | |
using | reference = value_type & |
Reference type. | |
Public Member Functions | |
constexpr | WheelJointConf ()=default |
Default constructor. | |
WheelJointConf (BodyID bA, BodyID bB, Length2 laA=Length2{}, Length2 laB=Length2{}, UnitVec axis=UnitVec::GetRight()) noexcept | |
Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis. | |
constexpr auto & | UseEnableMotor (bool v) noexcept |
Uses the given enable motor state value. | |
constexpr auto & | UseMaxMotorTorque (Torque v) noexcept |
Uses the given max motor toque value. | |
constexpr auto & | UseMotorSpeed (AngularVelocity v) noexcept |
Uses the given motor speed value. | |
constexpr auto & | UseFrequency (NonNegative< Frequency > v) noexcept |
Uses the given frequency value. | |
constexpr auto & | UseDampingRatio (Real v) noexcept |
Uses the given damping ratio value. | |
Public Member Functions inherited from playrho::d2::JointBuilder< WheelJointConf > | |
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 | |
Length2 | localAnchorA = Length2{} |
The local anchor point relative to body A's origin. | |
Length2 | localAnchorB = Length2{} |
The local anchor point relative to body B's origin. | |
UnitVec | localXAxisA = UnitVec::GetRight() |
The local X translation axis in body-A. | |
UnitVec | localYAxisA = GetRevPerpendicular(UnitVec::GetRight()) |
The local Y translation axis in body-A. | |
bool | enableMotor = false |
Enable/disable the joint motor. | |
Torque | maxMotorTorque = Torque{0} |
The maximum motor torque. | |
AngularVelocity | motorSpeed = 0_rpm |
The desired angular motor speed. | |
NonNegative< Frequency > | frequency = 2_Hz |
Suspension frequency, zero indicates no suspension. | |
Real | dampingRatio = 0.7f |
Suspension damping ratio, one indicates critical damping. | |
Momentum | impulse = 0 |
Impulse. | |
AngularMomentum | angularImpulse = 0 |
Angular impulse. | |
Momentum | springImpulse = 0 |
Spring impulse. | |
UnitVec | ax |
Solver A X directional. | |
UnitVec | ay |
Solver A Y directional. | |
Length | sAx = 0_m |
Solver A x location. | |
Length | sBx = 0_m |
Solver B x location. | |
Length | sAy = 0_m |
Solver A y location. | |
Length | sBy = 0_m |
Solver B y location. | |
Mass | mass = 0_kg |
Mass. | |
RotInertia | angularMass = RotInertia{0} |
Motor mass. | |
Mass | springMass = 0_kg |
Spring mass. | |
LinearVelocity | bias = 0_mps |
Bias. | |
InvMass | gamma = InvMass{0} |
Gamma. | |
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 WheelJointConf &object) |
Gets the current linear reaction for the given configuration. | |
constexpr auto | ShiftOrigin (WheelJointConf &, Length2) |
Shifts the origin notion of the given configuration. | |
void | InitVelocity (WheelJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) |
Initializes velocity constraint data based on the given solver data. More... | |
bool | SolveVelocity (WheelJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step) |
Solves velocity constraint. More... | |
bool | SolvePosition (const WheelJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
Solves the position constraint. More... | |
constexpr void | SetMaxMotorTorque (WheelJointConf &object, Torque value) noexcept |
Sets the maximum motor torque for the given configuration. | |
constexpr void | SetFrequency (WheelJointConf &object, NonNegative< Frequency > value) noexcept |
Free function for setting the frequency of the given configuration. | |
constexpr void | SetDampingRatio (WheelJointConf &object, Real value) noexcept |
Free function for setting the damping ratio 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. | |
Wheel joint definition.
This joint provides two degrees of freedom: translation along an axis fixed in body A 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 requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.
|
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.