UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FConstraintInstance Struct Reference

#include <ConstraintInstance.h>

+ Inheritance diagram for FConstraintInstance:

Public Member Functions

ENGINE_API void CopyProfilePropertiesFrom (const FConstraintProfileProperties &FromProperties)
 
ENGINE_API const FPhysicsConstraintHandleGetPhysicsConstraintRef () const
 
UE_INTERNAL void SerializeState (Chaos::FSerializedDataBuffer &OutSerializedState, Chaos::ESerializedDataContext DataContext)
 
UE_INTERNAL void ApplySerializedState (Chaos::FSerializedDataBufferPtr &&InSerializedState, Chaos::ESerializedDataContext DataContext)
 
ENGINE_API FConstraintInstance ()
 
const FNameGetChildBoneName () const
 
const FNameGetParentBoneName () const
 
float GetLinearLimit () const
 
void SetLinearLimits (ELinearConstraintMotion XConstraintType, ELinearConstraintMotion YConstraintType, ELinearConstraintMotion ZConstraintType, float InLinearLimitSize)
 
ELinearConstraintMotion GetLinearXMotion () const
 
void SetLinearXMotion (ELinearConstraintMotion XConstraintType)
 
void SetLinearXLimit (ELinearConstraintMotion XConstraintType, float InLinearLimitSize)
 
ELinearConstraintMotion GetLinearYMotion () const
 
void SetLinearYMotion (ELinearConstraintMotion YConstraintType)
 
void SetLinearYLimit (ELinearConstraintMotion YConstraintType, float InLinearLimitSize)
 
ELinearConstraintMotion GetLinearZMotion () const
 
void SetLinearZMotion (ELinearConstraintMotion ZConstraintType)
 
void SetLinearZLimit (ELinearConstraintMotion ZConstraintType, float InLinearLimitSize)
 
EAngularConstraintMotion GetAngularSwing1Motion () const
 
void SetAngularSwing1Motion (EAngularConstraintMotion MotionType)
 
ENGINE_API float GetCurrentSwing1 () const
 
float GetAngularSwing1Limit () const
 
void SetAngularSwing1Limit (EAngularConstraintMotion MotionType, float InSwing1LimitAngle)
 
EAngularConstraintMotion GetAngularSwing2Motion () const
 
void SetAngularSwing2Motion (EAngularConstraintMotion MotionType)
 
ENGINE_API float GetCurrentSwing2 () const
 
float GetAngularSwing2Limit () const
 
void SetAngularSwing2Limit (EAngularConstraintMotion MotionType, float InSwing2LimitAngle)
 
EAngularConstraintMotion GetAngularTwistMotion () const
 
void SetAngularTwistMotion (EAngularConstraintMotion MotionType)
 
ENGINE_API float GetCurrentTwist () const
 
float GetAngularTwistLimit () const
 
void SetAngularTwistLimit (EAngularConstraintMotion MotionType, float InTwistLimitAngle)
 
bool GetIsSoftLinearLimit () const
 
float GetSoftLinearLimitStiffness () const
 
float GetSoftLinearLimitDamping () const
 
float GetSoftLinearLimitRestitution () const
 
float GetSoftLinearLimitContactDistance () const
 
void SetSoftLinearLimitParams (bool bIsSoftLimit, float Stiffness, float Damping, float Restitution, float ContactDistance)
 
bool GetIsSoftTwistLimit () const
 
float GetSoftTwistLimitStiffness () const
 
float GetSoftTwistLimitDamping () const
 
float GetSoftTwistLimitRestitution () const
 
float GetSoftTwistLimitContactDistance () const
 
void SetSoftTwistLimitParams (bool bIsSoftLimit, float Stiffness, float Damping, float Restitution, float ContactDistance)
 
bool GetIsSoftSwingLimit () const
 
float GetSoftSwingLimitStiffness () const
 
float GetSoftSwingLimitDamping () const
 
float GetSoftSwingLimitRestitution () const
 
float GetSoftSwingLimitContactDistance () const
 
void SetSoftSwingLimitParams (bool bIsSoftLimit, float Stiffness, float Damping, float Restitution, float ContactDistance)
 
void SetLinearBreakable (bool bInLinearBreakable, float InLinearBreakThreshold)
 
bool IsLinearBreakable () const
 
float GetLinearBreakThreshold () const
 
void SetLinearPlasticity (bool bInLinearPlasticity, float InLinearPlasticityThreshold, EConstraintPlasticityType InLinearPlasticityType)
 
bool HasLinearPlasticity () const
 
float GetLinearPlasticityThreshold () const
 
TEnumAsByte< enum EConstraintPlasticityTypeGetLinearPlasticityType () const
 
void SetContactTransferScale (float InContactTransferScale)
 
float GetContactTransferScale () const
 
void SetAngularBreakable (bool bInAngularBreakable, float InAngularBreakThreshold)
 
bool IsAngularBreakable () const
 
float GetAngularBreakThreshold () const
 
void SetAngularPlasticity (bool bInAngularPlasticity, float InAngularPlasticityThreshold)
 
bool HasAngularPlasticity () const
 
float GetAngularPlasticityThreshold () const
 
ENGINE_API void CopyConstraintGeometryFrom (const FConstraintInstance *FromInstance)
 
ENGINE_API void CopyConstraintParamsFrom (const FConstraintInstance *FromInstance)
 
ENGINE_API void CopyConstraintPhysicalPropertiesFrom (const FConstraintInstance *FromInstance, bool bKeepPosition, bool bKeepRotation)
 
ENGINE_API void GetConstraintForce (FVector &OutLinearForce, FVector &OutAngularForce)
 
ENGINE_API bool IsBroken ()
 
ENGINE_API void SetLinearPositionDrive (bool bEnableXDrive, bool bEnableYDrive, bool bEnableZDrive)
 
bool IsLinearPositionDriveXEnabled () const
 
bool IsLinearPositionDriveYEnabled () const
 
bool IsLinearPositionDriveZEnabled () const
 
bool IsLinearPositionDriveEnabled () const
 
ENGINE_API void SetLinearPositionTarget (const FVector &InPosTarget)
 
const FVectorGetLinearPositionTarget ()
 
ENGINE_API void SetLinearVelocityDrive (bool bEnableXDrive, bool bEnableYDrive, bool bEnableZDrive)
 
bool IsLinearVelocityDriveXEnabled () const
 
bool IsLinearVelocityDriveYEnabled () const
 
bool IsLinearVelocityDriveZEnabled () const
 
bool IsLinearVelocityDriveEnabled () const
 
ENGINE_API void SetLinearVelocityTarget (const FVector &InVelTarget)
 
const FVectorGetLinearVelocityTarget ()
 
ENGINE_API void SetLinearDriveParams (float InPositionStrength, float InVelocityStrength, float InForceLimit)
 
ENGINE_API void SetLinearDriveParams (const FVector &InPositionStrength, const FVector &InVelocityStrength, const FVector &InForceLimit)
 
ENGINE_API void SetLinearDriveAccelerationMode (bool bAccelerationMode)
 
ENGINE_API void GetLinearDriveParams (float &OutPositionStrength, float &OutVelocityStrength, float &OutForceLimit)
 
ENGINE_API void GetLinearDriveParams (FVector &OutPositionStrength, FVector &OutVelocityStrength, FVector &OutForceLimit)
 
ENGINE_API void SetOrientationDriveTwistAndSwing (bool bInEnableTwistDrive, bool bInEnableSwingDrive)
 
ENGINE_API void GetOrientationDriveTwistAndSwing (bool &bOutEnableTwistDrive, bool &bOutEnableSwingDrive)
 
ENGINE_API void SetOrientationDriveSLERP (bool bInEnableSLERP)
 
bool GetOrientationDriveSLERP ()
 
bool IsAngularOrientationDriveEnabled () const
 
ENGINE_API void SetAngularOrientationTarget (const FQuat &InPosTarget)
 
const FRotatorGetAngularOrientationTarget () const
 
ENGINE_API void SetAngularVelocityDriveTwistAndSwing (bool bInEnableTwistDrive, bool bInEnableSwingDrive)
 
ENGINE_API void GetAngularVelocityDriveTwistAndSwing (bool &bOutEnableTwistDrive, bool &bOutEnableSwingDrive)
 
ENGINE_API void SetAngularVelocityDriveSLERP (bool bInEnableSLERP)
 
bool GetAngularVelocityDriveSLERP ()
 
bool IsAngularVelocityDriveEnabled () const
 
ENGINE_API void SetAngularVelocityTarget (const FVector &InVelTarget)
 
const FVectorGetAngularVelocityTarget () const
 
ENGINE_API void SetAngularDriveParams (float InSpring, float InDamping, float InForceLimit)
 
ENGINE_API void GetAngularDriveParams (float &OutSpring, float &OutDamping, float &OutForceLimit) const
 
ENGINE_API void SetAngularDriveMode (EAngularDriveMode::Type DriveMode)
 
ENGINE_API void SetAngularDriveAccelerationMode (bool bAccelerationMode)
 
EAngularDriveMode::Type GetAngularDriveMode ()
 
ENGINE_API void SetDriveParams (const FVector &InPositionStrength, const FVector &InVelocityStrength, const FVector &InForceLimit, const FVector &InAngularSpring, const FVector &InAngularDamping, const FVector &InTorqueLimit, EAngularDriveMode::Type InAngularDriveMode)
 
ENGINE_API void UpdateLinearLimit ()
 
ENGINE_API void UpdateAngularLimit ()
 
ENGINE_API void SetAngularDOFLimitScale (float InSwing1LimitScale, float InSwing2LimitScale, float InTwistLimitScale)
 
ENGINE_API void SetLinearLimitSize (float NewLimitSize)
 
ENGINE_API void InitConstraint (FBodyInstance *Body1, FBodyInstance *Body2, float Scale, UObject *DebugOwner, FOnConstraintBroken InConstraintBrokenDelegate=FOnConstraintBroken(), FOnPlasticDeformation InPlasticDeformationDelegate=FOnPlasticDeformation())
 
ENGINE_API void InitConstraint (Chaos::FPhysicsObject *Body1, Chaos::FPhysicsObject *Body2, float Scale, UObject *DebugOwner, FOnConstraintBroken InConstraintBrokenDelegate=FOnConstraintBroken(), FOnPlasticDeformation InPlasticDeformationDelegate=FOnPlasticDeformation())
 
ENGINE_API void InitConstraint_AssumesLocked (const FPhysicsActorHandle &ActorRef1, const FPhysicsActorHandle &ActorRef2, float InScale, FOnConstraintBroken InConstraintBrokenDelegate=FOnConstraintBroken(), FOnPlasticDeformation InPlasticDeformationDelegate=FOnPlasticDeformation())
 
ENGINE_API void InitConstraint_AssumesLocked (Chaos::FPhysicsObject *Body1, Chaos::FPhysicsObject *Body2, float InScale, FOnConstraintBroken InConstraintBrokenDelegate=FOnConstraintBroken(), FOnPlasticDeformation InPlasticDeformationDelegate=FOnPlasticDeformation())
 
ENGINE_API void TermConstraint ()
 
ENGINE_API bool IsTerminated () const
 
ENGINE_API bool IsValidConstraintInstance () const
 
ENGINE_API FTransform GetRefFrame (EConstraintFrame::Type Frame) const
 
ENGINE_API void SetRefFrame (EConstraintFrame::Type Frame, const FTransform &RefFrame)
 
ENGINE_API FVector GetConstraintLocation ()
 
ENGINE_API void SetRefPosition (EConstraintFrame::Type Frame, const FVector &RefPosition)
 
ENGINE_API void SetRefOrientation (EConstraintFrame::Type Frame, const FVector &PriAxis, const FVector &SecAxis)
 
bool IsCollisionDisabled () const
 
ENGINE_API void SetDisableCollision (bool InDisableCollision)
 
void DrawConstraint (int32 ViewIndex, class FMeshElementCollector &Collector, float Scale, float LimitDrawScale, bool bDrawLimits, bool bDrawSelected, const FTransform &Con1Frame, const FTransform &Con2Frame, bool bDrawAsPoint, bool bDrawViolatedLimits) const
 
void DrawConstraint (FPrimitiveDrawInterface *PDI, float Scale, float LimitDrawScale, bool bDrawLimits, bool bDrawSelected, const FTransform &Con1Frame, const FTransform &Con2Frame, bool bDrawAsPoint, bool bDrawViolatedLimits) const
 
ENGINE_API void GetUsedMaterials (TArray< UMaterialInterface * > &Materials)
 
ENGINE_API bool Serialize (FArchive &Ar)
 
bool IsProjectionEnabled () const
 
ENGINE_API void EnableProjection ()
 
ENGINE_API void DisableProjection ()
 
ENGINE_API void SetProjectionParams (bool bEnableProjection, float ProjectionLinearAlpha, float ProjectionAngularAlpha, float ProjectionLinearTolerance, float ProjectionAngularTolerance)
 
ENGINE_API void GetProjectionParams (float &ProjectionLinearAlpha, float &ProjectionAngularAlpha, float &ProjectionLinearTolerance, float &ProjectionAngularTolerance) const
 
ENGINE_API void SetShockPropagationParams (bool bEnableShockPropagation, float ShockPropagationAlpha)
 
ENGINE_API float GetShockPropagationAlpha () const
 
bool IsParentDominatesEnabled () const
 
ENGINE_API void EnableParentDominates ()
 
ENGINE_API void DisableParentDominates ()
 
ENGINE_API void SetParentDominates (bool bParentDominates)
 
bool IsMassConditioningEnabled () const
 
ENGINE_API void EnableMassConditioning ()
 
ENGINE_API void DisableMassConditioning ()
 
float GetLastKnownScale () const
 
- Public Member Functions inherited from FConstraintInstanceBase
ENGINE_API FConstraintInstanceBase ()
 
ENGINE_API void Reset ()
 
FPhysSceneGetPhysicsScene ()
 
const FPhysSceneGetPhysicsScene () const
 
ENGINE_API void SetConstraintBrokenDelegate (FOnConstraintBroken InConstraintBrokenDelegate)
 
ENGINE_API void SetConstraintViolatedDelegate (FOnConstraintViolated InConstraintViolatedDelegate)
 
ENGINE_API void SetPlasticDeformationDelegate (FOnPlasticDeformation InPlasticDeformationDelegate)
 

Static Public Member Functions

static ENGINE_API void Free (FConstraintInstance *Ptr)
 
static ENGINE_API FConstraintInstanceAlloc ()
 

Public Attributes

FName JointName
 
FName ConstraintBone1
 
FName ConstraintBone2
 
FVector Pos1
 
FVector PriAxis1
 
FVector SecAxis1
 
FVector Pos2
 
FVector PriAxis2
 
FVector SecAxis2
 
FRotator AngularRotationOffset
 
uint32 bScaleLinearLimits: 1
 
float AverageMass
 
FConstraintProfileProperties ProfileInstance
 
FChaosUserData UserData
 
- Public Attributes inherited from FConstraintInstanceBase
int32 ConstraintIndex
 
FPhysicsConstraintHandle ConstraintHandle
 
FPhysScenePhysScene
 

Additional Inherited Members

- Protected Attributes inherited from FConstraintInstanceBase
FOnConstraintBroken OnConstraintBrokenDelegate
 
FOnConstraintViolated OnConstraintViolatedDelegate
 
FOnPlasticDeformation OnPlasticDeformationDelegate
 

Detailed Description

Container for a physics representation of an object.

Constructor & Destructor Documentation

◆ FConstraintInstance()

FConstraintInstance::FConstraintInstance ( )

Constructor

Member Function Documentation

◆ Alloc()

FConstraintInstance * FConstraintInstance::Alloc ( )
static

◆ ApplySerializedState()

void FConstraintInstance::ApplySerializedState ( Chaos::FSerializedDataBufferPtr &&  InSerializedState,
Chaos::ESerializedDataContext  DataContext 
)

Deserializes the provided array of bytes representing a saved physics thread state and applies it to this constraint

◆ CopyConstraintGeometryFrom()

void FConstraintInstance::CopyConstraintGeometryFrom ( const FConstraintInstance FromInstance)

◆ CopyConstraintParamsFrom()

void FConstraintInstance::CopyConstraintParamsFrom ( const FConstraintInstance FromInstance)

◆ CopyConstraintPhysicalPropertiesFrom()

void FConstraintInstance::CopyConstraintPhysicalPropertiesFrom ( const FConstraintInstance FromInstance,
bool  bKeepPosition,
bool  bKeepRotation 
)

Copies non-identifying properties from another constraint instance

◆ CopyProfilePropertiesFrom()

void FConstraintInstance::CopyProfilePropertiesFrom ( const FConstraintProfileProperties FromProperties)

Copies behavior properties from the given profile. Automatically updates the physx representation if it's been created

◆ DisableMassConditioning()

void FConstraintInstance::DisableMassConditioning ( )

Disable maxx conditioning.

See also
FConstraintProfileProperties::bEnableMassConditioning

◆ DisableParentDominates()

void FConstraintInstance::DisableParentDominates ( )

◆ DisableProjection()

void FConstraintInstance::DisableProjection ( )

Turn off linear and angular projection

◆ DrawConstraint() [1/2]

void FConstraintInstance::DrawConstraint ( FPrimitiveDrawInterface PDI,
float  Scale,
float  LimitDrawScale,
bool  bDrawLimits,
bool  bDrawSelected,
const FTransform Con1Frame,
const FTransform Con2Frame,
bool  bDrawAsPoint,
bool  bDrawViolatedLimits 
) const
inline

◆ DrawConstraint() [2/2]

void FConstraintInstance::DrawConstraint ( int32  ViewIndex,
class FMeshElementCollector Collector,
float  Scale,
float  LimitDrawScale,
bool  bDrawLimits,
bool  bDrawSelected,
const FTransform Con1Frame,
const FTransform Con2Frame,
bool  bDrawAsPoint,
bool  bDrawViolatedLimits 
) const
inline

◆ EnableMassConditioning()

void FConstraintInstance::EnableMassConditioning ( )

Enable maxx conditioning.

See also
FConstraintProfileProperties::bEnableMassConditioning

◆ EnableParentDominates()

void FConstraintInstance::EnableParentDominates ( )

Enable/Disable parent dominates (meaning the parent body cannot be be affected at all by a child)

◆ EnableProjection()

void FConstraintInstance::EnableProjection ( )

Turn on linear and angular projection

◆ Free()

void FConstraintInstance::Free ( FConstraintInstance Ptr)
static

◆ GetAngularBreakThreshold()

float FConstraintInstance::GetAngularBreakThreshold ( ) const
inline

Gets Torque needed to break the joint

◆ GetAngularDriveMode()

EAngularDriveMode::Type FConstraintInstance::GetAngularDriveMode ( )
inline

Set the angular drive mode

◆ GetAngularDriveParams()

void FConstraintInstance::GetAngularDriveParams ( float OutSpring,
float OutDamping,
float OutForceLimit 
) const

Get the angular drive's strength parameters

◆ GetAngularOrientationTarget()

const FRotator & FConstraintInstance::GetAngularOrientationTarget ( ) const
inline

Get the angular drive's orientation target

◆ GetAngularPlasticityThreshold()

float FConstraintInstance::GetAngularPlasticityThreshold ( ) const
inline

Gets Delta from target needed to reset the target joint

◆ GetAngularSwing1Limit()

float FConstraintInstance::GetAngularSwing1Limit ( ) const
inline

Gets the cone limit swing1 angle in degrees

◆ GetAngularSwing1Motion()

EAngularConstraintMotion FConstraintInstance::GetAngularSwing1Motion ( ) const
inline

Gets the motion type for the swing1 of the cone constraint

◆ GetAngularSwing2Limit()

float FConstraintInstance::GetAngularSwing2Limit ( ) const
inline

Gets the cone limit swing2 angle in degrees

◆ GetAngularSwing2Motion()

EAngularConstraintMotion FConstraintInstance::GetAngularSwing2Motion ( ) const
inline

Gets the motion type for the swing2 of the cone constraint

◆ GetAngularTwistLimit()

float FConstraintInstance::GetAngularTwistLimit ( ) const
inline

Gets the twist limit angle in degrees

◆ GetAngularTwistMotion()

EAngularConstraintMotion FConstraintInstance::GetAngularTwistMotion ( ) const
inline

Gets the motion type for the twist of the cone constraint

◆ GetAngularVelocityDriveSLERP()

bool FConstraintInstance::GetAngularVelocityDriveSLERP ( )
inline

Get whether the SLERP angular velocity drive is enabled. Only applicable when SLERP drive mode is used

◆ GetAngularVelocityDriveTwistAndSwing()

void FConstraintInstance::GetAngularVelocityDriveTwistAndSwing ( bool bOutEnableTwistDrive,
bool bOutEnableSwingDrive 
)

Get which twist and swing angular velocity drives are enabled. Only applicable when Twist And Swing drive mode is used

◆ GetAngularVelocityTarget()

const FVector & FConstraintInstance::GetAngularVelocityTarget ( ) const
inline

Get the angular drive's angular velocity target

◆ GetChildBoneName()

const FName & FConstraintInstance::GetChildBoneName ( ) const
inline

Get the child bone name

◆ GetConstraintForce()

void FConstraintInstance::GetConstraintForce ( FVector OutLinearForce,
FVector OutAngularForce 
)

◆ GetConstraintLocation()

FVector FConstraintInstance::GetConstraintLocation ( )

Get the position of this constraint in world space.

◆ GetContactTransferScale()

float FConstraintInstance::GetContactTransferScale ( ) const
inline

Get the Contact Transfer Scale for the parent of the joint

◆ GetCurrentSwing1()

float FConstraintInstance::GetCurrentSwing1 ( ) const

◆ GetCurrentSwing2()

float FConstraintInstance::GetCurrentSwing2 ( ) const

◆ GetCurrentTwist()

float FConstraintInstance::GetCurrentTwist ( ) const

◆ GetIsSoftLinearLimit()

bool FConstraintInstance::GetIsSoftLinearLimit ( ) const
inline

Whether the linear limits are soft (only if at least one axis if Limited)

◆ GetIsSoftSwingLimit()

bool FConstraintInstance::GetIsSoftSwingLimit ( ) const
inline

Whether the swing limits are soft (only available if swing1 and/or swing2 is Limited)

◆ GetIsSoftTwistLimit()

bool FConstraintInstance::GetIsSoftTwistLimit ( ) const
inline

Whether the twist limits are soft (only available if twist is Limited)

◆ GetLastKnownScale()

float FConstraintInstance::GetLastKnownScale ( ) const
inline

◆ GetLinearBreakThreshold()

float FConstraintInstance::GetLinearBreakThreshold ( ) const
inline

Gets linear force needed to break the joint

◆ GetLinearDriveParams() [1/2]

void FConstraintInstance::GetLinearDriveParams ( float OutPositionStrength,
float OutVelocityStrength,
float OutForceLimit 
)

Get the linear drive's strength parameters. Assumes all axes are the same so only returns the X values

Get the linear drive's strength parameters

◆ GetLinearDriveParams() [2/2]

void FConstraintInstance::GetLinearDriveParams ( FVector OutPositionStrength,
FVector OutVelocityStrength,
FVector OutForceLimit 
)

Get the linear drive's strength parameters.

Get the linear drive's strength parameters

◆ GetLinearLimit()

float FConstraintInstance::GetLinearLimit ( ) const
inline

Gets the linear limit size

◆ GetLinearPlasticityThreshold()

float FConstraintInstance::GetLinearPlasticityThreshold ( ) const
inline

Gets Delta from target needed to reset the target joint

◆ GetLinearPlasticityType()

TEnumAsByte< enum EConstraintPlasticityType > FConstraintInstance::GetLinearPlasticityType ( ) const
inline

Gets Plasticity Type from joint

◆ GetLinearPositionTarget()

const FVector & FConstraintInstance::GetLinearPositionTarget ( )
inline

Get the linear drive's target position position

◆ GetLinearVelocityTarget()

const FVector & FConstraintInstance::GetLinearVelocityTarget ( )
inline

Get the linear drive's target velocity

◆ GetLinearXMotion()

ELinearConstraintMotion FConstraintInstance::GetLinearXMotion ( ) const
inline

Gets the motion type for the linear X-axis limit.

◆ GetLinearYMotion()

ELinearConstraintMotion FConstraintInstance::GetLinearYMotion ( ) const
inline

Gets the motion type for the linear Y-axis limit.

◆ GetLinearZMotion()

ELinearConstraintMotion FConstraintInstance::GetLinearZMotion ( ) const
inline

Gets the motion type for the linear Z-axis limit.

◆ GetOrientationDriveSLERP()

bool FConstraintInstance::GetOrientationDriveSLERP ( )
inline

Get whether the SLERP angular position drive is enabled. Only applicable when SLERP drive mode is used

◆ GetOrientationDriveTwistAndSwing()

void FConstraintInstance::GetOrientationDriveTwistAndSwing ( bool bOutEnableTwistDrive,
bool bOutEnableSwingDrive 
)

Get which twist and swing orientation drives are enabled. Only applicable when Twist And Swing drive mode is used

◆ GetParentBoneName()

const FName & FConstraintInstance::GetParentBoneName ( ) const
inline

Get the parent bone name

◆ GetPhysicsConstraintRef()

const FPhysicsConstraintHandle & FConstraintInstance::GetPhysicsConstraintRef ( ) const

Get underlying physics engine constraint

◆ GetProjectionParams()

void FConstraintInstance::GetProjectionParams ( float ProjectionLinearAlpha,
float ProjectionAngularAlpha,
float ProjectionLinearTolerance,
float ProjectionAngularTolerance 
) const

Get projection parameters

◆ GetRefFrame()

FTransform FConstraintInstance::GetRefFrame ( EConstraintFrame::Type  Frame) const

◆ GetShockPropagationAlpha()

float FConstraintInstance::GetShockPropagationAlpha ( ) const

Get the shock propagation amount [0, 1]

◆ GetSoftLinearLimitContactDistance()

float FConstraintInstance::GetSoftLinearLimitContactDistance ( ) const
inline

Linear contact distance if the constraint is set to use soft linear limits

◆ GetSoftLinearLimitDamping()

float FConstraintInstance::GetSoftLinearLimitDamping ( ) const
inline

Linear damping if the constraint is set to use soft linear limits

◆ GetSoftLinearLimitRestitution()

float FConstraintInstance::GetSoftLinearLimitRestitution ( ) const
inline

Linear restitution if the constraint is set to use soft linear limits

◆ GetSoftLinearLimitStiffness()

float FConstraintInstance::GetSoftLinearLimitStiffness ( ) const
inline

Linear stiffness if the constraint is set to use soft linear limits

◆ GetSoftSwingLimitContactDistance()

float FConstraintInstance::GetSoftSwingLimitContactDistance ( ) const
inline

Swing Contact distance if the constraint is set to use soft limits

◆ GetSoftSwingLimitDamping()

float FConstraintInstance::GetSoftSwingLimitDamping ( ) const
inline

Swing damping if the constraint is set to use soft limits

◆ GetSoftSwingLimitRestitution()

float FConstraintInstance::GetSoftSwingLimitRestitution ( ) const
inline

Swing restitution if the constraint is set to use soft limits

◆ GetSoftSwingLimitStiffness()

float FConstraintInstance::GetSoftSwingLimitStiffness ( ) const
inline

Swing stiffness if the constraint is set to use soft limits

◆ GetSoftTwistLimitContactDistance()

float FConstraintInstance::GetSoftTwistLimitContactDistance ( ) const
inline

Twist contact distance if the constraint is set to use soft limits

◆ GetSoftTwistLimitDamping()

float FConstraintInstance::GetSoftTwistLimitDamping ( ) const
inline

Twist damping if the constraint is set to use soft limits

◆ GetSoftTwistLimitRestitution()

float FConstraintInstance::GetSoftTwistLimitRestitution ( ) const
inline

Twist restitution if the constraint is set to use soft limits

◆ GetSoftTwistLimitStiffness()

float FConstraintInstance::GetSoftTwistLimitStiffness ( ) const
inline

Twist stiffness if the constraint is set to use soft limits

◆ GetUsedMaterials()

void FConstraintInstance::GetUsedMaterials ( TArray< UMaterialInterface * > &  Materials)

◆ HasAngularPlasticity()

bool FConstraintInstance::HasAngularPlasticity ( ) const
inline

Gets Whether it is possible to reset the target angles

◆ HasLinearPlasticity()

bool FConstraintInstance::HasLinearPlasticity ( ) const
inline

Gets Whether it is possible to reset the target position

◆ InitConstraint() [1/2]

void FConstraintInstance::InitConstraint ( Chaos::FPhysicsObject Body1,
Chaos::FPhysicsObject Body2,
float  Scale,
UObject DebugOwner,
FOnConstraintBroken  InConstraintBrokenDelegate = FOnConstraintBroken(),
FOnPlasticDeformation  InPlasticDeformationDelegate = FOnPlasticDeformation() 
)

◆ InitConstraint() [2/2]

void FConstraintInstance::InitConstraint ( FBodyInstance Body1,
FBodyInstance Body2,
float  InScale,
UObject DebugOwner,
FOnConstraintBroken  InConstraintBrokenDelegate = FOnConstraintBroken(),
FOnPlasticDeformation  InPlasticDeformationDelegate = FOnPlasticDeformation() 
)

Create physics engine constraint.

◆ InitConstraint_AssumesLocked() [1/2]

void FConstraintInstance::InitConstraint_AssumesLocked ( Chaos::FPhysicsObject Body1,
Chaos::FPhysicsObject Body2,
float  InScale,
FOnConstraintBroken  InConstraintBrokenDelegate = FOnConstraintBroken(),
FOnPlasticDeformation  InPlasticDeformationDelegate = FOnPlasticDeformation() 
)

◆ InitConstraint_AssumesLocked() [2/2]

void FConstraintInstance::InitConstraint_AssumesLocked ( const FPhysicsActorHandle ActorRef1,
const FPhysicsActorHandle ActorRef2,
float  InScale,
FOnConstraintBroken  InConstraintBrokenDelegate = FOnConstraintBroken(),
FOnPlasticDeformation  InPlasticDeformationDelegate = FOnPlasticDeformation() 
)

Create physics engine constraint using physx actors.

◆ IsAngularBreakable()

bool FConstraintInstance::IsAngularBreakable ( ) const
inline

Gets Whether it is possible to break the joint with angular force

◆ IsAngularOrientationDriveEnabled()

bool FConstraintInstance::IsAngularOrientationDriveEnabled ( ) const
inline

Whether the angular orientation drive is enabled

◆ IsAngularVelocityDriveEnabled()

bool FConstraintInstance::IsAngularVelocityDriveEnabled ( ) const
inline

Whether the angular velocity drive is enabled

◆ IsBroken()

bool FConstraintInstance::IsBroken ( )

◆ IsCollisionDisabled()

bool FConstraintInstance::IsCollisionDisabled ( ) const
inline

Whether collision is currently disabled

◆ IsLinearBreakable()

bool FConstraintInstance::IsLinearBreakable ( ) const
inline

Gets Whether it is possible to break the joint with linear force

◆ IsLinearPositionDriveEnabled()

bool FConstraintInstance::IsLinearPositionDriveEnabled ( ) const
inline

Whether the linear position drive is enabled

◆ IsLinearPositionDriveXEnabled()

bool FConstraintInstance::IsLinearPositionDriveXEnabled ( ) const
inline

Get which linear position drives is enabled on XAxis

◆ IsLinearPositionDriveYEnabled()

bool FConstraintInstance::IsLinearPositionDriveYEnabled ( ) const
inline

Get which linear position drives is enabled on YAxis

◆ IsLinearPositionDriveZEnabled()

bool FConstraintInstance::IsLinearPositionDriveZEnabled ( ) const
inline

Get which linear position drives is enabled on ZAxis

◆ IsLinearVelocityDriveEnabled()

bool FConstraintInstance::IsLinearVelocityDriveEnabled ( ) const
inline

Whether the linear velocity drive is enabled

◆ IsLinearVelocityDriveXEnabled()

bool FConstraintInstance::IsLinearVelocityDriveXEnabled ( ) const
inline

Get which linear position drives is enabled on XAxis

◆ IsLinearVelocityDriveYEnabled()

bool FConstraintInstance::IsLinearVelocityDriveYEnabled ( ) const
inline

Get which linear position drives is enabled on YAxis

◆ IsLinearVelocityDriveZEnabled()

bool FConstraintInstance::IsLinearVelocityDriveZEnabled ( ) const
inline

Get which linear position drives is enabled on ZAxis

◆ IsMassConditioningEnabled()

bool FConstraintInstance::IsMassConditioningEnabled ( ) const
inline

Whether mass conditioning is enabled.

See also
FConstraintProfileProperties::bEnableMassConditioning

◆ IsParentDominatesEnabled()

bool FConstraintInstance::IsParentDominatesEnabled ( ) const
inline

Whether parent domination is enabled (meaning the parent body cannot be be affected at all by a child)

◆ IsProjectionEnabled()

bool FConstraintInstance::IsProjectionEnabled ( ) const
inline

Whether projection is enabled for this constraint

◆ IsTerminated()

bool FConstraintInstance::IsTerminated ( ) const

Whether the physics engine constraint has been terminated

◆ IsValidConstraintInstance()

bool FConstraintInstance::IsValidConstraintInstance ( ) const

See if this constraint is valid.

◆ Serialize()

bool FConstraintInstance::Serialize ( FArchive Ar)

◆ SerializeState()

void FConstraintInstance::SerializeState ( Chaos::FSerializedDataBuffer OutSerializedState,
Chaos::ESerializedDataContext  DataContext 
)

Serialized out the physics thread state of this constraint as an array of bytes

◆ SetAngularBreakable()

void FConstraintInstance::SetAngularBreakable ( bool  bInAngularBreakable,
float  InAngularBreakThreshold 
)
inline

Sets the Angular Breakable properties

Parameters
bInAngularBreakableWhether it is possible to break the joint with angular force
InAngularBreakThresholdTorque needed to break the joint

◆ SetAngularDOFLimitScale()

void FConstraintInstance::SetAngularDOFLimitScale ( float  InSwing1LimitScale,
float  InSwing2LimitScale,
float  InTwistLimitScale 
)

Scale Angular Limit Constraints (as defined in RB_ConstraintSetup). This only affects the physics engine and does not update the unreal side so you can do things like a LERP of the scale values.

Scale Angular Limit Constraints (as defined in RB_ConstraintSetup)

◆ SetAngularDriveAccelerationMode()

void FConstraintInstance::SetAngularDriveAccelerationMode ( bool  bAccelerationMode)

Set the angular drive force-mode

◆ SetAngularDriveMode()

void FConstraintInstance::SetAngularDriveMode ( EAngularDriveMode::Type  DriveMode)

Set the angular drive mode

◆ SetAngularDriveParams()

void FConstraintInstance::SetAngularDriveParams ( float  InSpring,
float  InDamping,
float  InForceLimit 
)

Set the angular drive's strength parameters

Function for setting angular motor parameters.

◆ SetAngularOrientationTarget()

void FConstraintInstance::SetAngularOrientationTarget ( const FQuat InOrientationTarget)

Set the angular drive's orientation target

Function for setting target angular position.

◆ SetAngularPlasticity()

void FConstraintInstance::SetAngularPlasticity ( bool  bInAngularPlasticity,
float  InAngularPlasticityThreshold 
)
inline

Sets the Angular Plasticity properties

Parameters
bInAngularPlasticityWhether it is possible to reset the target angles
InAngularPlasticityThresholdDelta from target needed to reset the target joint

◆ SetAngularSwing1Limit()

void FConstraintInstance::SetAngularSwing1Limit ( EAngularConstraintMotion  MotionType,
float  InSwing1LimitAngle 
)
inline

Sets the Angular Swing1 Motion Type

Parameters
MotionTypeNew Motion Type

◆ SetAngularSwing1Motion()

void FConstraintInstance::SetAngularSwing1Motion ( EAngularConstraintMotion  MotionType)
inline

Sets the cone limit's swing1 motion type

◆ SetAngularSwing2Limit()

void FConstraintInstance::SetAngularSwing2Limit ( EAngularConstraintMotion  MotionType,
float  InSwing2LimitAngle 
)
inline

Sets the Angular Swing2 Motion Type

Parameters
MotionTypeNew Motion Type

◆ SetAngularSwing2Motion()

void FConstraintInstance::SetAngularSwing2Motion ( EAngularConstraintMotion  MotionType)
inline

Sets the cone limit's swing2 motion type

◆ SetAngularTwistLimit()

void FConstraintInstance::SetAngularTwistLimit ( EAngularConstraintMotion  MotionType,
float  InTwistLimitAngle 
)
inline

Sets the Angular Twist Motion Type

Parameters
MotionTypeNew Motion Type

◆ SetAngularTwistMotion()

void FConstraintInstance::SetAngularTwistMotion ( EAngularConstraintMotion  MotionType)
inline

Sets the twist limit's motion type

◆ SetAngularVelocityDriveSLERP()

void FConstraintInstance::SetAngularVelocityDriveSLERP ( bool  bInEnableSLERP)

Set whether the SLERP angular velocity drive is enabled. Only applicable when SLERP drive mode is used

◆ SetAngularVelocityDriveTwistAndSwing()

void FConstraintInstance::SetAngularVelocityDriveTwistAndSwing ( bool  bInEnableTwistDrive,
bool  bInEnableSwingDrive 
)

Set which twist and swing angular velocity drives are enabled. Only applicable when Twist And Swing drive mode is used

◆ SetAngularVelocityTarget()

void FConstraintInstance::SetAngularVelocityTarget ( const FVector InVelTarget)

Set the angular drive's angular velocity target (in revolutions per second)

Function for setting target angular velocity.

◆ SetContactTransferScale()

void FConstraintInstance::SetContactTransferScale ( float  InContactTransferScale)
inline

Sets the Contact Transfer Scale properties

Parameters
InContactTransferScaleContact transfer scale to joints parent

◆ SetDisableCollision()

void FConstraintInstance::SetDisableCollision ( bool  InDisableCollision)

Set whether jointed actors can collide with each other

◆ SetDriveParams()

void FConstraintInstance::SetDriveParams ( const FVector InPositionStrength,
const FVector InVelocityStrength,
const FVector InForceLimit,
const FVector InAngularSpring,
const FVector InAngularDamping,
const FVector InTorqueLimit,
EAngularDriveMode::Type  InAngularDriveMode 
)

This allows the most common drive parameters to be set in one call, avoiding lock overheads etc. Note that the individual drive elements will be enabled/disabled depending on the strength/damping values passed in.

Angular values are passed in as (swing, twist, slerp)

◆ SetLinearBreakable()

void FConstraintInstance::SetLinearBreakable ( bool  bInLinearBreakable,
float  InLinearBreakThreshold 
)
inline

Sets the Linear Breakable properties

Parameters
bInLinearBreakableWhether it is possible to break the joint with linear force
InLinearBreakThresholdForce needed to break the joint

◆ SetLinearDriveAccelerationMode()

void FConstraintInstance::SetLinearDriveAccelerationMode ( bool  bAccelerationMode)

Set the linear drive force-mode

◆ SetLinearDriveParams() [1/2]

void FConstraintInstance::SetLinearDriveParams ( const FVector InSpring,
const FVector InDamping,
const FVector InForceLimit 
)

Set the linear drive's strength parameters per-axis

Function for setting linear motor parameters.

◆ SetLinearDriveParams() [2/2]

void FConstraintInstance::SetLinearDriveParams ( float  InSpring,
float  InDamping,
float  InForceLimit 
)

Set the linear drive's strength parameters

Function for setting linear motor parameters.

◆ SetLinearLimits()

void FConstraintInstance::SetLinearLimits ( ELinearConstraintMotion  XConstraintType,
ELinearConstraintMotion  YConstraintType,
ELinearConstraintMotion  ZConstraintType,
float  InLinearLimitSize 
)
inline

Sets the Linear XYZ Motion Type and the limit distance (Note distance is the same for all 3 axes)

◆ SetLinearLimitSize()

void FConstraintInstance::SetLinearLimitSize ( float  NewLimitSize)

Allows you to dynamically change the size of the linear limit 'sphere'.

◆ SetLinearPlasticity()

void FConstraintInstance::SetLinearPlasticity ( bool  bInLinearPlasticity,
float  InLinearPlasticityThreshold,
EConstraintPlasticityType  InLinearPlasticityType 
)
inline

Sets the Linear Plasticity properties

Parameters
bInLinearPlasticityWhether it is possible to reset the target angles
InLinearPlasticityThresholdDelta from target needed to reset the target joint

◆ SetLinearPositionDrive()

void FConstraintInstance::SetLinearPositionDrive ( bool  bEnableXDrive,
bool  bEnableYDrive,
bool  bEnableZDrive 
)

Set which linear position drives are enabled

Function for turning linear position drive on and off.

◆ SetLinearPositionTarget()

void FConstraintInstance::SetLinearPositionTarget ( const FVector InPosTarget)

Set the linear drive's target position position

Function for setting linear position target.

◆ SetLinearVelocityDrive()

void FConstraintInstance::SetLinearVelocityDrive ( bool  bEnableXDrive,
bool  bEnableYDrive,
bool  bEnableZDrive 
)

Set which linear velocity drives are enabled

Function for turning linear velocity drive on and off.

◆ SetLinearVelocityTarget()

void FConstraintInstance::SetLinearVelocityTarget ( const FVector InVelTarget)

Set the linear drive's target velocity

Function for setting linear velocity target.

◆ SetLinearXLimit()

void FConstraintInstance::SetLinearXLimit ( ELinearConstraintMotion  XConstraintType,
float  InLinearLimitSize 
)
inline

Sets the LinearX Motion Type and the limit distance (Note distance is the same for all 3 axes)

◆ SetLinearXMotion()

void FConstraintInstance::SetLinearXMotion ( ELinearConstraintMotion  XConstraintType)
inline

Sets the Linear XMotion type

◆ SetLinearYLimit()

void FConstraintInstance::SetLinearYLimit ( ELinearConstraintMotion  YConstraintType,
float  InLinearLimitSize 
)
inline

Sets the LinearY Motion Type and the limit distance (Note distance is the same for all 3 axes)

◆ SetLinearYMotion()

void FConstraintInstance::SetLinearYMotion ( ELinearConstraintMotion  YConstraintType)
inline

Sets the Linear YMotion type

◆ SetLinearZLimit()

void FConstraintInstance::SetLinearZLimit ( ELinearConstraintMotion  ZConstraintType,
float  InLinearLimitSize 
)
inline

Sets the LinearZ Motion Type and the limit distance (Note distance is the same for all 3 axes)

◆ SetLinearZMotion()

void FConstraintInstance::SetLinearZMotion ( ELinearConstraintMotion  ZConstraintType)
inline

Sets the Linear ZMotion type

◆ SetOrientationDriveSLERP()

void FConstraintInstance::SetOrientationDriveSLERP ( bool  bInEnableSLERP)

Set whether the SLERP angular position drive is enabled. Only applicable when SLERP drive mode is used

◆ SetOrientationDriveTwistAndSwing()

void FConstraintInstance::SetOrientationDriveTwistAndSwing ( bool  bInEnableTwistDrive,
bool  bInEnableSwingDrive 
)

Set which twist and swing orientation drives are enabled. Only applicable when Twist And Swing drive mode is used

◆ SetParentDominates()

void FConstraintInstance::SetParentDominates ( bool  bParentDominates)

◆ SetProjectionParams()

void FConstraintInstance::SetProjectionParams ( bool  bEnableProjection,
float  ProjectionLinearAlpha,
float  ProjectionAngularAlpha,
float  ProjectionLinearTolerance,
float  ProjectionAngularTolerance 
)

Set projection parameters

◆ SetRefFrame()

void FConstraintInstance::SetRefFrame ( EConstraintFrame::Type  Frame,
const FTransform RefFrame 
)

◆ SetRefOrientation()

void FConstraintInstance::SetRefOrientation ( EConstraintFrame::Type  Frame,
const FVector PriAxis,
const FVector SecAxis 
)

◆ SetRefPosition()

void FConstraintInstance::SetRefPosition ( EConstraintFrame::Type  Frame,
const FVector RefPosition 
)

◆ SetShockPropagationParams()

void FConstraintInstance::SetShockPropagationParams ( bool  bEnableShockPropagation,
float  ShockPropagationAlpha 
)

Set the shock propagation amount [0, 1]

◆ SetSoftLinearLimitParams()

void FConstraintInstance::SetSoftLinearLimitParams ( bool  bIsSoftLimit,
float  Stiffness,
float  Damping,
float  Restitution,
float  ContactDistance 
)
inline

Set twist soft limit parameters

◆ SetSoftSwingLimitParams()

void FConstraintInstance::SetSoftSwingLimitParams ( bool  bIsSoftLimit,
float  Stiffness,
float  Damping,
float  Restitution,
float  ContactDistance 
)
inline

Set twist soft limit parameters

◆ SetSoftTwistLimitParams()

void FConstraintInstance::SetSoftTwistLimitParams ( bool  bIsSoftLimit,
float  Stiffness,
float  Damping,
float  Restitution,
float  ContactDistance 
)
inline

Set twist soft limit parameters

◆ TermConstraint()

void FConstraintInstance::TermConstraint ( )

Terminate physics engine constraint

◆ UpdateAngularLimit()

void FConstraintInstance::UpdateAngularLimit ( )

Refreshes the physics engine joint's angular limits. Only applicable if the joint has been created already.

◆ UpdateLinearLimit()

void FConstraintInstance::UpdateLinearLimit ( )

Refreshes the physics engine joint's linear limits. Only applicable if the joint has been created already.

Member Data Documentation

◆ AngularRotationOffset

FRotator FConstraintInstance::AngularRotationOffset

Specifies the angular offset between the two frames of reference. By default limit goes from (-Angle, +Angle) This allows you to bias the limit for swing1 swing2 and twist.

◆ AverageMass

float FConstraintInstance::AverageMass

◆ bScaleLinearLimits

uint32 FConstraintInstance::bScaleLinearLimits

If true, linear limits scale using the absolute min of the 3d scale of the owning component

◆ ConstraintBone1

FName FConstraintInstance::ConstraintBone1

Name of first bone (body) that this constraint is connecting. This will be the 'child' bone in a PhysicsAsset.

◆ ConstraintBone2

FName FConstraintInstance::ConstraintBone2

Name of second bone (body) that this constraint is connecting. This will be the 'parent' bone in a PhysicsAset.

◆ JointName

FName FConstraintInstance::JointName

Name of bone that this joint is associated with.

◆ Pos1

FVector FConstraintInstance::Pos1

Location of constraint in Body1 reference frame (usually the "child" body for skeletal meshes).

◆ Pos2

FVector FConstraintInstance::Pos2

Location of constraint in Body2 reference frame (usually the "parent" body for skeletal meshes).

◆ PriAxis1

FVector FConstraintInstance::PriAxis1

Primary (twist) axis in Body1 reference frame.

◆ PriAxis2

FVector FConstraintInstance::PriAxis2

Primary (twist) axis in Body2 reference frame.

◆ ProfileInstance

FConstraintProfileProperties FConstraintInstance::ProfileInstance

◆ SecAxis1

FVector FConstraintInstance::SecAxis1

Secondary axis in Body1 reference frame. Orthogonal to PriAxis1.

◆ SecAxis2

FVector FConstraintInstance::SecAxis2

Secondary axis in Body2 reference frame. Orthogonal to PriAxis2.

◆ UserData

FChaosUserData FConstraintInstance::UserData

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