USkeletalMeshComponent

Inheritance Hierarchy

Syntax

class USkeletalMeshComponent :
    public USkinnedMeshComponent ,
    public IInterface_CollisionDataProvider

Remarks

SkeletalMeshComponent is used to create an instance of an animated SkeletalMesh asset.

Variables

Name Description

Public variable

physx::PxAggreg...

 

Aggregate

Physics-engine representation of PxAggregate which contains a physics asset instance with more than numbers of bodies.

Public variable

FSingleAnimatio...

 

AnimationData

Protected variable

TEnumAsByte < EA ...

 

AnimationMode

Animation anim: Matinee related data start - this needs to be replaced to new system.

Public variable

UAnimBlueprintG ...

 

AnimBlueprintGeneratedClass

Public variable

TSubclassOf < UA ...

 

AnimClass

The AnimBlueprint class to use. Use 'SetAnimInstanceClass' to change at runtime.

Public variable

UAnimInstance &...

 

AnimScriptInstance

The active animation graph program instance.

Public variable

uint32: 1

 

bAnimTreeInitialised

If true, AnimTree has been initialised.

Public variable

uint32: 1

 

bAutonomousTickPose

Misc If true TickPose() will not be called from the Component's TickComponent function.

Public variable

uint32: 1

 

bBlendPhysics

Enables blending in of physics bodies whether Simulate or not

Public variable

uint32: 1

 

bClothMorphTarget

Cloth morph target option This option will be applied only before playing because should do pre-calculation to reduce computation time for run-time play so it's impossible to change this option in run-time

Public variable

uint32: 1

 

bCollideWithAttachedChildren

Can't collide with part of attached children if total collision volumes exceed 16 capsules or 32 planes per convex

Public variable

uint32: 1

 

bCollideWithEnvironment

Can't collide with part of environment if total collision volumes exceed 16 capsules or 32 planes per convex

Public variable

uint32: 1

 

bDeferredKinematicUpdate

Indicates that this SkeletalMeshComponent has deferred kinematic bone updates until next physics sim.

Public variable

uint32: 1

 

bDisableClothSimulation

Disable cloth simulation and play original animation without simulation

Public variable

uint32: 1

 

bDisplayClothBackstops

Draw back stops of clothing simulation vertices

Public variable

uint32: 1

 

bDisplayClothFixedVertices

Public variable

uint32: 1

 

bDisplayClothingCollisionVolumes

Draw Collision Volumes from apex clothing asset.

Public variable

uint32: 1

 

bDisplayClothingNormals

Draw the APEX Clothing Normals on clothing sections.

Public variable

uint32: 1

 

bDisplayClothingTangents

Draw Computed Normal Vectors in Tangent space for clothing section

Public variable

uint32: 1

 

bDisplayClothMaxDistances

Draw max distances of clothing simulation vertices

Public variable

uint32: 1

 

bDisplayClothPhysicalMeshWire

Draw clothing physical mesh wire frame

Public variable

uint32: 1

 

bEnableLineCheckWithBounds

If true, line checks will test against the bounding box of this skeletal mesh component and return a hit if there is a collision.

Public variable

uint32: 1

 

bEnablePerPolyCollision

Uses skinned data for collision data.

Public variable

uint32: 1

 

bEnablePhysicsOnDedicatedServer

If true, simulate physics for this component on a dedicated server.

Public variable

uint32: 1

 

bForceRefpose

If true, force the mesh into the reference pose - is an optimization.

Public variable

uint32: 1

 

bHasValidBodies

If true, there is at least one body in the current PhysicsAsset with a valid bone in the current SkeletalMesh

Public variable

uint32: 1

 

bIncludeComponentLocationIntoBounds

If true, the Location of this Component will be included into its bounds calculation (this can be useful when using SMU_OnlyTickPoseWhenRendered on a character that moves away from the root and no bones are left near the origin of the component)

Public variable

uint32: 1

 

bLocalSpaceSimulation

It's worth trying this option when you feel that the current cloth simulation is unstable.

Public variable

uint32: 1

 

bNoSkeletonUpdate

OptimizationSkips Ticking and Bone Refresh.

Public variable

TArray < struct ...

 

Bodies

Array of FBodyInstance objects, storing per-instance state about about each body.

Public variable

int32

 

BodyIndex

Public variable

UBodySetup *...

 

BodySetup

Used for per poly collision.

Public variable

uint32: 1

 

bOldForceRefPose

If bForceRefPose was set last tick.

Public variable

TArray < FTransf ...

 

BoneSpaceTransforms

Temporary array of local-space (relative to parent bone) rotation/translation for each bone.

Public variable

uint32: 1

 

bPauseAnims

Pauses this component's animations (doesn't tick them, but still refreshes bones)

Public variable

bool

 

bPreparedClothMorphTargets

Used for checking whether cloth morph target data were pre-computed or not

Public variable

uint32: 1

 

bPrevDisableClothSimulation

To save previous state

Public variable

uint32: 1

 

bRequiredBonesUpToDate

If false, indicates that on the next call to UpdateSkelPose the RequiredBones array should be recalculated.

Public variable

uint32: 1

 

bResetAfterTeleport

Reset the clothing after moving the clothing position (called teleport)

Public variable

uint32: 1

 

bShowPrePhysBones

Bool that enables debug drawing of the skeleton before it is passed to the physics.

Public variable

uint32: 1

 

bUpdateJointsFromAnimation

If we should pass joint position to joints each frame, so that they can be used by motorized joints to drive the ragdoll based on the animation.

Public variable

bool

 

bUseRefPoseOnInitAnim

On InitAnim should we set to ref pose (if false use first tick of animation data)

Public variable

uint16

 

CachedAnimCurveUidVersion

Cache AnimCurveUidVersion from Skeleton and this will be used to identify if it needs to be updated

Public variable

TArray < FTransf ...

 

CachedBoneSpaceTransforms

Update Rate.

Public variable

TArray < FTransf ...

 

CachedComponentSpaceTransforms

Cached SpaceBases for Update Rate optimization.

Public variable

FBlendedHeapCur ...

 

CachedCurve

Cached Curve result for Update Rate optimization

Public variable

TArray < nvidia:...

 

ChildrenCollisions

Public variable

float

 

ClothBlendWeight

Weight to blend between simulated results and key-framed positions if weight is 1.0, shows only cloth simulation results and 0.0 will show only skinned results

Public variable

uint32

 

ClothingCollisionRevision

Increase every tick to update clothing collision

Public variable

float

 

ClothMaxDistanceScale

Public variable

TArray < FClothM ...

 

ClothMorphTargets

Precomputed actual cloth morph target data

Public variable

TMap < TWeakObje ...

 

ClothOverlappedComponentsMap

Public variable

float

 

ClothTeleportCosineThresholdInRad

Used for pre-computation using TeleportRotationThreshold property

Public variable

float

 

ClothTeleportDistThresholdSquared

Used for pre-computation using tTeleportDistanceThreshold property

Public variable

FClothingActor: ...

 

ClothTeleportMode

Whether we need to teleport cloth.

Public variable

FSkeletalMeshCo ...

 

ClothTickFunction

WITH_PHYSX.

Public variable

TArray < struct ...

 

Constraints

Array of FConstraintInstance structs, storing per-instance state about each constraint.

Public variable

TArray < nvidia:...

 

EnvironmentCollisions

Public variable

TArray < FBoneIn...

 

FillComponentSpaceTransformsRequiredBones

Temporary array of bone indices required to populate component space transforms

Public variable

float

 

GlobalAnimRateScale

Used to scale speed of all animations on this skeletal mesh.

Public variable

TEnumAsByte < EK ...

 

KinematicBonesUpdateType

If we are running physics, should we update non-simulated bones based on the animation bone positions.

Public variable

float

 

LastPoseTickTime

Keep track of when animation has been ticked to ensure it is ticked only once per frame.

Public variable

FVector

 

LineCheckBoundsScale

If bEnableLineCheckWithBounds is true, scale the bounds by this value before doing line check.

Public variable

FConstraintBrok ...

 

OnConstraintBroken

Notification when constraint is broken.

Public variable

FOnSkeletalMesh ...

 

OnSkeletalMeshPropertyChanged

Public variable

TArray < nvidia:...

 

ParentCollisions

Public variable

TEnumAsByte < EP ...

 

PhysicsTransformUpdateMode

Whether physics simulation updates component transform.

Public variable

UAnimInstance &...

 

PostProcessAnimInstance

An instance created from the PostPhysicsBlueprint property of the skeletal mesh we're using, Runs after physics has been blended

Public variable

int32

 

RagdollAggregateThreshold

Threshold for physics asset bodies above which we use an aggregate for broadphase collisions

Public variable

TArray < FBoneIn...

 

RequiredBones

Temporary array of bone indices required this frame. Filled in by UpdateSkelPose.

Public variable

USkeletalMeshCo...

 

RootBodyData

Index of the 'Root Body', or top body in the asset hierarchy.

Public variable

FVector

 

RootBoneTranslation

Offset of the root bone from the reference pose. Used to offset bounding box.

Public variable

TArray < UAnimIn ...

 

SubInstances

Any running sub anim instances that need to be updates on the game thread

Public variable

float

 

TeleportDistanceThreshold

Conduct teleportation if the character's movement is greater than this threshold in 1 frame.

Public variable

float

 

TeleportRotationThreshold

Rotation threshold in degree, ranging from 0 to 180 conduct teleportation if the character's rotation is greater than this threshold in 1 frame.

Public variable

FTransform

 

TransformToRoot

Functions

Name Description

Public function

void

 

AccumulateAllBodiesBelowPhysicsBlendWeight

(
    const FName & InBoneName,
    float AddPhysicsBlendWeight,
    bool bSkipCustomPhysicsType
)

Accumulate AddPhysicsBlendWeight to physics blendweight for all of the bones below passed in bone to be simulated

Public function

void

 

AddClothingBounds

(
    FBoxSphereBounds & InOutBounds,
    const FTransform & LocalToWorld
)

Add bounding box for cloth

Public function Virtual

void

 

AddForceToAllBodiesBelow

(
    FVector Force,
    FName BoneName,
    bool bAccelChange,
    bool bIncludeSelf
)

Add a force to all rigid bodies below.

Public function Virtual

void

 

AddImpulseToAllBodiesBelow

(
    FVector Impulse,
    FName BoneName,
    bool bVelChange,
    bool bIncludeSelf
)

Add impulse to all single rigid bodies below. Good for one time instant burst.

Public function

void

 

ApplyAnimationCurvesToComponent

(
    const TMap < FName , float >* In...,
    const TMap < FName , float >* In...
)

Apply animation curves to this component

Public function

void

 

ApplyDeltaToAllPhysicsTransforms

(
    const FVector & DeltaLocation,
    const FQuat & DeltaRotation
)

Set physics transforms for all bodies

Public function

void

 

BindClothToMasterPoseComponent()

If this component has a valid MasterPoseComponent then this function makes cloth items on the slave component take the transforms of the cloth items on the master component instead of simulating separately.

Public function

void

 

BlendInPhysics

(
    FTickFunction& ThisTickFunction
)

Take the results of the physics and blend them with the animation state (based on the PhysicsWeight parameter), and update the SpaceBases array.

Public function

void

 

BlendPhysicsBones

(
    TArray < FBoneIndexType >& Bones
)

Blend of Physics Bones with PhysicsWeight and Animated Bones with (1-PhysicsWeight)

Public function

void

 

BreakConstraint

(
    FVector Impulse,
    FVector HitLocation,
    FName InBoneName
)

Break a constraint off a Gore mesh.

Public function

void

 

ChangeClothMorphTargetMapping

(
    FClothMorphTargetData & MorphData,
    FName CurrentActivatedMorphName
)

Change morph target mapping when active morph target is changed

Public function Virtual

void

 

CheckClothTeleport()

Check whether clothing teleport is needed or not to avoid a weird simulation result

Public function Virtual

void

 

ClearAnimNotifyErrors

(
    UObject * InSourceNotify
)

Clears currently stored errors. Call before triggering anim notifies for a particular mesh.

Public function

void

 

ClearMorphTargets()

Clear all Morph Target that are set to this mesh

Public function

void

 

CompleteParallelAnimationEvaluation

(
    bool bDoPostAnimEvaluation
)

Public function

FRootMotionM ...

 

ConsumeRootMotion()

Public function

FTransform

 

ConvertLocalRootMotionToWorld

(
    const FTransform & InTransform
)

Take extracted RootMotion and convert it from local space to world space.

Public function

void

 

CopyChildrenClothCollisionsToParent()

Copy children's cloth collisions to parent, where parent means this component

Public function

void

 

CopyClothCollisionsToChildren()

Copy parent's cloth collisions to attached children, where parent means this component

Public function

void

 

CreateBodySetup()

Public function

bool

 

CreateClothingActor

(
    int32 AssetIndex,
    nvidia::apex::ClothingAsset* C...,
    TArray < FVector >* BlendedDelt...
)

APEX clothing actor is created from APEX clothing asset for cloth simulation create only if became invalid BlendedData : added for cloth morph target but not used commonly

Public function

void

 

CreateInternalClothCollisions

(
    TArray < FApexClothCollisionVolumeDa ...,
    TArray < nvidia::apex::ClothingColli...
)

Create Apex clothing collisions from input collision info and add them to clothing actors

Public function

FApexClothCo ...

 

CreateNewClothingCollsions

(
    UPrimitiveComponent * Primitive...
)

Create new collisions when newly added

Public function

void

 

DebugDrawBones

(
    UCanvas * Canvas,
    bool bSimpleBones
)

Debug render skeletons bones to supplied canvas

Render bones for debug display

Public function

void

 

DrawClothingBackstops

(
    FPrimitiveDrawInterface * PDI
)

Draws Clothing back stops

Public function

void

 

DrawClothingCollisionVolumes

(
    FPrimitiveDrawInterface * PDI
)

Draws internal collision volumes which the character has, colliding with cloth

Public function

void

 

DrawClothingFixedVertices

(
    FPrimitiveDrawInterface * PDI
)

Public function

void

 

DrawClothingMaxDistances

(
    FPrimitiveDrawInterface * PDI
)

Draws max distances of clothing simulation vertices clothing simulation will be disabled and animation will be reset when drawing this option because max distances do have meaning only in initial pose

Public function

void

 

DrawClothingNormals

(
    FPrimitiveDrawInterface * PDI
)

Draws APEX Clothing simulated normals on cloth meshes

Public function

void

 

DrawClothingPhysicalMeshWire

(
    FPrimitiveDrawInterface * PDI
)

Draws Clothing Physical mesh wire

Public function

void

 

DrawClothingTangents

(
    FPrimitiveDrawInterface * PDI
)

Draws APEX Clothing Graphical Tangents on cloth meshes

Public function

void

 

DrawDebugClothCollisions()

Draws currently intersected collisions

Public function

void

 

DrawDebugConvexFromPlanes

(
    FClothCollisionPrimitive & Collisio...,
    FColor & Color,
    bool bDrawWithPlanes
)

Draws a convex from planes for debug info

Public function

void

 

EvaluatePostProcessMeshInstance

(
    TArray < FTransform >& OutBoneSpace...,
    FBlendedHeapCurve & OutCurve,
    const USkeletalMesh * InSkeleta...,
    FVector & OutRootBoneTranslation
)

Evaluates the post process instance from the skeletal mesh this component is using.

Public function

void

 

FindClothCollisions

Find if this component has collisions for clothing and return the results calculated by bone transforms

Public function

FName

 

FindConstraintBoneName

(
    int32 ConstraintIndex
)

Find Constraint Name from index

Constraint Joint Name

Public function

int32

 

FindConstraintIndex

(
    FName ConstraintName
)

Find Constraint Index from the name

Constraint Index

Public function

FConstraintI...

 

FindConstraintInstance

(
    FName ConName
)

Find instance of the constraint that matches the name supplied.

Public function

int32

 

FindRootBodyIndex()

Find the root body index

Public function

void

 

ForceClothNextUpdateTeleport()

Used to indicate we should force 'teleport' during the next call to UpdateClothState, This will transform positions and velocities and thus keep the simulation state, just translate it to a new pose.

Public function

void

 

ForceClothNextUpdateTeleportAndReset()

Used to indicate we should force 'teleport and reset' during the next call to UpdateClothState.

Public function

int32

 

ForEachBodyBelow

(
    FName BoneName,
    bool bIncludeSelf,
    bool bSkipCustomType,
    TFunctionRef < void(FBodyInstance &#...
)

Iterates over all bodies below and executes Func. Returns number of bodies found

Public function

void

 

FreezeClothSection

(
    bool bFreeze
)

Freezing clothing actor now

Public function

const FBlend ...

 

GetAnimationCurves()

Access Curve Array for reading

Public function

EAnimationMo ...

 

GetAnimationMode()

Public function

UAnimInstanc ...

 

GetAnimInstance()

Returns the animation instance that is driving the class (if available).

Public function

float

 

GetBoneMass

(
    FName BoneName,
    bool bScaleMass
)

Returns the mass (in kg) of the given bone

Public function

FVector

 

GetClosestCollidingRigidBodyLocation

(
    const FVector & TestLocation
)

Iterates through all bodies in our PhysicsAsset and returns the location of the closest bone associated with a body that has collision enabled.

Public function

bool

 

GetClosestPointOnPhysicsAsset

(
    const FVector & WorldPosition,
    FClosestPointOnPhysicsAsset & Close...,
    bool bApproximate
)

Given a world position, find the closest point on the physics asset.

Public function

bool

 

GetClothCollisionDataFromStaticMesh

(
    UPrimitiveComponent * PrimComp,
    TArray < FClothCollisionPrimitive > ...
)

Get collision data from a static mesh only for collision with clothes.

Public function

const TArray ...

 

GetClothingActors()

Public function

float

 

GetClothMaxDistanceScale()

Get/Set the max distance scale of clothing mesh vertices

Public function

void

 

GetClothRootBoneMatrix

(
    int32 AssetIndex,
    FMatrix & OutRootBoneMatrix
)

Get root bone matrix by the root bone index which Apex cloth asset is holding

Public function

bool

 

GetClothSimulatedPosition

(
    int32 AssetIndex,
    int32 VertexIndex,
    FVector & OutSimulPos
)

If the vertex index is valid for simulated vertices, returns the position in world space

Public function

void

 

GetCurrentJointAngles

(
    FName InBoneName,
    float& Swing1Angle,
    float& TwistAngle,
    float& Swing2Angle
)

Gets the current Angular state for a named bone constraint

Public function

const FBlend ...

 

GetEditableAnimationCurves()

Public function

FBlendedHeap ...

 

GetEditableAnimationCurves()

Get Access to the current editable Curve Array - uses same buffer as space bases

Public function

float

 

GetMorphTarget

(
    FName MorphTargetName
)

Get Morph target with given name

Public function

const TMap < ...

 

GetMorphTargetCurves()

Public function

float

 

GetPlayRate()

Animation play functions

Public function

float

 

GetPosition()

Animation play functions

Public function

UAnimInstanc ...

 

GetPostProcessInstance()

Returns the active post process instance is one is available.

Public function

UAnimSingleN ...

 

GetSingleNodeInstance()

Public function

FVector

 

GetSkeletalCenterOfMass()

Returns the center of mass of the skeletal mesh, instead of the root body's location

Public function

float

 

GetTotalMassBelowBone

(
    FName InBoneName
)

Utility which returns total mass of all bones below the supplied one in the hierarchy (including this one).

Public function

void

 

GetUpdateClothSimulationData

(
    TMap < int32, FClothSimulData >& Ou...,
    USkeletalMeshComponent * Overri...
)

Store cloth simulation data into OutClothSimData

Public function

bool

 

HandleExistingParallelEvaluationTask

(
    bool bBlockOnTask,
    bool bPerformPostAnimEvaluation
)

Management function for if we want to do an evaluation but may already be running one bBlockOnTask - if true and we are currently performing parallel eval we wait for it to finish bPerformPostAnimEvaluation - if true and we are currently performing parallel eval we call PostAnimEvaluation too return true if parallel task was running.

Public function

bool

 

HasValidClothingActors()

Only check whether there are valid clothing actors or not

Public function Virtual

void

 

InitAnim

(
    bool bForceReinit
)

Animation

Public function

void

 

InitArticulated

(
    FPhysScene * PhysScene
)

Initialize PhysicsAssetInstance for the physicsAsset

Public function

bool

 

InitializeAnimScriptInstance

(
    bool bForceReinit
)

Public function

void

 

InitSkelControls()

Initialize SkelControls

Public function

bool

 

IsAnimBlueprintInstanced()

WITH_CLOTH_COLLISION_DETECTION.

Public function

bool

 

IsBodyGravityEnabled

(
    FName BoneName
)

Checks whether or not gravity is enabled on the given bone.

Public function

bool

 

IsClothBoundToMasterComponent()

Public function

bool

 

IsPlaying()

Animation play functions

Public function

bool

 

IsRunningParallelEvaluation()

Returns whether we are currently trying to run a parallel animation evaluation task.

Public function

bool

 

IsValidClothingActor

(
    const FClothingActor & ClothingActo...
)

Public function Virtual

bool

 

IsWindEnabled()

True if wind is enabled

Public function

bool

 

K2_GetClosestPointOnPhysicsAsset

(
    const FVector & WorldPosition,
    FVector & ClosestWorldPosition,
    FVector & Normal,
    FName & BoneName,
    float& Distance
)

Given a world position, find the closest point on the physics asset.

Public function

void

 

LoadAllClothingVisualizationInfos()

Public function

void

 

LoadClothingVisualizationInfo

(
    FClothingAssetData & ClothAssetData
)

Loads clothing extra infos dynamically just for Previewing in Editor such as MaxDistances, Physical mesh wire

Protected function

bool

 

NeedToSpawnAnimScriptInstance()

Protected function

bool

 

NeedToSpawnPostPhysicsInstance()

Public function Virtual

void

 

NotifySkelControlBeyondLimit

(
    USkelControlLookAt* LookAt
)

Notifier when look at control goes beyond of limit - candidate for delegate

Public function

void

 

OverrideAnimationData

(
    UAnimationAsset * InAnimToPlay,
    bool bIsLooping,
    bool bIsPlaying,
    float Position,
    float PlayRate
)

This overrides current AnimationData parameter in the SkeletalMeshComponent.

Public function

void

 

ParallelAnimationEvaluation()

Parallel evaluation wrappers.

Public function

void

 

PerformAnimationEvaluation

(
    const USkeletalMesh * InSkeleta...,
    UAnimInstance * InAnimInstance,
    TArray < FTransform >& OutSpaceBase...,
    TArray < FTransform >& OutBoneSpace...,
    FVector & OutRootBoneTranslation,
    FBlendedHeapCurve & OutCurve
)

Runs the animation evaluation for the current pose into the supplied variables

Public function

void

 

Play

(
    bool bLooping
)

Animation play functions

Public function

void

 

PlayAnimation

(
    UAnimationAsset * NewAnimToPlay,
    bool bLooping
)

Animation play functions

Public function

bool

 

PoseTickedThisFrame()

Checked whether we have already ticked the pose this frame

Public function

void

 

PostAnimEvaluation

(
    FAnimationEvaluationContext & Evalu...
)

Public function

void

 

PrepareClothMorphTargets()

Methods for cloth morph targets pre-compute morph target data for clothing

Public function

void

 

ProcessClothCollisionWithEnvironment()

Public function

void

 

RecalcRequiredBones

(
    int32 LODIndex
)

Recalculates the RequiredBones array in this SkeletalMeshComponent based on current SkeletalMesh, LOD and PhysicsAsset.

Public function

void

 

RecalcRequiredCurves()

Recalculates the AnimCurveUids array in RequiredBone of this SkeletalMeshComponent based on current required bone set Is called when Skeleton->IsRequiredCurvesUpToDate() = false

Public function

void

 

RecreateClothingActors()

Should call this method if occurred any changes in clothing assets

Public function

void

 

RegisterClothTick

(
    bool bRegister
)

Handle registering our pre cloth tick function.

Public function

void

 

RegisterEndPhysicsTick

(
    bool bRegister
)

Handle registering our end physics tick function.

Public function

FDelegateHan ...

 

RegisterOnPhysicsCreatedDelegate

(
    const FOnSkelMeshPhysicsCreated& D...
)

Register/Unregister for physics state creation callback

Public function

FDelegateHan ...

 

RegisterOnSkeletalMeshPropertyChanged

(
    const FOnSkeletalMeshPropertyChange ...
)

Register / Unregister delegates called when the skeletal mesh property is changed

Public function

void

 

ReleaseAllChildrenCollisions()

Public function

void

 

ReleaseAllClothingResources()

Public function

void

 

ReleaseAllParentCollisions()

Public function

void

 

ReleaseClothingCollision

(
    nvidia::apex::ClothingCollision...
)

Public function

void

 

RemoveAllClothingActors()

Public function

void

 

RemoveAllOverlappedComponentMap()

Public function Virtual

void

 

ReportAnimNotifyError

(
    const FText & Error,
    UObject * InSourceNotify
)

Subclasses such as DebugSkelMeshComponent keep track of errors in the anim notifies so they can be displayed to the user.

Public function

void

 

ResetAllBodiesSimulatePhysics()

Allows you to reset bodies Simulate state based on where bUsePhysics is set to true in the BodySetup.

Public function

void

 

ResetClothTeleportMode()

Reset the teleport mode of a next update to 'Continuous'

Public function

void

 

ResetRootBodyIndex()

Reset Root Body Index

Public function

void

 

SetAllBodiesBelowPhysicsBlendWeight

(
    const FName & InBoneName,
    float PhysicsBlendWeight,
    bool bSkipCustomPhysicsType,
    bool bIncludeSelf
)

Set all of the bones below passed in bone to be simulated

Public function

void

 

SetAllBodiesBelowSimulatePhysics

(
    const FName & InBoneName,
    bool bNewSimulate,
    bool bIncludeSelf
)

Set all of the bones below passed in bone to be simulated

Public function

void

 

SetAllBodiesCollisionObjectType

(
    ECollisionChannel NewChannel
)

Set the movement channel of all bodies

Public function

void

 

SetAllBodiesNotifyRigidBodyCollision

(
    bool bNewNotifyRigidBodyCollision
)

Set the rigid body notification state for all bodies.

Public function

void

 

SetAllBodiesPhysicsBlendWeight

(
    float PhysicsBlendWeight,
    bool bSkipCustomPhysicsType
)

Public function

void

 

SetAllBodiesSimulatePhysics

(
    bool bNewSimulate
)

Set bSimulatePhysics to true for all bone bodies.

Public function

void

 

SetAllMotorsAngularDriveParams

(
    float InSpring,
    float InDamping,
    float InForceLimit,
    bool bSkipCustomPhysicsType
)

Set Angular Drive motors params for all constraint instances

Public function

void

 

SetAllMotorsAngularPositionDrive

(
    bool bEnableSwingDrive,
    bool bEnableTwistDrive,
    bool bSkipCustomPhysicsType
)

Enable or Disable AngularPositionDrive.

Public function

void

 

SetAllMotorsAngularVelocityDrive

(
    bool bEnableSwingDrive,
    bool bEnableTwistDrive,
    bool bSkipCustomPhysicsType
)

Enable or Disable AngularVelocityDrive.

Public function Virtual

void

 

SetAllPhysicsAngularVelocity

(
    FVector const& NewVel,
    bool bAddToCurrent
)

Public function

void

 

SetAngularLimits

(
    FName InBoneName,
    float Swing1LimitAngle,
    float TwistLimitAngle,
    float Swing2LimitAngle
)

Sets the Angular Motion Ranges for a named bone

Public function

void

 

SetAnimation

(
    UAnimationAsset * NewAnimToPlay
)

Animation play functions

Public function

void

 

SetAnimationMode

(
    EAnimationMode::Type InAnimationMod...
)

Below are the interface to control animation when animation mode, not blueprint mode

Public function

void

 

SetAnimInstanceClass

(
    UClass * NewClass
)

Public function Virtual

void

 

SetBodyNotifyRigidBodyCollision

(
    bool bNewNotifyRigidBodyCollision,
    FName BoneName
)

Changes the value of bNotifyRigidBodyCollision for a given body

Public function

void

 

SetClothingLOD

(
    int32 LODIndex
)

Changes clothing LODs, if clothing LOD is disabled or LODIndex is greater than apex clothing LODs, simulation will be disabled

Public function

void

 

SetClothMaxDistanceScale

(
    float Scale
)

Public function

void

 

SetConstraintProfile

(
    FName JointName,
    FName ProfileName,
    bool bDefaultIfNotFound
)

Sets the constraint profile properties (limits, motors, etc...) to match the constraint profile as defined in the physics asset.

Public function

void

 

SetConstraintProfileForAll

(
    FName ProfileName,
    bool bDefaultIfNotFound
)

Sets the constraint profile properties (limits, motors, etc...) to match the constraint profile as defined in the physics asset for all constraints.

Public function

void

 

SetEnableBodyGravity

(
    bool bEnableGravity,
    FName BoneName
)

Enables or disables gravity for the given bone.

Public function

void

 

SetEnableGravityOnAllBodiesBelow

(
    bool bEnableGravity,
    FName BoneName,
    bool bIncludeSelf
)

Enables or disables gravity to all bodies below the given bone.

Public function

void

 

SetEnablePhysicsBlending

(
    bool bNewBlendPhysics
)

Disable physics blending of bones

Public function

void

 

SetForceRefPose

(
    bool bNewForceRefPose
)

Change whether to force mesh into ref pose (and use cheaper vertex shader)

Public function

void

 

SetMorphTarget

(
    FName MorphTargetName,
    float Value,
    bool bRemoveZeroWeight
)

Set Morph Target with Name and Value(0-1)

Public function

void

 

SetNamedMotorsAngularPositionDrive

(
    bool bEnableSwingDrive,
    bool bEnableTwistDrive,
    const TArray < FName >& BoneNames,
    bool bSetOtherBodiesToComplement
)

Enable or Disable AngularPositionDrive based on a list of bone names

Public function

void

 

SetNamedMotorsAngularVelocityDrive

(
    bool bEnableSwingDrive,
    bool bEnableTwistDrive,
    const TArray < FName >& BoneNames,
    bool bSetOtherBodiesToComplement
)

Enable or Disable AngularVelocityDrive based on a list of bone names

Public function Virtual

void

 

SetNotifyRigidBodyCollisionBelow

(
    bool bNewNotifyRigidBodyCollision,
    FName BoneName,
    bool bIncludeSelf
)

Changes the value of bNotifyRigidBodyCollision on all bodies below a given bone

Public function

void

 

SetPhysicsBlendWeight

(
    float PhysicsBlendWeight
)

This is global set up for setting physics blend weight This does multiple things automatically If PhysicsBlendWeight == 1.f, it will enable Simulation, and if PhysicsBlendWeight == 0.f, it will disable Simulation.

Public function

void

 

SetPlayRate

(
    float Rate
)

Animation play functions

Public function

void

 

SetPosition

(
    float InPos,
    bool bFireNotifies
)

Animation play functions

Public function

void

 

SetRootBodyIndex

(
    int32 InBodyIndex
)

Set Root Body Index

Public function

void

 

SetSkeletalMeshWithoutResettingAnimation

(
    USkeletalMesh * NewMesh
)

Public function Virtual

void

 

SkelMeshCompOnParticleSystemFinished

(
    UParticleSystemComponent * PSC
)

We detach the Component once we are done playing it.

Public function

void

 

Stop()

Animation play functions

Public function

void

 

TermArticulated()

Turn off all physics and remove the instance.

Public function

void

 

TermBodiesBelow

(
    FName ParentBoneName
)

Terminate physics on all bodies below the named bone

Public function

void

 

TickAnimation

(
    float DeltaTime,
    bool bNeedsValidRootMotion
)

Tick Animation system

Public function

void

 

TickClothing

(
    float DeltaTime,
    FTickFunction& ThisTickFunction
)

Tick Clothing Animation , basically this is called inside TickComponent

Public function

void

 

UnbindClothFromMasterPoseComponent

(
    bool bRestoreSimulationSpace
)

If this component has a valid MasterPoseComponent and has previously had its cloth bound to the MCP, this function will unbind the cloth and resume simulation.

Public function

void

 

UnregisterOnPhysicsCreatedDelegate

(
    const FDelegateHandle & DelegateHan...
)

Public function

void

 

UnregisterOnSkeletalMeshPropertyChanged

(
    FDelegateHandle Handle
)

Public function

void

 

UpdateBoneBodyMapping()

Update the bone mapping on each body instance.

Public function

void

 

UpdateClothMorphTarget()

Update active morph target's blending data when morph weight is changed

Public function

void

 

UpdateClothStateAndSimulate

(
    float DeltaTime,
    FTickFunction& ThisTickFunction
)

Updates all clothing animation states including ComponentToWorld-related states.

Public function

void

 

UpdateClothTransform

(
    ETeleportType TeleportType
)

Updates cloth collision outside the cloth asset (environment collision, child collision, etc...) Should be called when scene changes or world position changes

Public function

void

 

UpdateHasValidBodies()

Update bHasValidBodies flag

Public function

void

 

UpdateKinematicBonesToAnim

(
    const TArray < FTransform >& InComp...,
    ETeleportType Teleport,
    bool bNeedsSkinning,
    EAllowKinematicDeferral DeferralAll...
)

Iterate over each physics body in the physics for this mesh, and for each 'kinematic' (ie fixed or default if owner isn't simulating) one, update its transform based on the animated transform.

Public function

void

 

UpdateMeshForBrokenConstraints()

Look up all bodies for broken constraints.

Public function

void

 

UpdateOverlappedComponent

(
    UPrimitiveComponent * PrimComp,
    FApexClothCollisionInfo * Info
)

For non-static collisions which need to be updated every tick

Public function

void

 

UpdateRBJointMotors()

Iterate over each joint in the physics for this mesh, setting its AngularPositionTarget based on the animation information.

Public function

void

 

ValidateAnimation()

Validates the animation asset or blueprint, making sure it is compatible with the current skeleton

Overridden from USkinnedMeshComponent

Name Description

Public function Virtual

bool

 

AllocateTransformData()

Allocate Transform Data array including SpaceBases, BoneVisibilityStates

Public function Virtual

void

 

DeallocateTransformData()

Public function Virtual

void

 

FinalizeBoneTransform()

Finalize bone transform of this current tick After this function, any query to bone transform should be latest of the data

Public function Virtual

FVector

 

GetSkinnedVertexPosition

(
    int32 VertexIndex
)

Simple, CPU evaluation of a vertex's skinned position (returned in component space)

Public function Virtual

void

 

HideBone

(
    int32 BoneIndex,
    EPhysBodyOp PhysBodyOption
)

Hides the specified bone. You can also set option for physics body.

Public function Virtual

bool

 

IsPlayingRootMotion()

Public function Virtual

bool

 

IsPlayingRootMotionFromEverything()

Public function Virtual

void

 

RefreshBoneTransforms

(
    FActorComponentTickFunction* T...
)

Update functions Refresh Bone Transforms Each class will need to implement this function Ideally this function should be atomic (not relying on Tick or any other update.)

Public function Virtual

void

 

SetPhysicsAsset

(
    UPhysicsAsset* NewPhysicsAsset,
    bool bForceReInit
)

Override the Physics Asset of the mesh.

Public function Virtual

void

 

SetSkeletalMesh

(
    USkeletalMesh * NewMesh,
    bool bReinitPose
)

Change the SkeletalMesh that is rendered for this Component.

Public function Virtual

bool

 

ShouldTickPose()

Should tick pose (by calling TickPose) in Tick

: return true if should Tick. false otherwise.

Public function Virtual

bool

 

ShouldUpdateTransform

(
    bool bLODHasChanged
)

Should update transform in Tick

: return true if need transform update. false otherwise.

Public function Virtual

void

 

TickPose

(
    float DeltaTime,
    bool bNeedsValidRootMotion
)

Tick Pose, this function ticks and do whatever it needs to do in this frame, should be called before RefreshBoneTransforms

Public function Virtual

void

 

UnHideBone

(
    int32 BoneIndex
)

Unhides the specified bone.

Public function Virtual

bool

 

UpdateLODStatus()

Update the PredictedLODLevel and MaxDistanceFactor in the component from its MeshObject.

Public function Virtual

void

 

UpdateSlaveComponent()

Update Slave Component. This gets called when MasterPoseComponent!=NULL

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

void

 

AddRadialForce

(
    FVector Origin,
    float Radius,
    float Strength,
    ERadialImpulseFalloff Falloff,
    bool bAccelChange
)

Add a force to all bodies in this component, originating from the supplied world-space location.

Public function Virtual

void

 

AddRadialImpulse

(
    FVector Origin,
    float Radius,
    float Strength,
    ERadialImpulseFalloff Falloff,
    bool bVelChange
)

Add an impulse to all rigid bodies in this component, radiating out from the specified position.

Public function Virtual

float

 

CalculateMass

(
    FName BoneName
)

Returns the calculated mass in kg.

Public function Virtual

bool

 

CanEditSimulatePhysics()

Determines whether or not the simulate physics setting can be edited interactively on this component

Public function Virtual

bool

 

ComponentIsTouchingSelectionBox

(
    const FBox & InSelBBox,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied bounding box intersects with the component.

Public function Virtual

bool

 

ComponentIsTouchingSelectionFrustum

(
    const FConvexVolume & InFrustum,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied frustum intersects with the component.

Protected function Virtual

bool

 

ComponentOverlapComponentImpl

(
    UPrimitiveComponent * PrimComp,
    const FVector Pos,
    const FQuat & Rot,
    const FCollisionQueryParams & Param...
)

Override this method for custom behavior.

Protected function Virtual

bool

 

ComponentOverlapMultiImpl

(
    TArray < struct FOverlapResult >& O...,
    const UWorld * InWorld,
    const FVector & Pos,
    const FQuat & Rot,
    ECollisionChannel TestChannel,
    const FComponentQueryParams & Param...,
    const FCollisionObjectQueryParams &...
)

Test the collision of the supplied component at the supplied location/rotation, and determine the set of components that it overlaps

Public function Virtual

bool

 

DoCustomNavigableGeometryExport

(
    FNavigableGeometryExport & GeomExpo...
)

Collects custom navigable geometry of component.

Public function Virtual

FBodyInstanc ...

 

GetBodyInstance

(
    FName BoneName,
    bool bGetWelded
)

Get a BodyInstance from this component.

Public function Virtual

UBodySetup &...

 

GetBodySetup()

Return the BodySetup to use for this PrimitiveComponent (single body case)

Protected function Virtual

FTransform

 

GetComponentTransformFromBodyInstance

(
    FBodyInstance * UseBI
)

Called to get the Component To World Transform from the Root BodyInstance This needs to be virtual since SkeletalMeshComponent Root has to undo its own transform Without this, the root LocalToAtom is overridden by physics simulation, causing kinematic velocity to accelerate simulation

Public function Virtual

float

 

GetMass()

Returns the mass of this component in kg.

Public function Virtual

bool

 

GetSquaredDistanceToCollision

(
    const FVector & Point,
    float& OutSquaredDistance,
    FVector & OutClosestPointOnCollisio...
)

Returns The square of the distance to closest Body Instance surface.

Public function Virtual

void

 

GetWeldedBodies

(
    TArray < FBodyInstance * >& Out...,
    TArray < FName >& OutLabels,
    bool bIncludingAutoWeld
)

Adds the bodies that are currently welded to the OutWeldedBodies array

Public function Virtual

bool

 

IsAnyRigidBodyAwake()

Returns if any body in this component is currently awake and simulating.

Public function Virtual

bool

 

IsGravityEnabled()

Returns whether this component is affected by gravity.

Public function Virtual

bool

 

LineTraceComponent

(
    FHitResult & OutHit,
    const FVector Start,
    const FVector End,
    const FCollisionQueryParams & Param...
)

Trace a ray against just this component.

true if a hit is found

Public function Virtual

void

 

OnComponentCollisionSettingsChanged()

Called when the BodyInstance ResponseToChannels, CollisionEnabled or bNotifyRigidBodyCollision changes, in case subclasses want to use that information.

Public function Virtual

bool

 

OverlapComponent

(
    const FVector & Pos,
    const FQuat & Rot,
    const FCollisionShape & CollisionSh...
)

Test the collision of the supplied shape at the supplied location, and determine if it overlaps this component.

Public function Virtual

void

 

PutAllRigidBodiesToSleep()

Force all bodies in this component to sleep.

Public function Virtual

void

 

SetAllMassScale

(
    float InMassScale
)

Change the mass scale used fo all bodies in this component

Public function Virtual

void

 

SetAllPhysicsLinearVelocity

(
    FVector NewVel,
    bool bAddToCurrent
)

Set the linear velocity of all bodies in this component.

Public function Virtual

void

 

SetAllPhysicsPosition

(
    FVector NewPos
)

Set the position of all bodies in this component.

Public function Virtual

void

 

SetAllPhysicsRotation

(
    FRotator NewRot
)

Set the rotation of all bodies in this component.

Public function Virtual

void

 

SetAllPhysicsRotation

(
    const FQuat & NewRot
)

Set the rotation of all bodies in this component.

Public function Virtual

void

 

SetEnableGravity

(
    bool bGravityEnabled
)

Enables/disables whether this component is affected by gravity.

Public function Virtual

void

 

SetNotifyRigidBodyCollision

(
    bool bNewNotifyRigidBodyCollision
)

Changes the value of bNotifyRigidBodyCollision

Public function Virtual

void

 

SetPhysMaterialOverride

(
    UPhysicalMaterial* NewPhysMate...
)

Changes the current PhysMaterialOverride for this component.

Public function Virtual

void

 

SetSimulatePhysics

(
    bool bSimulate
)

Sets whether or not a single body should use physics simulation, or should be 'fixed' (kinematic).

Public function Virtual

bool

 

SweepComponent

(
    FHitResult & OutHit,
    const FVector Start,
    const FVector End,
    const FQuat & ShapeWorldRotation,
    const FCollisionShape & CollisionSh...,
    bool bTraceComplex
)

Trace a shape against just this component.

true if a hit is found

Public function Virtual

void

 

UpdateCollisionProfile()

Public function Virtual

void

 

UpdatePhysicsToRBChannels()

WITH_EDITOR.

Public function Virtual

void

 

WakeAllRigidBodies()

Ensure simulation is running for all bodies in this component.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Public function Virtual

const bool

 

CanHaveStaticMobility()

Skeletal mesh component should not be able to have its mobility set to static

Public function Virtual

bool

 

IsAnySimulatingPhysics()

Returns whether the specified body is currently using physics simulation

Protected function Virtual

bool

 

MoveComponentImpl

(
    const FVector & Delta,
    const FQuat & NewRotation,
    bool bSweep,
    FHitResult * OutHit,
    EMoveComponentFlags MoveFlags,
    ETeleportType Teleport
)

Begin USceneComponent Interface.

Public function Virtual

void

 

OnUpdateTransform

(
    EUpdateTransformFlags UpdateTransfo...,
    ETeleportType Teleport
)

Public function Virtual

void

 

UpdateOverlaps

(
    TArray < FOverlapInfo > const* ...,
    bool bDoNotifies,
    const TArray < FOverlapInfo >* ...
)

Queries world and updates overlap tracking state for this component.

Overridden from UActorComponent

Name Description

Protected function Virtual

void

 

CreateRenderState_Concurrent()

End USceneComponentInterface.

Public function Virtual

void

 

InitializeComponent()

Initializes the component.

Protected function Virtual

void

 

OnCreatePhysicsState()

Used to create any physics engine information for this component

Protected function Virtual

void

 

OnDestroyPhysicsState()

Used to shut down and physics engine structure for this component

Protected function Virtual

void

 

OnRegister()

WITH_EDITOR.

Protected function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Protected function Virtual

void

 

RegisterComponentTickFunctions

(
    bool bRegister
)

Virtual call chain to register all tick functions

Protected function Virtual

bool

 

ShouldCreatePhysicsState()

Return true if CreatePhysicsState() should be called.

Public function Virtual

void

 

TickComponent

(
    float DeltaTime,
    enum ELevelTick TickType,
    FActorComponentTickFunction* T...
)

Function called every frame on this ActorComponent.

Overridden from UObject

Name Description

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx & CumulativeResourc...
)

WITH_EDITOR.

Public function Virtual

void

 

LoadedFromAnotherClass

(
    const FName & OldClassName
)

Called when the object was loaded from another class via active class redirects.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Typedefs

See Also

References

Module

Engine

Header

Runtime/Engine/Classes/Components/SkeletalMeshComponent.h