PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::FrictionJointConf Struct Reference

Friction joint definition. More...

#include <FrictionJointConf.hpp>

Inheritance diagram for playrho::d2::FrictionJointConf:
[legend]
Collaboration diagram for playrho::d2::FrictionJointConf:
[legend]

Public Types

using super = JointBuilder< FrictionJointConf >
 Super type.
 
- Public Types inherited from playrho::d2::JointBuilder< FrictionJointConf >
using value_type = FrictionJointConf
 Value type.
 
using reference = value_type &
 Reference type.
 

Public Member Functions

constexpr FrictionJointConf ()=default
 Default constructor.
 
 FrictionJointConf (BodyID bodyA, BodyID bodyB, Length2 laA=Length2{}, Length2 laB=Length2{}) noexcept
 Initializing constructor. More...
 
constexpr auto & UseMaxForce (NonNegative< Force > v) noexcept
 Uses the given maximum force value.
 
constexpr auto & UseMaxTorque (NonNegative< Torque > v) noexcept
 Uses the given maximum torque value.
 
- Public Member Functions inherited from playrho::d2::JointBuilder< FrictionJointConf >
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.
 
NonNegative< ForcemaxForce {}
 Maximum friction force.
 
NonNegative< TorquemaxTorque {}
 Maximum friction torque.
 
Momentum2 linearImpulse = Momentum2{}
 Linear impulse.
 
AngularMomentum angularImpulse = AngularMomentum{0}
 Angular impulse.
 
Length2 rA = {}
 Relative A.
 
Length2 rB = {}
 Relative B.
 
Mass22 linearMass = {}
 2-by-2 linear mass matrix in kilograms.
 
RotInertia angularMass = {}
 Angular 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...
 

Related Functions

(Note that these are not member functions.)

constexpr Momentum2 GetLinearReaction (const FrictionJointConf &object) noexcept
 Gets the current linear reaction for the given configuration.
 
constexpr AngularMomentum GetAngularReaction (const FrictionJointConf &object) noexcept
 Gets the current angular reaction for the given configuration.
 
constexpr bool ShiftOrigin (FrictionJointConf &, Length2) noexcept
 Shifts the origin notion of the given configuration.
 
void InitVelocity (FrictionJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &conf)
 Initializes velocity constraint data based on the given solver data. More...
 
bool SolveVelocity (FrictionJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step)
 Solves velocity constraint. More...
 
bool SolvePosition (const FrictionJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf)
 Solves the position constraint. More...
 
constexpr auto GetMaxForce (const FrictionJointConf &object) noexcept
 Free function for getting the max force value of the given configuration.
 
constexpr void SetMaxForce (FrictionJointConf &object, NonNegative< Force > value) noexcept
 Free function for setting the max force value of the given configuration.
 
constexpr auto GetMaxTorque (const FrictionJointConf &object) noexcept
 Free function for getting the max torque value of the given configuration.
 
constexpr auto SetMaxTorque (FrictionJointConf &object, NonNegative< Torque > value) noexcept
 Free function for setting the max force value of the given configuration.
 

Detailed Description

Friction joint definition.

This is used for top-down friction. It provides 2-D translational friction and angular friction.

See also
Joint, World::CreateJoint
Examples
FrictionJoint.cpp, and World.cpp.

Constructor & Destructor Documentation

◆ FrictionJointConf()

playrho::d2::FrictionJointConf::FrictionJointConf ( BodyID  bodyA,
BodyID  bodyB,
Length2  laA = Length2{},
Length2  laB = Length2{} 
)
noexcept

Initializing constructor.

Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.

Friends And Related Function Documentation

◆ InitVelocity()

void InitVelocity ( FrictionJointConf object,
std::vector< BodyConstraint > &  bodies,
const StepConf step,
const ConstraintSolverConf conf 
)
related

Initializes velocity constraint data based on the given solver data.

Note
This MUST be called prior to calling SolveVelocity.
See also
SolveVelocity.

◆ SolvePosition()

bool SolvePosition ( const FrictionJointConf object,
std::vector< BodyConstraint > &  bodies,
const ConstraintSolverConf conf 
)
related

Solves the position constraint.

Returns
true if the position errors are within tolerance.

◆ SolveVelocity()

bool SolveVelocity ( FrictionJointConf object,
std::vector< BodyConstraint > &  bodies,
const StepConf step 
)
related

Solves velocity constraint.

Precondition
InitVelocity has been called.
See also
InitVelocity.
Returns
true if velocity is "solved", false otherwise.

The documentation for this struct was generated from the following files: