playrho::d2::WheelJointConf Struct Reference

Wheel joint definition. More...

#include <WheelJointConf.hpp>

Public Types

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

Public Member Functions

PLAYRHO_CONSTEXPR WheelJointConf () noexcept
 
 WheelJointConf (NonNull< Body * > bodyA, NonNull< Body * > bodyB, const Length2 anchor, const UnitVec axis) noexcept
 
PLAYRHO_CONSTEXPR WheelJointConfUseEnableMotor (bool v) noexcept
 Uses the given enable motor state value. More...
 
PLAYRHO_CONSTEXPR WheelJointConfUseMaxMotorTorque (Torque v) noexcept
 Uses the given max motor toque value. More...
 
PLAYRHO_CONSTEXPR WheelJointConfUseMotorSpeed (AngularVelocity v) noexcept
 Uses the given motor speed value. More...
 
PLAYRHO_CONSTEXPR WheelJointConfUseFrequency (Frequency v) noexcept
 Uses the given frequency value. More...
 
PLAYRHO_CONSTEXPR WheelJointConfUseDampingRatio (Real v) noexcept
 Uses the given damping ratio value. More...
 
- Public Member Functions inherited from playrho::d2::JointBuilder< WheelJointConf >
PLAYRHO_CONSTEXPR JointBuilder (JointType t) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR reference UseBodyA (Body *b) noexcept
 Use value for body A setting. More...
 
PLAYRHO_CONSTEXPR reference UseBodyB (Body *b) noexcept
 Use value for body B setting. More...
 
PLAYRHO_CONSTEXPR reference UseCollideConnected (bool v) noexcept
 Use value for collide connected setting. More...
 
PLAYRHO_CONSTEXPR reference UseUserData (void *v) noexcept
 Use value for user data setting. More...
 
- Public Member Functions inherited from playrho::d2::JointConf
 JointConf ()=delete
 Deleted default constructor for abstract base class. More...
 
PLAYRHO_CONSTEXPR JointConf (JointType t) noexcept
 Initializing constructor. More...
 

Public Attributes

Length2 localAnchorA = Length2{}
 The local anchor point relative to body A's origin. More...
 
Length2 localAnchorB = Length2{}
 The local anchor point relative to body B's origin. More...
 
UnitVec localAxisA = UnitVec::GetRight()
 The local translation axis in body-A. More...
 
bool enableMotor = false
 Enable/disable the joint motor. More...
 
Torque maxMotorTorque = Torque{0}
 The maximum motor torque. More...
 
AngularVelocity motorSpeed = 0_rpm
 The desired angular motor speed. More...
 
Frequency frequency = 2_Hz
 Suspension frequency, zero indicates no suspension. More...
 
Real dampingRatio = 0.7f
 Suspension damping ratio, one indicates critical damping. More...
 
- Public Attributes inherited from playrho::d2::JointConf
JointType type = JointType::Unknown
 Type of the joint is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 1st attached body. More...
 
BodybodyB = nullptr
 2nd attached body. More...
 
bool collideConnected = false
 Collide connected. More...
 
void * userData = nullptr
 User data. More...
 

Additional Inherited Members

Detailed Description

Wheel joint definition.

This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Examples
World.cpp.

Definition at line 41 of file WheelJointConf.hpp.

Member Typedef Documentation

◆ super

Super type.

Definition at line 44 of file WheelJointConf.hpp.

Constructor & Destructor Documentation

◆ WheelJointConf() [1/2]

PLAYRHO_CONSTEXPR playrho::d2::WheelJointConf::WheelJointConf ( )
inlinenoexcept

Definition at line 46 of file WheelJointConf.hpp.

◆ WheelJointConf() [2/2]

playrho::d2::WheelJointConf::WheelJointConf ( NonNull< Body * >  bodyA,
NonNull< Body * >  bodyB,
const Length2  anchor,
const UnitVec  axis 
)
noexcept

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

Definition at line 29 of file WheelJointConf.cpp.

Member Function Documentation

◆ UseEnableMotor()

PLAYRHO_CONSTEXPR WheelJointConf & playrho::d2::WheelJointConf::UseEnableMotor ( bool  v)
inlinenoexcept

Uses the given enable motor state value.

Definition at line 93 of file WheelJointConf.hpp.

◆ UseMaxMotorTorque()

PLAYRHO_CONSTEXPR WheelJointConf & playrho::d2::WheelJointConf::UseMaxMotorTorque ( Torque  v)
inlinenoexcept

Uses the given max motor toque value.

Definition at line 99 of file WheelJointConf.hpp.

◆ UseMotorSpeed()

PLAYRHO_CONSTEXPR WheelJointConf & playrho::d2::WheelJointConf::UseMotorSpeed ( AngularVelocity  v)
inlinenoexcept

Uses the given motor speed value.

Definition at line 105 of file WheelJointConf.hpp.

◆ UseFrequency()

PLAYRHO_CONSTEXPR WheelJointConf & playrho::d2::WheelJointConf::UseFrequency ( Frequency  v)
inlinenoexcept

Uses the given frequency value.

Definition at line 111 of file WheelJointConf.hpp.

◆ UseDampingRatio()

PLAYRHO_CONSTEXPR WheelJointConf & playrho::d2::WheelJointConf::UseDampingRatio ( Real  v)
inlinenoexcept

Uses the given damping ratio value.

Definition at line 117 of file WheelJointConf.hpp.

Member Data Documentation

◆ localAnchorA

Length2 playrho::d2::WheelJointConf::localAnchorA = Length2{}

The local anchor point relative to body A's origin.

Definition at line 69 of file WheelJointConf.hpp.

◆ localAnchorB

Length2 playrho::d2::WheelJointConf::localAnchorB = Length2{}

The local anchor point relative to body B's origin.

Definition at line 72 of file WheelJointConf.hpp.

◆ localAxisA

UnitVec playrho::d2::WheelJointConf::localAxisA = UnitVec::GetRight()

The local translation axis in body-A.

Definition at line 75 of file WheelJointConf.hpp.

◆ enableMotor

bool playrho::d2::WheelJointConf::enableMotor = false

Enable/disable the joint motor.

Definition at line 78 of file WheelJointConf.hpp.

◆ maxMotorTorque

Torque playrho::d2::WheelJointConf::maxMotorTorque = Torque{0}

The maximum motor torque.

Definition at line 81 of file WheelJointConf.hpp.

◆ motorSpeed

AngularVelocity playrho::d2::WheelJointConf::motorSpeed = 0_rpm

The desired angular motor speed.

Definition at line 84 of file WheelJointConf.hpp.

◆ frequency

Frequency playrho::d2::WheelJointConf::frequency = 2_Hz

Suspension frequency, zero indicates no suspension.

Definition at line 87 of file WheelJointConf.hpp.

◆ dampingRatio

Real playrho::d2::WheelJointConf::dampingRatio = 0.7f

Suspension damping ratio, one indicates critical damping.

Definition at line 90 of file WheelJointConf.hpp.


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