Jolt Physics
A multi core friendly Game Physics Engine
|
#include <SwingTwistConstraint.h>
Public Member Functions | |
virtual void | SaveBinaryState (StreamOut &inStream) const override |
Saves the contents of the constraint settings in binary form to inStream. More... | |
virtual TwoBodyConstraint * | Create (Body &inBody1, Body &inBody2) const override |
Create an instance of this constraint. More... | |
virtual TwoBodyConstraint * | Create (Body &inBody1, Body &inBody2) const =0 |
virtual void | SaveBinaryState (StreamOut &inStream) const |
Saves the contents of the constraint settings in binary form to inStream. More... | |
Public Member Functions inherited from SerializableObject | |
virtual | ~SerializableObject ()=default |
Constructor. More... | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Public Member Functions inherited from RefTarget< ConstraintSettings > | |
RefTarget ()=default | |
Constructor. More... | |
RefTarget (const RefTarget &) | |
~RefTarget () | |
assert no one is referencing us More... | |
void | SetEmbedded () const |
RefTarget & | operator= (const RefTarget &) |
Assignment operator. More... | |
uint32 | GetRefCount () const |
Get current refcount of this object. More... | |
void | AddRef () const |
Add or release a reference to this object. More... | |
void | Release () const |
Public Attributes | |
EConstraintSpace | mSpace = EConstraintSpace::WorldSpace |
This determines in which space the constraint is setup, all properties below should be in the specified space. More... | |
Body 1 constraint reference frame (space determined by mSpace) | |
RVec3 | mPosition1 = RVec3::sZero() |
Vec3 | mTwistAxis1 = Vec3::sAxisX() |
Vec3 | mPlaneAxis1 = Vec3::sAxisY() |
Body 2 constraint reference frame (space determined by mSpace) | |
RVec3 | mPosition2 = RVec3::sZero() |
Vec3 | mTwistAxis2 = Vec3::sAxisX() |
Vec3 | mPlaneAxis2 = Vec3::sAxisY() |
ESwingType | mSwingType = ESwingType::Cone |
The type of swing constraint that we want to use. More... | |
Swing rotation limits | |
float | mNormalHalfConeAngle = 0.0f |
See image at Detailed Description. Angle in radians. More... | |
float | mPlaneHalfConeAngle = 0.0f |
See image at Detailed Description. Angle in radians. More... | |
Twist rotation limits | |
float | mTwistMinAngle = 0.0f |
See image at Detailed Description. Angle in radians. Should be \(\in [-\pi, \pi]\). More... | |
float | mTwistMaxAngle = 0.0f |
See image at Detailed Description. Angle in radians. Should be \(\in [-\pi, \pi]\). More... | |
Friction | |
float | mMaxFrictionTorque = 0.0f |
Maximum amount of torque (N m) to apply as friction when the constraint is not powered by a motor. More... | |
Public Attributes inherited from ConstraintSettings | |
bool | mEnabled = true |
If this constraint is enabled initially. Use Constraint::SetEnabled to toggle after creation. More... | |
uint32 | mConstraintPriority = 0 |
uint | mNumVelocityStepsOverride = 0 |
Used only when the constraint is active. Override for the number of solver velocity iterations to run, 0 means use the default in PhysicsSettings::mNumVelocitySteps. The number of iterations to use is the max of all contacts and constraints in the island. More... | |
uint | mNumPositionStepsOverride = 0 |
Used only when the constraint is active. Override for the number of solver position iterations to run, 0 means use the default in PhysicsSettings::mNumPositionSteps. The number of iterations to use is the max of all contacts and constraints in the island. More... | |
float | mDrawConstraintSize = 1.0f |
Size of constraint when drawing it through the debug renderer. More... | |
uint64 | mUserData = 0 |
User data value (can be used by application) More... | |
In case the constraint is powered, this determines the motor settings around the swing and twist axis | |
MotorSettings | mSwingMotorSettings |
MotorSettings | mTwistMotorSettings |
virtual void | RestoreBinaryState (StreamIn &inStream) override |
This function should not be called directly, it is used by sRestoreFromBinaryState. More... | |
Additional Inherited Members | |
Public Types inherited from ConstraintSettings | |
using | ConstraintResult = Result< Ref< ConstraintSettings > > |
Static Public Member Functions inherited from ConstraintSettings | |
static ConstraintResult | sRestoreFromBinaryState (StreamIn &inStream) |
Creates a constraint of the correct type and restores its contents from the binary stream inStream. More... | |
Static Public Member Functions inherited from RefTarget< ConstraintSettings > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. More... | |
virtual void | RestoreBinaryState (StreamIn &inStream) |
This function should not be called directly, it is used by sRestoreFromBinaryState. More... | |
Protected Attributes inherited from RefTarget< ConstraintSettings > | |
atomic< uint32 > | mRefCount |
Current reference count. More... | |
Static Protected Attributes inherited from RefTarget< ConstraintSettings > | |
static constexpr uint32 | cEmbedded |
A large value that gets added to the refcount to mark the object as embedded. More... | |
Swing twist constraint settings, used to create a swing twist constraint All values in this structure are copied to the swing twist constraint and the settings object is no longer needed afterwards.
This image describes the limit settings:
|
overridevirtual |
Create an instance of this constraint.
Implements TwoBodyConstraintSettings.
|
overrideprotectedvirtual |
This function should not be called directly, it is used by sRestoreFromBinaryState.
Reimplemented from ConstraintSettings.
|
overridevirtual |
Saves the contents of the constraint settings in binary form to inStream.
Reimplemented from ConstraintSettings.
float SwingTwistConstraintSettings::mMaxFrictionTorque = 0.0f |
Maximum amount of torque (N m) to apply as friction when the constraint is not powered by a motor.
float SwingTwistConstraintSettings::mNormalHalfConeAngle = 0.0f |
See image at Detailed Description. Angle in radians.
Vec3 SwingTwistConstraintSettings::mPlaneAxis1 = Vec3::sAxisY() |
Vec3 SwingTwistConstraintSettings::mPlaneAxis2 = Vec3::sAxisY() |
float SwingTwistConstraintSettings::mPlaneHalfConeAngle = 0.0f |
See image at Detailed Description. Angle in radians.
RVec3 SwingTwistConstraintSettings::mPosition1 = RVec3::sZero() |
RVec3 SwingTwistConstraintSettings::mPosition2 = RVec3::sZero() |
EConstraintSpace SwingTwistConstraintSettings::mSpace = EConstraintSpace::WorldSpace |
This determines in which space the constraint is setup, all properties below should be in the specified space.
MotorSettings SwingTwistConstraintSettings::mSwingMotorSettings |
ESwingType SwingTwistConstraintSettings::mSwingType = ESwingType::Cone |
The type of swing constraint that we want to use.
Vec3 SwingTwistConstraintSettings::mTwistAxis1 = Vec3::sAxisX() |
Vec3 SwingTwistConstraintSettings::mTwistAxis2 = Vec3::sAxisX() |
float SwingTwistConstraintSettings::mTwistMaxAngle = 0.0f |
See image at Detailed Description. Angle in radians. Should be \(\in [-\pi, \pi]\).
float SwingTwistConstraintSettings::mTwistMinAngle = 0.0f |
See image at Detailed Description. Angle in radians. Should be \(\in [-\pi, \pi]\).
MotorSettings SwingTwistConstraintSettings::mTwistMotorSettings |