Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/PhysicsEngine
Inheritance Hierarchy
- FConstraintInstanceBase
- FConstraintInstance
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/PhysicsEngine/ConstraintInstance.h |
| Include | #include "PhysicsEngine/ConstraintInstance.h" |
Syntax
USTRUCT ()
struct FConstraintInstance : public FConstraintInstanceBase
Remarks
Container for a physics representation of an object.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FRotator | AngularRotationOffset | Specifies the angular offset between the two frames of reference. | |
| float | AverageMass | ||
| uint32: 1 | bScaleLinearLimits | If true, linear limits scale using the absolute min of the 3d scale of the owning component | |
| FName | ConstraintBone1 | Name of first bone (body) that this constraint is connecting. | |
| FName | ConstraintBone2 | Name of second bone (body) that this constraint is connecting. | |
| FName | JointName | Name of bone that this joint is associated with. | |
| FVector | Pos1 | Location of constraint in Body1 reference frame (usually the "child" body for skeletal meshes). | |
| FVector | Pos2 | Location of constraint in Body2 reference frame (usually the "parent" body for skeletal meshes). | |
| FVector | PriAxis1 | Primary (twist) axis in Body1 reference frame. | |
| FVector | PriAxis2 | Primary (twist) axis in Body2 reference frame. | |
| FConstraintProfileProperties | ProfileInstance | Constraint Data (properties easily swapped at runtime based on different constraint profiles) | |
| FVector | SecAxis1 | Secondary axis in Body1 reference frame. Orthogonal to PriAxis1. | |
| FVector | SecAxis2 | Secondary axis in Body2 reference frame. Orthogonal to PriAxis2. | |
| FChaosUserData | UserData |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Constructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FConstraintInstance * | Alloc () |
||
| FTransform | Returns this constraint's default transform relative to its child bone. | ||
| FTransform | CalculateDefaultParentTransform
(
const UPhysicsAsset*const PhysicsAsset |
Returns this constraint's default transform relative to its parent bone. | |
| void | CopyConstraintGeometryFrom
(
const FConstraintInstance* FromInstance |
||
| void | CopyConstraintParamsFrom
(
const FConstraintInstance* FromInstance |
||
| void | CopyConstraintPhysicalPropertiesFrom
(
const FConstraintInstance* FromInstance, |
Copies non-identifying properties from another constraint instance | |
| void | CopyProfilePropertiesFrom
(
const FConstraintProfileProperties& FromProperties |
Copies behavior properties from the given profile. | |
| void | Disable maxx conditioning. | ||
| void | |||
| void | Turn off linear and angular projection | ||
| void | DrawConstraint
(
int32 ViewIndex, |
||
| void | DrawConstraint
(
FPrimitiveDrawInterface* PDI, |
||
| void | Enable maxx conditioning. | ||
| void | Enable/Disable parent dominates (meaning the parent body cannot be be affected at all by a child) | ||
| void | Turn on linear and angular projection | ||
| void | Free
(
FConstraintInstance* Ptr |
Hacks to easily get zeroed memory for special case when we don't use GC. | |
| float | Gets Torque needed to break the joint | ||
| EAngularDriveMode::Type | Set the angular drive mode | ||
| void | GetAngularDriveParams
(
float& OutSpring, |
Get the angular drive's strength parameters | |
| const FRotator & | Get the angular drive's orientation target | ||
| float | Gets Delta from target needed to reset the target joint | ||
| float | Gets the cone limit swing1 angle in degrees | ||
| EAngularConstraintMotion | Gets the motion type for the swing1 of the cone constraint | ||
| float | Gets the cone limit swing2 angle in degrees | ||
| EAngularConstraintMotion | Gets the motion type for the swing2 of the cone constraint | ||
| float | Gets the twist limit angle in degrees | ||
| EAngularConstraintMotion | Gets the motion type for the twist of the cone constraint | ||
| bool | Get whether the SLERP angular velocity drive is enabled. | ||
| void | GetAngularVelocityDriveTwistAndSwing
(
bool& bOutEnableTwistDrive, |
Get which twist and swing angular velocity drives are enabled. | |
| const FVector & | Get the angular drive's angular velocity target | ||
| const FName & | Get the child bone name | ||
| void | GetConstraintForce
(
FVector& OutLinearForce, |
Retrieve the constraint force most recently applied to maintain this constraint. Returns 0 forces if the constraint is not initialized or broken. | |
| FVector | Get the position of this constraint in world space. | ||
| float | Get the Contact Transfer Scale for the parent of the joint | ||
| float | The current swing1 of the constraint. | ||
| float | The current swing2 of the constraint. | ||
| float | The current twist of the constraint. | ||
| bool | Whether the linear limits are soft (only if at least one axis if Limited) | ||
| bool | Whether the swing limits are soft (only available if swing1 and/or swing2 is Limited) | ||
| bool | Whether the twist limits are soft (only available if twist is Limited) | ||
| float | |||
| float | Gets linear force needed to break the joint | ||
| void | GetLinearDriveParams
(
FVector& OutPositionStrength, |
Get the linear drive's strength parameters.Get the linear drive's strength parameters | |
| void | GetLinearDriveParams
(
float& OutPositionStrength, |
Get the linear drive's strength parameters. | |
| float | Gets the linear limit size | ||
| float | Gets Delta from target needed to reset the target joint | ||
| TEnumAsByte< enum EConstraintPlasticityType > | Gets Plasticity Type from joint | ||
| const FVector & | Get the linear drive's target position position | ||
| const FVector & | Get the linear drive's target velocity | ||
| ELinearConstraintMotion | Gets the motion type for the linear X-axis limit. | ||
| ELinearConstraintMotion | Gets the motion type for the linear Y-axis limit. | ||
| ELinearConstraintMotion | Gets the motion type for the linear Z-axis limit. | ||
| bool | Get whether the SLERP angular position drive is enabled. | ||
| void | GetOrientationDriveTwistAndSwing
(
bool& bOutEnableTwistDrive, |
Get which twist and swing orientation drives are enabled. | |
| const FName & | Get the parent bone name | ||
| const FPhysicsConstraintHandle & | Get underlying physics engine constraint | ||
| void | GetProjectionParams
(
float& ProjectionLinearAlpha, |
Get projection parameters | |
| FTransform | GetRefFrame
(
EConstraintFrame::Type Frame |
Get component ref frame. | |
| float | Get the shock propagation amount [0, 1] | ||
| float | Linear contact distance if the constraint is set to use soft linear limits | ||
| float | Linear damping if the constraint is set to use soft linear limits | ||
| float | Linear restitution if the constraint is set to use soft linear limits | ||
| float | Linear stiffness if the constraint is set to use soft linear limits | ||
| float | Swing Contact distance if the constraint is set to use soft limits | ||
| float | Swing damping if the constraint is set to use soft limits | ||
| float | Swing restitution if the constraint is set to use soft limits | ||
| float | Swing stiffness if the constraint is set to use soft limits | ||
| float | Twist contact distance if the constraint is set to use soft limits | ||
| float | Twist damping if the constraint is set to use soft limits | ||
| float | Twist restitution if the constraint is set to use soft limits | ||
| float | Twist stiffness if the constraint is set to use soft limits | ||
| void | GetUsedMaterials
(
TArray< UMaterialInterface* >& Materials |
||
| bool | Gets Whether it is possible to reset the target angles | ||
| bool | Gets Whether it is possible to reset the target position | ||
| void | InitConstraint
(
Chaos::FPhysicsObject* Body1, |
||
| void | InitConstraint
(
FBodyInstance* Body1, |
Create physics engine constraint. | |
| void | InitConstraint_AssumesLocked
(
Chaos::FPhysicsObject* Body1, |
||
| void | InitConstraint_AssumesLocked
(
const FPhysicsActorHandle& ActorRef1, |
Create physics engine constraint using physx actors. | |
| bool | Gets Whether it is possible to break the joint with angular force | ||
| bool | Whether the angular orientation drive is enabled | ||
| bool | Whether the angular velocity drive is enabled | ||
| bool | IsBroken () |
Retrieve the status of constraint being broken. | |
| bool | Whether collision is currently disabled | ||
| bool | Gets Whether it is possible to break the joint with linear force | ||
| bool | Whether the linear position drive is enabled | ||
| bool | Get which linear position drives is enabled on XAxis | ||
| bool | Get which linear position drives is enabled on YAxis | ||
| bool | Get which linear position drives is enabled on ZAxis | ||
| bool | Whether the linear velocity drive is enabled | ||
| bool | Get which linear position drives is enabled on XAxis | ||
| bool | Get which linear position drives is enabled on YAxis | ||
| bool | Get which linear position drives is enabled on ZAxis | ||
| bool | Whether mass conditioning is enabled. | ||
| bool | Whether parent domination is enabled (meaning the parent body cannot be be affected at all by a child) | ||
| bool | Whether projection is enabled for this constraint | ||
| bool | IsTerminated () |
Whether the physics engine constraint has been terminated | |
| bool | See if this constraint is valid. | ||
| void | PostSerialize
(
const FArchive& Ar |
||
| bool | |||
| void | SetAngularBreakable
(
bool bInAngularBreakable, |
Sets the Angular Breakable properties | |
| void | SetAngularDOFLimitScale
(
float InSwing1LimitScale, |
Scale Angular Limit Constraints (as defined in RB_ConstraintSetup). | |
| void | SetAngularDriveAccelerationMode
(
bool bAccelerationMode |
Set the angular drive force-mode | |
| void | SetAngularDriveMode
(
EAngularDriveMode::Type DriveMode |
Set the angular drive mode | |
| void | SetAngularDriveParams
(
float InSpring, |
Set the angular drive's strength parametersFunction for setting angular motor parameters. | |
| void | SetAngularOrientationTarget
(
const FQuat& InPosTarget |
Set the angular drive's orientation targetFunction for setting target angular position. | |
| void | SetAngularPlasticity
(
bool bInAngularPlasticity, |
Sets the Angular Plasticity properties | |
| void | SetAngularSwing1Limit
(
EAngularConstraintMotion MotionType, |
Sets the Angular Swing1 Motion Type | |
| void | SetAngularSwing1Motion
(
EAngularConstraintMotion MotionType |
Sets the cone limit's swing1 motion type | |
| void | SetAngularSwing2Limit
(
EAngularConstraintMotion MotionType, |
Sets the Angular Swing2 Motion Type | |
| void | SetAngularSwing2Motion
(
EAngularConstraintMotion MotionType |
Sets the cone limit's swing2 motion type | |
| void | SetAngularTwistLimit
(
EAngularConstraintMotion MotionType, |
Sets the Angular Twist Motion Type | |
| void | SetAngularTwistMotion
(
EAngularConstraintMotion MotionType |
Sets the twist limit's motion type | |
| void | SetAngularVelocityDriveSLERP
(
bool bInEnableSLERP |
Set whether the SLERP angular velocity drive is enabled. | |
| void | SetAngularVelocityDriveTwistAndSwing
(
bool bInEnableTwistDrive, |
Set which twist and swing angular velocity drives are enabled. | |
| void | SetAngularVelocityTarget
(
const FVector& InVelTarget |
Set the angular drive's angular velocity target (in revolutions per second) | |
| void | SetContactTransferScale
(
float InContactTransferScale |
Sets the Contact Transfer Scale properties | |
| void | SetDisableCollision
(
bool InDisableCollision |
Set whether jointed actors can collide with each other | |
| void | SetDriveParams
(
const FVector& InPositionStrength, |
This allows the most common drive parameters to be set in one call, avoiding lock overheads etc. | |
| void | SetLinearBreakable
(
bool bInLinearBreakable, |
Sets the Linear Breakable properties | |
| void | SetLinearDriveAccelerationMode
(
bool bAccelerationMode |
Set the linear drive force-mode | |
| void | SetLinearDriveParams
(
float InPositionStrength, |
Set the linear drive's strength parametersFunction for setting linear motor parameters. | |
| void | SetLinearDriveParams
(
const FVector& InPositionStrength, |
Set the linear drive's strength parameters per-axis | |
| void | SetLinearLimits
(
ELinearConstraintMotion XConstraintType, |
Sets the Linear XYZ Motion Type and the limit distance (Note distance is the same for all 3 axes) | |
| void | SetLinearLimitSize
(
float NewLimitSize |
Allows you to dynamically change the size of the linear limit 'sphere'. | |
| void | SetLinearPlasticity
(
bool bInLinearPlasticity, |
Sets the Linear Plasticity properties | |
| void | SetLinearPositionDrive
(
bool bEnableXDrive, |
Set which linear position drives are enabled | |
| void | SetLinearPositionTarget
(
const FVector& InPosTarget |
Set the linear drive's target position positionFunction for setting linear position target. | |
| void | SetLinearVelocityDrive
(
bool bEnableXDrive, |
Set which linear velocity drives are enabled | |
| void | SetLinearVelocityTarget
(
const FVector& InVelTarget |
Set the linear drive's target velocityFunction for setting linear velocity target. | |
| void | SetLinearXLimit
(
ELinearConstraintMotion XConstraintType, |
Sets the LinearX Motion Type and the limit distance (Note distance is the same for all 3 axes) | |
| void | SetLinearXMotion
(
ELinearConstraintMotion XConstraintType |
Sets the Linear XMotion type | |
| void | SetLinearYLimit
(
ELinearConstraintMotion YConstraintType, |
Sets the LinearY Motion Type and the limit distance (Note distance is the same for all 3 axes) | |
| void | SetLinearYMotion
(
ELinearConstraintMotion YConstraintType |
Sets the Linear YMotion type | |
| void | SetLinearZLimit
(
ELinearConstraintMotion ZConstraintType, |
Sets the LinearZ Motion Type and the limit distance (Note distance is the same for all 3 axes) | |
| void | SetLinearZMotion
(
ELinearConstraintMotion ZConstraintType |
Sets the Linear ZMotion type | |
| void | SetOrientationDriveSLERP
(
bool bInEnableSLERP |
Set whether the SLERP angular position drive is enabled. | |
| void | SetOrientationDriveTwistAndSwing
(
bool bInEnableTwistDrive, |
Set which twist and swing orientation drives are enabled. | |
| void | SetParentDominates
(
bool bParentDominates |
||
| void | SetProjectionParams
(
bool bEnableProjection, |
Set projection parameters | |
| void | SetRefFrame
(
EConstraintFrame::Type Frame, |
Pass in reference frame in. If the constraint is currently active, this will set its active local pose. Otherwise the change will take affect in InitConstraint. | |
| void | SetRefOrientation
(
EConstraintFrame::Type Frame, |
Pass in reference orientation in (maintains reference position). If the constraint is currently active, this will set its active local pose. Otherwise the change will take affect in InitConstraint. | |
| void | SetRefPosition
(
EConstraintFrame::Type Frame, |
Pass in reference position in (maintains reference orientation). If the constraint is currently active, this will set its active local pose. Otherwise the change will take affect in InitConstraint. | |
| void | SetShockPropagationParams
(
bool bEnableShockPropagation, |
Set the shock propagation amount [0, 1] | |
| void | SetSoftLinearLimitParams
(
bool bIsSoftLimit, |
Set twist soft limit parameters | |
| void | SetSoftSwingLimitParams
(
bool bIsSoftLimit, |
Set twist soft limit parameters | |
| void | SetSoftTwistLimitParams
(
bool bIsSoftLimit, |
Set twist soft limit parameters | |
| void | SnapTransformsToDefault
(
const EConstraintTransformComponentFlags SnapFlags, |
Set the constraint transform components specified by the SnapFlags to their default values (derived from the parent and child bone transforms). | |
| void | Terminate physics engine constraint | ||
| void | Refreshes the physics engine joint's angular limits. | ||
| void | Refreshes the physics engine joint's linear limits. |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| float | AngularBreakThreshold_DEPRECATED | ||
| float | AngularDriveDamping_DEPRECATED | ||
| float | AngularDriveForceLimit_DEPRECATED | ||
| TEnumAsByte< EAngularDriveMode::Type > | AngularDriveMode_DEPRECATED | ||
| float | AngularDriveSpring_DEPRECATED | ||
| FRotator | AngularOrientationTarget_DEPRECATED | ||
| FQuat | AngularPositionTarget_DEPRECATED | ||
| TEnumAsByte< enum EAngularConstraintMotion > | AngularSwing1Motion_DEPRECATED | ||
| TEnumAsByte< enum EAngularConstraintMotion > | AngularSwing2Motion_DEPRECATED | ||
| TEnumAsByte< enum EAngularConstraintMotion > | AngularTwistMotion_DEPRECATED | ||
| FVector | AngularVelocityTarget_DEPRECATED | ||
| uint32: 1 | bAngularBreakable_DEPRECATED | ||
| uint32: 1 | bAngularOrientationDrive_DEPRECATED | ||
| uint32: 1 | bAngularSlerpDrive_DEPRECATED | ||
| uint32: 1 | bAngularVelocityDrive_DEPRECATED | ||
| uint32: 1 | bDisableCollision_DEPRECATED | DEPRECATED Most of these properties have moved inside the ProfileInstance member (FConstraintProfileProperties struct) | |
| uint32: 1 | bEnableProjection_DEPRECATED | ||
| uint32: 1 | bLinearBreakable_DEPRECATED | ||
| uint32: 1 | bLinearLimitSoft_DEPRECATED | ||
| uint32: 1 | bLinearPositionDrive_DEPRECATED | ||
| uint32: 1 | bLinearVelocityDrive_DEPRECATED | ||
| uint32: 1 | bSwingLimitSoft_DEPRECATED | ||
| uint32: 1 | bSwingPositionDrive_DEPRECATED | ||
| uint32: 1 | bSwingVelocityDrive_DEPRECATED | ||
| uint32: 1 | bTwistLimitSoft_DEPRECATED | ||
| uint32: 1 | bTwistPositionDrive_DEPRECATED | ||
| uint32: 1 | bTwistVelocityDrive_DEPRECATED | ||
| float | LinearBreakThreshold_DEPRECATED | ||
| float | LinearDriveDamping_DEPRECATED | ||
| float | LinearDriveForceLimit_DEPRECATED | ||
| float | LinearDriveSpring_DEPRECATED | ||
| float | LinearLimitDamping_DEPRECATED | ||
| float | LinearLimitSize_DEPRECATED | ||
| float | LinearLimitStiffness_DEPRECATED | ||
| FVector | LinearPositionTarget_DEPRECATED | ||
| FVector | LinearVelocityTarget_DEPRECATED | ||
| TEnumAsByte< enum ELinearConstraintMotion > | LinearXMotion_DEPRECATED | ||
| TEnumAsByte< enum ELinearConstraintMotion > | LinearYMotion_DEPRECATED | ||
| TEnumAsByte< enum ELinearConstraintMotion > | LinearZMotion_DEPRECATED | ||
| float | ProjectionAngularTolerance_DEPRECATED | ||
| float | ProjectionLinearTolerance_DEPRECATED | ||
| float | Swing1LimitAngle_DEPRECATED | ||
| float | Swing2LimitAngle_DEPRECATED | ||
| float | SwingLimitDamping_DEPRECATED | ||
| float | SwingLimitStiffness_DEPRECATED | ||
| float | TwistLimitAngle_DEPRECATED | ||
| float | TwistLimitDamping_DEPRECATED | ||
| float | TwistLimitStiffness_DEPRECATED |