Weld joint definition.
More...
#include <playrho/d2/WeldJointConf.hpp>
|
(Note that these are not member functions.)
|
|
constexpr AngularMomentum | GetAngularReaction (const WeldJointConf &object) noexcept |
| | Gets the current angular reaction of the given configuration.
|
| |
|
constexpr Momentum2 | GetLinearReaction (const WeldJointConf &object) noexcept |
| | Gets the current linear reaction of the given configuration.
|
| |
| void | InitVelocity (WeldJointConf &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 (WeldJointConf &object, Real value) noexcept |
| | Free function for setting the damping ratio of the given configuration.
|
| |
|
constexpr void | SetFrequency (WeldJointConf &object, NonNegative< Frequency > value) noexcept |
| | Free function for setting the frequency of the given configuration.
|
| |
|
constexpr auto | ShiftOrigin (WeldJointConf &, const Length2 &) noexcept |
| | Shifts the origin notion of the given configuration.
|
| |
| bool | SolvePosition (const WeldJointConf &object, const Span< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
| | Solves the position constraint. More...
|
| |
| bool | SolveVelocity (WeldJointConf &object, const Span< BodyConstraint > &bodies, const StepConf &step) |
| | Solves velocity constraint. More...
|
| |
|
void | Set (JointConf &def, const Joint &joint) noexcept |
| | Sets the joint definition data for the given joint.
|
| |
Weld joint definition.
- Note
- A weld joint essentially glues two bodies together. A weld joint may distort somewhat because the island constraint solver is approximate.
-
You need to specify local anchor points where they are attached and the relative body angle.
-
The position of the anchor points is important for computing the reaction torque.
- See also
- Joint, World::CreateJoint
◆ WeldJointConf()
Initializing constructor.
Initializes the bodies, anchors, and reference angle using a world anchor point.
- Parameters
-
| bA | Identifier of body A. |
| bB | Identifier of body B. |
| laA | Local anchor A location in world coordinates. |
| laB | Local anchor B location in world coordinates. |
| ra | Reference angle. |
- Postcondition
bodyA will have the value of bA.
-
bodyB will have the value of bB.
-
localAnchorA will have the value of laA.
-
localAnchorB will have the value of laB.
-
referenceAngle will have the value of ra.
◆ InitVelocity()
Initializes velocity constraint data based on the given solver data.
- Note
- This MUST be called prior to calling
SolveVelocity.
- Parameters
-
| 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. |
- Exceptions
-
| 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. |
- See also
- SolveVelocity.
◆ SolvePosition()
Solves the position constraint.
- Parameters
-
| 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. |
- Exceptions
-
| 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. |
- Returns
true if the position errors are within tolerance.
◆ SolveVelocity()
Solves velocity constraint.
- Precondition
InitVelocity has been called.
- Parameters
-
| 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. |
- Exceptions
-
| 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. |
- See also
- InitVelocity.
- Returns
true if velocity is "solved", false otherwise.
◆ dampingRatio
| Real playrho::d2::WeldJointConf::dampingRatio = 0 |
Damping ratio.
- Note
- 0 = no damping, 1 = critical damping.
Referenced by UseDampingRatio().
◆ frequency
Mass-spring-damper frequency.
- Note
- Rotation only.
-
Disable softness with a value of 0.
Referenced by UseFrequency().
The documentation for this struct was generated from the following files:
- Library/include/playrho/d2/WeldJointConf.hpp
- Library/source/playrho/d2/WeldJointConf.cpp