Target joint definition. More...
#include <TargetJointConf.hpp>
Public Types | |
using | super = JointBuilder< TargetJointConf > |
Super type. | |
Public Types inherited from playrho::d2::JointBuilder< TargetJointConf > | |
using | value_type = TargetJointConf |
Value type. | |
using | reference = value_type & |
Reference type. | |
Public Member Functions | |
constexpr | TargetJointConf ()=default |
Default constructor. | |
constexpr | TargetJointConf (BodyID b) noexcept |
Initializing constructor. | |
constexpr auto & | UseTarget (Length2 v) noexcept |
Use value for target. | |
constexpr auto & | UseAnchor (Length2 v) noexcept |
Use value for the "anchor" (in coordinates local to "body B"). More... | |
constexpr auto & | UseMaxForce (NonNegative< Force > v) noexcept |
Use value for max force. | |
constexpr auto & | UseFrequency (NonNegative< Frequency > v) noexcept |
Use value for frequency. | |
constexpr auto & | UseDampingRatio (NonNegative< Real > v) noexcept |
Use value for damping ratio. | |
Public Member Functions inherited from playrho::d2::JointBuilder< TargetJointConf > | |
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 | target = Length2{} |
The initial world target point. This is assumed to coincide with the body anchor initially. | |
Length2 | localAnchorB = Length2{} |
Anchor point. | |
NonNegative< Force > | maxForce {} |
Max force. More... | |
NonNegative< Frequency > | frequency = NonNegative<Frequency>(5_Hz) |
Frequency. More... | |
NonNegative< Real > | dampingRatio = NonNegative<Real>(0.7f) |
The damping ratio. 0 = no damping, 1 = critical damping. | |
InvMass | gamma = InvMass{0} |
Gamma. | |
Momentum2 | impulse = Momentum2{} |
Impulse. | |
Length2 | rB = {} |
Relative B. | |
Mass22 | mass = {} |
2-by-2 mass matrix in kilograms. | |
LinearVelocity2 | C = {} |
Velocity constant. | |
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 | GetLocalAnchorA (const TargetJointConf &) noexcept |
Gets the local anchar A for the given configuration. | |
constexpr Momentum2 | GetLinearReaction (const TargetJointConf &object) |
Gets the current linear reaction of the given configuration. | |
constexpr AngularMomentum | GetAngularReaction (const TargetJointConf &) |
Gets the current angular reaction of the given configuration. | |
constexpr bool | ShiftOrigin (TargetJointConf &object, Length2 newOrigin) |
Shifts the origin notion of the given configuration. | |
constexpr auto | GetTarget (const TargetJointConf &object) noexcept |
Free function for getting the target value of the given configuration. | |
Mass22 | GetEffectiveMassMatrix (const TargetJointConf &object, const BodyConstraint &body) noexcept |
Gets the effective mass matrix for the given configuration and body information. | |
void | InitVelocity (TargetJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) |
Initializes velocity constraint data based on the given solver data. More... | |
bool | SolveVelocity (TargetJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step) |
Solves velocity constraint. More... | |
bool | SolvePosition (const TargetJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
Solves the position constraint. More... | |
constexpr void | SetTarget (TargetJointConf &object, Length2 value) noexcept |
Free function for setting the target value of the given configuration. | |
constexpr auto | GetMaxForce (const TargetJointConf &object) noexcept |
Free function for getting the maximum force value of the given configuration. | |
constexpr auto | SetMaxForce (TargetJointConf &object, NonNegative< Force > value) noexcept |
Free function for setting the maximum force value of the given configuration. | |
constexpr void | SetFrequency (TargetJointConf &object, NonNegative< Frequency > value) noexcept |
Free function for setting the frequency value of the given configuration. | |
constexpr void | SetDampingRatio (TargetJointConf &object, Real value) noexcept |
Free function for setting the damping ratio 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. | |
Target joint definition.
A target joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces.
|
inlineconstexprnoexcept |
Use value for the "anchor" (in coordinates local to "body B").
bodyB ? InverseTransform(target, bodyB->GetTransformation()) : GetInvalid<Length2>()
.
|
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. NonNegative<Frequency> playrho::d2::TargetJointConf::frequency = NonNegative<Frequency>(5_Hz) |
Frequency.
The has to do with the response speed.
Referenced by UseFrequency().
NonNegative<Force> playrho::d2::TargetJointConf::maxForce {} |
Max force.
The maximum constraint force that can be exerted to move the candidate body. Usually you will express as some multiple of the weight (multiplier * mass * gravity).
Referenced by UseMaxForce().