Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
MotorSettings Class Reference

#include <MotorSettings.h>

Public Member Functions

 MotorSettings ()=default
 Constructor. More...
 
 MotorSettings (const MotorSettings &)=default
 
MotorSettingsoperator= (const MotorSettings &)=default
 
 MotorSettings (float inFrequency, float inDamping)
 
 MotorSettings (float inFrequency, float inDamping, float inForceLimit, float inTorqueLimit)
 
void SetForceLimits (float inMin, float inMax)
 Set asymmetric force limits. More...
 
void SetTorqueLimits (float inMin, float inMax)
 Set asymmetric torque limits. More...
 
void SetForceLimit (float inLimit)
 Set symmetric force limits. More...
 
void SetTorqueLimit (float inLimit)
 Set symmetric torque limits. More...
 
bool IsValid () const
 Check if settings are valid. More...
 
void SaveBinaryState (StreamOut &inStream) const
 Saves the contents of the motor settings in binary form to inStream. More...
 
void RestoreBinaryState (StreamIn &inStream)
 Restores contents from the binary stream inStream. More...
 

Public Attributes

SpringSettings mSpringSettings { ESpringMode::FrequencyAndDamping, 2.0f, 1.0f }
 Settings for the spring that is used to drive to the position target (not used when motor is a velocity motor). More...
 
float mMinForceLimit = -FLT_MAX
 Minimum force to apply in case of a linear constraint (N). Usually this is -mMaxForceLimit unless you want a motor that can e.g. push but not pull. Not used when motor is an angular motor. More...
 
float mMaxForceLimit = FLT_MAX
 Maximum force to apply in case of a linear constraint (N). Not used when motor is an angular motor. More...
 
float mMinTorqueLimit = -FLT_MAX
 Minimum torque to apply in case of a angular constraint (N m). Usually this is -mMaxTorqueLimit unless you want a motor that can e.g. push but not pull. Not used when motor is a position motor. More...
 
float mMaxTorqueLimit = FLT_MAX
 Maximum torque to apply in case of a angular constraint (N m). Not used when motor is a position motor. More...
 

Detailed Description

Class that contains the settings for a constraint motor. See the main page of the API documentation for more information on how to configure a motor.

Constructor & Destructor Documentation

◆ MotorSettings() [1/4]

MotorSettings::MotorSettings ( )
default

Constructor.

◆ MotorSettings() [2/4]

MotorSettings::MotorSettings ( const MotorSettings )
default

◆ MotorSettings() [3/4]

MotorSettings::MotorSettings ( float  inFrequency,
float  inDamping 
)
inline

◆ MotorSettings() [4/4]

MotorSettings::MotorSettings ( float  inFrequency,
float  inDamping,
float  inForceLimit,
float  inTorqueLimit 
)
inline

Member Function Documentation

◆ IsValid()

bool MotorSettings::IsValid ( ) const
inline

Check if settings are valid.

◆ operator=()

MotorSettings & MotorSettings::operator= ( const MotorSettings )
default

◆ RestoreBinaryState()

void MotorSettings::RestoreBinaryState ( StreamIn inStream)

Restores contents from the binary stream inStream.

◆ SaveBinaryState()

void MotorSettings::SaveBinaryState ( StreamOut inStream) const

Saves the contents of the motor settings in binary form to inStream.

◆ SetForceLimit()

void MotorSettings::SetForceLimit ( float  inLimit)
inline

Set symmetric force limits.

◆ SetForceLimits()

void MotorSettings::SetForceLimits ( float  inMin,
float  inMax 
)
inline

Set asymmetric force limits.

◆ SetTorqueLimit()

void MotorSettings::SetTorqueLimit ( float  inLimit)
inline

Set symmetric torque limits.

◆ SetTorqueLimits()

void MotorSettings::SetTorqueLimits ( float  inMin,
float  inMax 
)
inline

Set asymmetric torque limits.

Member Data Documentation

◆ mMaxForceLimit

float MotorSettings::mMaxForceLimit = FLT_MAX

Maximum force to apply in case of a linear constraint (N). Not used when motor is an angular motor.

◆ mMaxTorqueLimit

float MotorSettings::mMaxTorqueLimit = FLT_MAX

Maximum torque to apply in case of a angular constraint (N m). Not used when motor is a position motor.

◆ mMinForceLimit

float MotorSettings::mMinForceLimit = -FLT_MAX

Minimum force to apply in case of a linear constraint (N). Usually this is -mMaxForceLimit unless you want a motor that can e.g. push but not pull. Not used when motor is an angular motor.

◆ mMinTorqueLimit

float MotorSettings::mMinTorqueLimit = -FLT_MAX

Minimum torque to apply in case of a angular constraint (N m). Usually this is -mMaxTorqueLimit unless you want a motor that can e.g. push but not pull. Not used when motor is a position motor.

◆ mSpringSettings

SpringSettings MotorSettings::mSpringSettings { ESpringMode::FrequencyAndDamping, 2.0f, 1.0f }

Settings for the spring that is used to drive to the position target (not used when motor is a velocity motor).


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