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.
 
 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.
 
void SetTorqueLimits (float inMin, float inMax)
 Set asymmetric torque limits.
 
void SetForceLimit (float inLimit)
 Set symmetric force limits.
 
void SetTorqueLimit (float inLimit)
 Set symmetric torque limits.
 
bool IsValid () const
 Check if settings are valid.
 
void SaveBinaryState (StreamOut &inStream) const
 Saves the contents of the motor settings in binary form to inStream.
 
void RestoreBinaryState (StreamIn &inStream)
 Restores contents from the binary stream inStream.
 

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).
 
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.
 
float mMaxForceLimit = FLT_MAX
 Maximum force to apply in case of a linear constraint (N). Not used when motor is an angular motor.
 
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.
 
float mMaxTorqueLimit = FLT_MAX
 Maximum torque to apply in case of a angular constraint (N m). Not used when motor is a position motor.
 

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: