Revolute joint definition. More...
#include <RevoluteJointConf.hpp>
Public Types | |
using | super = JointBuilder< RevoluteJointConf > |
Super type. | |
Public Types inherited from playrho::d2::JointBuilder< RevoluteJointConf > | |
using | value_type = RevoluteJointConf |
Value type. | |
using | reference = value_type & |
Reference type. | |
Public Member Functions | |
constexpr | RevoluteJointConf ()=default |
Default constructor. | |
RevoluteJointConf (BodyID bA, BodyID bB, Length2 laA=Length2{}, Length2 laB=Length2{}, Angle ra=0_deg) noexcept | |
Initialize the bodies, anchors, and reference angle using a world anchor point. | |
constexpr auto & | UseEnableLimit (bool v) noexcept |
Uses the given enable limit state value. | |
constexpr auto & | UseLowerAngle (Angle v) noexcept |
Uses the given lower angle value. | |
constexpr auto & | UseUpperAngle (Angle v) noexcept |
Uses the given upper angle value. | |
constexpr auto & | UseEnableMotor (bool v) noexcept |
Uses the given enable motor state value. | |
constexpr auto & | UseMotorSpeed (AngularVelocity v) noexcept |
Uses the given motor speed value. | |
constexpr auto & | UseMaxMotorTorque (Torque v) noexcept |
Uses the given max motor torque value. | |
Public Member Functions inherited from playrho::d2::JointBuilder< RevoluteJointConf > | |
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{} |
Local anchor point relative to body A's origin. | |
Length2 | localAnchorB = Length2{} |
Local anchor point relative to body B's origin. | |
Vec3 | impulse = Vec3{} |
Impulse. More... | |
AngularMomentum | angularMotorImpulse = {} |
Motor impulse. More... | |
Angle | referenceAngle = 0_deg |
Reference angle. More... | |
bool | enableLimit = false |
Flag to enable joint limits. | |
Angle | lowerAngle = 0_deg |
Lower angle for the joint limit. | |
Angle | upperAngle = 0_deg |
Upper angle for the joint limit. | |
bool | enableMotor = false |
Flag to enable the joint motor. | |
AngularVelocity | motorSpeed = 0_rpm |
Desired motor speed. | |
Torque | maxMotorTorque = 0 |
Maximum motor torque used to achieve the desired motor speed. | |
Length2 | rA = {} |
Rotated delta of body A's local center from local anchor A. | |
Length2 | rB = {} |
Rotated delta of body B's local center from local anchor B. | |
Mat33 | mass = {} |
Effective mass for point-to-point constraint. | |
RotInertia | angularMass = {} |
Effective mass for motor/limit angular constraint. | |
LimitState | limitState = LimitState::e_inactiveLimit |
Limit state. | |
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 auto | ShiftOrigin (RevoluteJointConf &, Length2) noexcept |
Shifts the origin notion of the given configuration. | |
constexpr Angle | GetAngularLowerLimit (const RevoluteJointConf &conf) noexcept |
Free function for getting the angular lower limit value of the given configuration. | |
constexpr Angle | GetAngularUpperLimit (const RevoluteJointConf &conf) noexcept |
Free function for getting the angular upper limit value of the given configuration. | |
constexpr Momentum2 | GetLinearReaction (const RevoluteJointConf &conf) noexcept |
Gets the current linear reaction of the given configuration. | |
constexpr AngularMomentum | GetAngularReaction (const RevoluteJointConf &conf) noexcept |
Gets the current angular reaction of the given configuration. | |
void | InitVelocity (RevoluteJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) |
Initializes velocity constraint data based on the given solver data. More... | |
bool | SolveVelocity (RevoluteJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step) |
Solves velocity constraint. More... | |
bool | SolvePosition (const RevoluteJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
Solves the position constraint. More... | |
constexpr void | SetAngularLimits (RevoluteJointConf &object, Angle lower, Angle upper) noexcept |
Free function for setting the angular limits of the given configuration. | |
constexpr void | SetMaxMotorTorque (RevoluteJointConf &object, Torque value) |
Free function for setting the max motor torque 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. | |
Revolute joint definition.
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. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This 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. AngularMomentum playrho::d2::RevoluteJointConf::angularMotorImpulse = {} |
Motor impulse.
InitVelocity
, SolveVelocity
. Impulse.
InitVelocity
, SolveVelocityConstraints
. Angle playrho::d2::RevoluteJointConf::referenceAngle = 0_deg |
Reference angle.
This is the body-B angle minus body-A angle in the reference state (radians).