Rope joint definition.
More...
#include <playrho/d2/RopeJointConf.hpp>
|
(Note that these are not member functions.)
|
constexpr AngularMomentum | GetAngularReaction (const RopeJointConf &) noexcept |
| Gets the current angular reaction of the given configuration.
|
|
constexpr Momentum2 | GetLinearReaction (const RopeJointConf &object) noexcept |
| Gets the current linear reaction of the given configuration.
|
|
constexpr auto | GetMaxLength (const RopeJointConf &object) noexcept |
| Free function for getting the maximum length value of the given configuration.
|
|
void | InitVelocity (RopeJointConf &object, const Span< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf) |
| Initializes velocity constraint data based on the given solver data. More...
|
|
constexpr auto | SetMaxLength (RopeJointConf &object, Length value) noexcept |
| Free function for setting the maximum length value of the given configuration.
|
|
constexpr auto | ShiftOrigin (RopeJointConf &, const Length2 &) noexcept |
| Shifts the origin notion of the given configuration.
|
|
bool | SolvePosition (const RopeJointConf &object, const Span< BodyConstraint > &bodies, const ConstraintSolverConf &conf) |
| Solves the position constraint. More...
|
|
bool | SolveVelocity (RopeJointConf &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.
|
|
Rope joint definition.
A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. This requires two body anchor points and a maximum lengths.
- Note
- By default the connected objects will not collide.
- Warning
- If you attempt to change the maximum length during the simulation you will get some non-physical behavior. A model that would allow you to dynamically modify the length would have some sponginess, so it was decided not to implement it that way. See
DistanceJoint
if you want to dynamically control length.
- See also
- collideConnected in JointConf.
-
Joint, World::CreateJoint
◆ 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.
The documentation for this struct was generated from the following file: