Class PhysicsConstraintComponent
This is effectively a joint that allows you to connect 2 rigid bodies together. You can create different types of joints using the various parameters of this component.
Inherited Members
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class PhysicsConstraintComponent : SceneComponent
Properties
| Improve this Doc View SourceComponentName1
Name of first component property to constrain.
Declaration
public ConstrainComponentPropName ComponentName1 { get; set; }
Property Value
Type | Description |
---|---|
ConstrainComponentPropName |
Remarks
If Actor1 is NULL, will look within Owner. If this is NULL, will use RootComponent of Actor1
ComponentName2
Name of second component property to constrain.
Declaration
public ConstrainComponentPropName ComponentName2 { get; set; }
Property Value
Type | Description |
---|---|
ConstrainComponentPropName |
Remarks
If Actor2 is NULL, will look within Owner. If this is NULL, will use RootComponent of Actor2
ConstraintActor1
Pointer to first Actor to constrain.
Declaration
public Actor ConstraintActor1 { get; set; }
Property Value
Type | Description |
---|---|
Actor |
ConstraintActor2
Pointer to second Actor to constrain.
Declaration
public Actor ConstraintActor2 { get; set; }
Property Value
Type | Description |
---|---|
Actor |
ConstraintInstance
All constraint settings
Declaration
public ConstraintInstance ConstraintInstance { get; set; }
Property Value
Type | Description |
---|---|
ConstraintInstance |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static PhysicsConstraintComponent DefaultObject { get; }
Property Value
Type | Description |
---|---|
PhysicsConstraintComponent |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceBreakConstraint()
Break this constraint
Declaration
public void BreakConstraint()
GetConstraintForce()
Retrieve the constraint force most recently applied to maintain this constraint. Returns 0 forces if the constraint is not initialized or broken.
Declaration
public (Vector, Vector) GetConstraintForce()
Returns
Type | Description |
---|---|
System.ValueTuple<Vector, Vector> |
GetCurrentSwing1()
Gets the current Swing1 of the constraint
Declaration
public float GetCurrentSwing1()
Returns
Type | Description |
---|---|
System.Single |
GetCurrentSwing2()
Gets the current Swing2 of the constraint
Declaration
public float GetCurrentSwing2()
Returns
Type | Description |
---|---|
System.Single |
GetCurrentTwist()
Gets the current Angular Twist of the constraint
Declaration
public float GetCurrentTwist()
Returns
Type | Description |
---|---|
System.Single |
IsBroken()
Retrieve the status of constraint being broken.
Declaration
public bool IsBroken()
Returns
Type | Description |
---|---|
System.Boolean |
New(UObject, Name)
Spawn an object of this class
Declaration
public static PhysicsConstraintComponent New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
PhysicsConstraintComponent |
SetAngularBreakable(Boolean, Single)
Sets the Angular Breakable properties @
Declaration
public void SetAngularBreakable(bool bAngularBreakable, float AngularBreakThreshold)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bAngularBreakable | |
System.Single | AngularBreakThreshold |
Remarks
param bAngularBreakable Whether it is possible to break the joint with angular force @param AngularBreakThreshold Torque needed to break the joint
SetAngularDriveMode(Byte)
Switches the angular drive mode between SLERP and Twist And Swing @
Declaration
public void SetAngularDriveMode(byte DriveMode)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | DriveMode |
Remarks
param DriveMode The angular drive mode to use. SLERP uses shortest spherical path, but will not work if any angular constraints are locked. Twist and Swing decomposes the path into the different angular degrees of freedom but may experience gimbal lock
SetAngularDriveParams(Single, Single, Single)
Sets the drive params for the angular drive.
Declaration
public void SetAngularDriveParams(float PositionStrength, float VelocityStrength, float InForceLimit)
Parameters
Type | Name | Description |
---|---|---|
System.Single | PositionStrength | |
System.Single | VelocityStrength | |
System.Single | InForceLimit |
Remarks
@param PositionStrength Positional strength for the drive (stiffness) @param VelocityStrength Velocity strength of the drive (damping) @param InForceLimit Max force applied by the drive
SetAngularOrientationDrive(Boolean, Boolean)
Enables/Disables angular orientation drive.
Declaration
public void SetAngularOrientationDrive(bool bEnableSwingDrive, bool bEnableTwistDrive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableSwingDrive | |
System.Boolean | bEnableTwistDrive |
Remarks
Only relevant if the AngularDriveMode is set to Twist and Swing
@param bEnableSwingDrive Indicates whether the drive for the swing axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing @param bEnableTwistDrive Indicates whether the drive for the twist axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing
SetAngularOrientationTarget(Rotator)
Sets the target orientation for the angular drive.
Declaration
public void SetAngularOrientationTarget(Rotator InPosTarget)
Parameters
Type | Name | Description |
---|---|---|
Rotator | InPosTarget |
Remarks
@param InPosTarget Target orientation
SetAngularSwing1Limit(Byte, Single)
Sets the Angular Swing1 Motion Type @
Declaration
public void SetAngularSwing1Limit(byte MotionType, float Swing1LimitAngle)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | MotionType | |
System.Single | Swing1LimitAngle |
Remarks
param ConstraintType New Constraint Type @param Swing1LimitAngle Size of limit in degrees
SetAngularSwing2Limit(Byte, Single)
Sets the Angular Swing2 Motion Type @
Declaration
public void SetAngularSwing2Limit(byte MotionType, float Swing2LimitAngle)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | MotionType | |
System.Single | Swing2LimitAngle |
Remarks
param ConstraintType New Constraint Type @param Swing2LimitAngle Size of limit in degrees
SetAngularTwistLimit(Byte, Single)
Sets the Angular Twist Motion Type @
Declaration
public void SetAngularTwistLimit(byte ConstraintType, float TwistLimitAngle)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | ConstraintType | |
System.Single | TwistLimitAngle |
Remarks
param ConstraintType New Constraint Type @param TwistLimitAngle Size of limit in degrees
SetAngularVelocityDrive(Boolean, Boolean)
Set Angular Velocity Drive
Declaration
public void SetAngularVelocityDrive(bool bEnableSwingDrive, bool bEnableTwistDrive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableSwingDrive | |
System.Boolean | bEnableTwistDrive |
SetAngularVelocityDriveSLERP(Boolean)
Enables/Disables the angular velocity slerp drive.
Declaration
public void SetAngularVelocityDriveSLERP(bool bEnableSLERP)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableSLERP |
Remarks
Only relevant if the AngularDriveMode is set to SLERP
@param bEnableSLERP Indicates whether the SLERP drive should be enabled. Only relevant if the AngularDriveMode is set to SLERP
SetAngularVelocityDriveTwistAndSwing(Boolean, Boolean)
Enables/Disables angular velocity twist and swing drive.
Declaration
public void SetAngularVelocityDriveTwistAndSwing(bool bEnableTwistDrive, bool bEnableSwingDrive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableTwistDrive | |
System.Boolean | bEnableSwingDrive |
Remarks
Only relevant if the AngularDriveMode is set to Twist and Swing
@param bEnableSwingDrive Indicates whether the drive for the swing axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing @param bEnableTwistDrive Indicates whether the drive for the twist axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing
SetAngularVelocityTarget(Vector)
Sets the target velocity for the angular drive.
Declaration
public void SetAngularVelocityTarget(Vector InVelTarget)
Parameters
Type | Name | Description |
---|---|---|
Vector | InVelTarget |
Remarks
@param InVelTarget Target velocity
SetConstrainedComponents(PrimitiveComponent, Name, PrimitiveComponent, Name)
Directly specify component to connect. Will update frames based on current position.
Declaration
public void SetConstrainedComponents(PrimitiveComponent Component1, Name BoneName1, PrimitiveComponent Component2, Name BoneName2)
Parameters
Type | Name | Description |
---|---|---|
PrimitiveComponent | Component1 | |
Name | BoneName1 | |
PrimitiveComponent | Component2 | |
Name | BoneName2 |
SetConstraintReferenceFrame(Byte, Transform)
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.
Declaration
public void SetConstraintReferenceFrame(byte Frame, Transform RefFrame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | Frame | |
Transform | RefFrame |
SetConstraintReferenceOrientation(Byte, Vector, Vector)
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.
Declaration
public void SetConstraintReferenceOrientation(byte Frame, Vector PriAxis, Vector SecAxis)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | Frame | |
Vector | PriAxis | |
Vector | SecAxis |
SetConstraintReferencePosition(Byte, Vector)
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.
Declaration
public void SetConstraintReferencePosition(byte Frame, Vector RefPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | Frame | |
Vector | RefPosition |
SetDisableCollision(Boolean)
If true, the collision between the two rigid bodies of the constraint will be disabled.
Declaration
public void SetDisableCollision(bool bDisableCollision)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bDisableCollision |
SetLinearBreakable(Boolean, Single)
Sets the Linear Breakable properties @
Declaration
public void SetLinearBreakable(bool bLinearBreakable, float LinearBreakThreshold)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bLinearBreakable | |
System.Single | LinearBreakThreshold |
Remarks
param bLinearBreakable Whether it is possible to break the joint with linear force @param LinearBreakThreshold Force needed to break the joint
SetLinearDriveParams(Single, Single, Single)
Sets the drive params for the linear drive.
Declaration
public void SetLinearDriveParams(float PositionStrength, float VelocityStrength, float InForceLimit)
Parameters
Type | Name | Description |
---|---|---|
System.Single | PositionStrength | |
System.Single | VelocityStrength | |
System.Single | InForceLimit |
Remarks
@param PositionStrength Positional strength for the drive (stiffness) @param VelocityStrength Velocity strength of the drive (damping) @param InForceLimit Max force applied by the drive
SetLinearPositionDrive(Boolean, Boolean, Boolean)
Enables/Disables linear position drive @
Declaration
public void SetLinearPositionDrive(bool bEnableDriveX, bool bEnableDriveY, bool bEnableDriveZ)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableDriveX | |
System.Boolean | bEnableDriveY | |
System.Boolean | bEnableDriveZ |
Remarks
param bEnableDriveX Indicates whether the drive for the X-Axis should be enabled @param bEnableDriveY Indicates whether the drive for the Y-Axis should be enabled @param bEnableDriveZ Indicates whether the drive for the Z-Axis should be enabled
SetLinearPositionTarget(Vector)
Sets the target position for the linear drive.
Declaration
public void SetLinearPositionTarget(Vector InPosTarget)
Parameters
Type | Name | Description |
---|---|---|
Vector | InPosTarget |
Remarks
@param InPosTarget Target position
SetLinearVelocityDrive(Boolean, Boolean, Boolean)
Enables/Disables linear position drive @
Declaration
public void SetLinearVelocityDrive(bool bEnableDriveX, bool bEnableDriveY, bool bEnableDriveZ)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableDriveX | |
System.Boolean | bEnableDriveY | |
System.Boolean | bEnableDriveZ |
Remarks
param bEnableDriveX Indicates whether the drive for the X-Axis should be enabled @param bEnableDriveY Indicates whether the drive for the Y-Axis should be enabled @param bEnableDriveZ Indicates whether the drive for the Z-Axis should be enabled
SetLinearVelocityTarget(Vector)
Sets the target velocity for the linear drive.
Declaration
public void SetLinearVelocityTarget(Vector InVelTarget)
Parameters
Type | Name | Description |
---|---|---|
Vector | InVelTarget |
Remarks
@param InVelTarget Target velocity
SetLinearXLimit(Byte, Single)
Sets the LinearX Motion Type @
Declaration
public void SetLinearXLimit(byte ConstraintType, float LimitSize)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | ConstraintType | |
System.Single | LimitSize |
Remarks
param ConstraintType New Constraint Type @param LimitSize Size of limit
SetLinearYLimit(Byte, Single)
Sets the LinearY Motion Type @
Declaration
public void SetLinearYLimit(byte ConstraintType, float LimitSize)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | ConstraintType | |
System.Single | LimitSize |
Remarks
param ConstraintType New Constraint Type @param LimitSize Size of limit
SetLinearZLimit(Byte, Single)
Sets the LinearZ Motion Type @
Declaration
public void SetLinearZLimit(byte ConstraintType, float LimitSize)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | ConstraintType | |
System.Single | LimitSize |
Remarks
param ConstraintType New Constraint Type @param LimitSize Size of limit
SetOrientationDriveSLERP(Boolean)
Enables/Disables the angular orientation slerp drive.
Declaration
public void SetOrientationDriveSLERP(bool bEnableSLERP)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableSLERP |
Remarks
Only relevant if the AngularDriveMode is set to SLERP
@param bEnableSLERP Indicates whether the SLERP drive should be enabled. Only relevant if the AngularDriveMode is set to SLERP
SetOrientationDriveTwistAndSwing(Boolean, Boolean)
Enables/Disables angular orientation drive.
Declaration
public void SetOrientationDriveTwistAndSwing(bool bEnableTwistDrive, bool bEnableSwingDrive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnableTwistDrive | |
System.Boolean | bEnableSwingDrive |
Remarks
Only relevant if the AngularDriveMode is set to Twist and Swing
@param bEnableSwingDrive Indicates whether the drive for the swing axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing @param bEnableTwistDrive Indicates whether the drive for the twist axis should be enabled. Only relevant if the AngularDriveMode is set to Twist and Swing
Operators
| Improve this Doc View SourceImplicit(IntPtr to PhysicsConstraintComponent)
Convert from IntPtr to UObject
Declaration
public static implicit operator PhysicsConstraintComponent(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
PhysicsConstraintComponent |