Wheel joint definition. More...
#include <playrho/d2/WheelJointConf.hpp>
Public Types | |
| using | super = JointBuilder< WheelJointConf > | 
| Super type.  | |
  Public Types inherited from playrho::d2::JointBuilder< WheelJointConf > | |
| using | reference = value_type & | 
| Reference type.  | |
| using | value_type = WheelJointConf | 
| Value type.  | |
Public Member Functions | |
| constexpr | WheelJointConf () noexcept=default | 
| Default constructor.  | |
| WheelJointConf (BodyID bA, BodyID bB, const Length2 &laA=Length2{}, const Length2 &laB=Length2{}, const UnitVec &axis=UnitVec::GetRight()) noexcept | |
| constexpr auto & | UseDampingRatio (Real v) noexcept | 
| Uses the given damping ratio value.  | |
| constexpr auto & | UseEnableMotor (bool v) noexcept | 
| Uses the given enable motor state value.  | |
| constexpr auto & | UseFrequency (NonNegative< Frequency > v) noexcept | 
| Uses the given frequency 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.  | |
  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 | |
| AngularMomentum | angularImpulse = {} | 
| Angular impulse.  | |
| RotInertia | angularMass = RotInertia{} | 
| Motor mass.  | |
| UnitVec | ax | 
| Solver A X directional.  | |
| UnitVec | ay | 
| Solver A Y directional.  | |
| LinearVelocity | bias = 0_mps | 
| Bias.  | |
| Real | dampingRatio = DefaultDampingRatio | 
| Suspension damping ratio, one indicates critical damping.  | |
| bool | enableMotor = false | 
| Enable/disable the joint motor.  | |
| NonNegative< Frequency > | frequency = DefaultFrequency | 
| Suspension frequency, zero indicates no suspension.  | |
| InvMass | gamma = InvMass{} | 
| Gamma.  | |
| Momentum | impulse = 0_Ns | 
| Impulse.  | |
| 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.  | |
| Mass | mass = 0_kg | 
| Mass.  | |
| Torque | maxMotorTorque = Torque{} | 
| The maximum motor torque.  | |
| AngularVelocity | motorSpeed = 0_rpm | 
| The desired angular motor speed.  | |
| Length | sAx = 0_m | 
| Solver A x location.  | |
| Length | sAy = 0_m | 
| Solver A y location.  | |
| Length | sBx = 0_m | 
| Solver B x location.  | |
| Length | sBy = 0_m | 
| Solver B y location.  | |
| Momentum | springImpulse = 0_Ns | 
| Spring impulse.  | |
| Mass | springMass = 0_kg | 
| Spring 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... | |
Static Public Attributes | |
| static constexpr auto | DefaultDampingRatio = Real(0.7f) | 
| Default damping ratio.  | |
| static constexpr auto | DefaultFrequency = NonNegative<Frequency>{2_Hz} | 
| Default frequency.  | |
Related Functions | |
(Note that these are not member functions.)  | |
| constexpr Momentum2 | GetLinearReaction (const WheelJointConf &object) | 
| Gets the current linear reaction for the given configuration.  | |
| void | InitVelocity (WheelJointConf &object, const Span< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) | 
| Initializes velocity constraint data based on the given solver data.  More... | |
| constexpr void | SetDampingRatio (WheelJointConf &object, Real value) noexcept | 
| Free function for setting the damping ratio of the given configuration.  | |
| constexpr void | SetFrequency (WheelJointConf &object, NonNegative< Frequency > value) noexcept | 
| Free function for setting the frequency of the given configuration.  | |
| constexpr void | SetMaxMotorTorque (WheelJointConf &object, Torque value) noexcept | 
| Sets the maximum motor torque for the given configuration.  | |
| constexpr auto | ShiftOrigin (WheelJointConf &, const Length2 &) | 
| Shifts the origin notion of the given configuration.  | |
| bool | SolvePosition (const WheelJointConf &object, const Span< BodyConstraint > &bodies, const ConstraintSolverConf &conf) | 
| Solves the position constraint.  More... | |
| bool | SolveVelocity (WheelJointConf &object, const Span< BodyConstraint > &bodies, const StepConf &step) | 
| Solves velocity constraint.  More... | |
  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.
      
  | 
  noexcept | 
Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
      
  | 
  related | 
Initializes velocity constraint data based on the given solver data.
SolveVelocity. | object | Configuration object. bodyA and bodyB must index bodies within the given bodies container or be the special body ID value of InvalidBodyID.  | 
| bodies | Container of body constraints. | 
| step | Configuration for the step. | 
| conf | Constraint solver configuration. | 
| std::out_of_range | If the given object's bodyA or bodyB values are not InvalidBodyID and are not indices within range of the given bodies container.  | 
      
  | 
  related | 
Solves the position constraint.
| object | Configuration object. bodyA and bodyB must index bodies within the given bodies container or be the special body ID value of InvalidBodyID.  | 
| bodies | Container of body constraints. | 
| conf | Constraint solver configuration. | 
| std::out_of_range | If the given object's bodyA or bodyB values are not InvalidBodyID and are not indices within range of the given bodies container.  | 
true if the position errors are within tolerance. 
      
  | 
  related | 
Solves velocity constraint.
InitVelocity has been called. | object | Configuration object. bodyA and bodyB must index bodies within the given bodies container or be the special body ID value of InvalidBodyID.  | 
| bodies | Container of body constraints. | 
| step | Configuration for the step. | 
| std::out_of_range | If the given object's bodyA or bodyB values are not InvalidBodyID and are not indices within range of the given bodies container.  | 
true if velocity is "solved", false otherwise.