Skip to main content

FAnimNode_KawaiiPhysics

API reference for the main KawaiiPhysics AnimGraph node.

View Source

Class Definition

USTRUCT(BlueprintType)
struct KAWAIIPHYSICS_API FAnimNode_KawaiiPhysics : public FAnimNode_SkeletalControlBase

Bones (Bone Settings)

PropertyTypeDefaultDescription
RootBoneFBoneReference-Root bone to control (descendant bones are included)
ExcludeBonesTArray<FBoneReference>-Bones to exclude from control (the bone and its descendants)
AdditionalRootBonesTArray<FKawaiiPhysicsRootBoneSetting>-Additional root bone settings
DummyBoneLengthfloat0.0Length of the tip dummy bone that improves end-bone rotation (0 to disable, ClampMin=0)
BoneForwardAxisEBoneForwardAxisX_PositiveBone forward axis (affects dummy bone placement)
ModifyBonesTArray<FKawaiiPhysicsModifyBone>-(Runtime / Transient) cache of the physics-controlled bones

Bones | Bone Subdivision

PropertyTypeDefaultDescription
BoneSubdivisionCountint320Inter-bone dummy count (ClampMin=0, ClampMax=10, 0 to disable)
bBoneSubdivisionCollisionOnlybooltrueExclude inter-bone dummies from velocity integration (collision/constraint only)
bBoneSubdivisionDensifyByRadiusboolfalseUsing BoneSubdivisionCount as the minimum, places more dummies where bones are far apart relative to their radius (up to 50 per segment). Changing Radius / RadiusCurve while enabled may require a re-init (e.g. recompiling the ABP) to recompute the dummy count
BoneConstraintSubdivisionCountint320Collision-proxy dummy count along horizontal BoneConstraints (ClampMin=0, ClampMax=10, 0 to disable)
BoneConstraintSubdivisionFeedbackScalefloat1.0Strength of transferring bridge-dummy collision displacement to endpoint bones (ClampMin=0.0, ClampMax=2.0)

Physics Settings

PropertyTypeDefaultDescription
PhysicsSettingsFKawaiiPhysicsSettings-Basic physics control settings (Damping / Stiffness / Radius, etc.)
SimulationSpaceEKawaiiPhysicsSimulationSpaceComponentSpaceSimulation space
SimulationBaseBoneFBoneReference-Reference bone when BaseBoneSpace is selected
TargetFramerateint3260Target framerate for physics stepping (ClampMin=1)
TeleportDistanceThresholdfloat300.0Movement beyond this distance is treated as a teleport
TeleportRotationThresholdfloat10.0Rotation beyond this angle is treated as a teleport
PlanarConstraintEPlanarConstraintNoneConstrains each bone onto a plane
SkelCompMoveScaleFVector(1, 1, 1)Scale applied to component movement before reflecting in physics
WarmUpFramesint320Warm-up frame count (when bNeedWarmUp is enabled)
bNeedWarmUpboolfalseEnable warm-up
bUseWarmUpWhenResetDynamicsbooltruePerform warm-up on ResetDynamics
bUpdatePhysicsSettingsInGamebooltrueUpdate per-bone physics params each frame (AdvancedDisplay; disable for minor perf gain)
ResetBoneTransformWhenBoneNotFoundboolfalseReset transform when a controlled bone is not found (AdvancedDisplay)

Physics Settings | Curves

PropertyTypeEditor Display NameDescription
DampingCurveDataFRuntimeFloatCurveDamping Rate by Bone Length RateDamping curve
StiffnessCurveDataFRuntimeFloatCurveStiffness Rate by Bone Length RateStiffness curve
WorldDampingLocationCurveDataFRuntimeFloatCurveWorld Damping Location Rate by Bone Length RateWorld location damping curve
WorldDampingRotationCurveDataFRuntimeFloatCurveWorld Damping Rotation Rate by Bone Length RateWorld rotation damping curve
RadiusCurveDataFRuntimeFloatCurveRadius Rate by Bone Length RateRadius curve
LimitAngleCurveDataFRuntimeFloatCurveLimitAngle Rate by Bone Length RateAngle limit curve

All are multiplied into their parameter by the bone-length ratio (0.0–1.0) from the RootBone (AdvancedDisplay).

Limits (Collision)

PropertyTypeDescription
SphericalLimitsTArray<FSphericalLimit>Sphere collision
CapsuleLimitsTArray<FCapsuleLimit>Capsule collision
BoxLimitsTArray<FBoxLimit>Box collision
PlanarLimitsTArray<FPlanarLimit>Plane collision
LimitsDataAssetUKawaiiPhysicsLimitsDataAsset*Collision Data Asset (shareable)
PhysicsAssetForLimitsUPhysicsAsset*Physics Asset used as a collision source
note

SphericalLimitsData / CapsuleLimitsData / BoxLimitsData / PlanarLimitsData are read-only (Transient / VisibleAnywhere) arrays that preview the collisions imported from LimitsDataAsset or PhysicsAssetForLimits. They cannot be edited directly.

Limits | Shared Collision

PropertyTypeDefaultDescription
bSharedCollisionSourceboolfalsePublish collision (Source)
bUseSharedCollisionboolfalseUse shared collision (Target)
SharedCollisionGroupTagFGameplayTag-Group tag identifying the shared set

Limits | Bone Constraint

PropertyTypeDefaultDescription
BoneConstraintGlobalComplianceTypeEXPBDComplianceTypeLeatherCompliance type
BoneConstraintIterationCountBeforeCollisionint321Pre-collision iteration count
BoneConstraintIterationCountAfterCollisionint321Post-collision iteration count
bAutoAddChildDummyBoneConstraintbooltrueAuto-add dummy bone
BoneConstraintsTArray<FModifyBoneConstraint>-Bone constraint list
BoneConstraintsDataAssetUKawaiiPhysicsBoneConstraintsDataAsset*-Constraints Data Asset

Limits | World Collision

PropertyTypeDefaultDescription
bAllowWorldCollisionboolfalseEnable world collision (significantly increases physics cost when enabled)
bOverrideCollisionParamsboolfalseUse custom collision settings (inline toggle for CollisionChannelSettings)
CollisionChannelSettingsFBodyInstance-Custom collision settings (display name: Override SkelComp Collision Params; only when bOverrideCollisionParams is enabled)
bIgnoreSelfComponentbooltrueIgnore self collision (PhysicsAsset); edit condition: bAllowWorldCollision
IgnoreBonesTArray<FBoneReference>-Ignore bones list (edit condition: !bIgnoreSelfComponent)
IgnoreBoneNamePrefixTArray<FName>-Ignore bone name prefix (edit condition: !bIgnoreSelfComponent)

Force (External Forces)

PropertyTypeDefaultDescription
GravityFVectorZeroVectorGravity vector
bUseLegacyGravityboolfalseLegacy gravity method
bUseDefaultGravityZProjectSettingboolfalseUse project setting gravity
bUseWorldSpaceGravitybooltrueWorld space gravity
bEnableWindboolfalseEnable wind (receive WindDirectionalSource influence)
WindScalefloat1.0Wind scale (edit condition: bEnableWind)
WindDirectionNoiseAnglefloat0.0Wind direction noise (degrees, edit condition: bEnableWind)

Force | External Force

PropertyTypeDefaultDescription
SimpleExternalForceFVectorZeroVectorSimple external force
bUseWorldSpaceSimpleExternalForcebooltrueWorld space external force
ExternalForcesTArray<FInstancedStruct>-External force presets (Instanced Struct, extensible in C++)
CustomExternalForcesTArray<UKawaiiPhysics_CustomExternalForce*>-BP/C++ object-based external force presets (experimental)

Force | Sync Bone

PropertyTypeDescription
SyncBonesTArray<FKawaiiPhysicsSyncBone>Sync bone list. See Sync Bone for details

Tag

PropertyTypeDescription
KawaiiPhysicsTagFGameplayTagFiltering tag

KawaiiPhysics (Runtime)

PropertyTypeDescription
DeltaTimefloatFrame delta time (BlueprintReadOnly)

Key Methods

Initialize_AnyThread

virtual void Initialize_AnyThread(const FAnimationInitializeContext& Context) override;

Node initialization. Builds bone chain and initializes parameters.

CacheBones_AnyThread

virtual void CacheBones_AnyThread(const FAnimationCacheBonesContext& Context) override;

Bone reference caching.

UpdateInternal

virtual void UpdateInternal(const FAnimationUpdateContext& Context) override;

Per-frame update processing.

EvaluateSkeletalControl_AnyThread

virtual void EvaluateSkeletalControl_AnyThread(
FComponentSpacePoseContext& Output,
TArray<FBoneTransform>& OutBoneTransforms
) override;

Physics simulation evaluation and bone transform output.

ResetDynamics

virtual void ResetDynamics(ETeleportType InTeleportType) override;

Physics state reset. Used for teleportation, etc.

HasPreUpdate / PreUpdate

virtual bool HasPreUpdate() const override;
virtual void PreUpdate(const UAnimInstance* InAnimInstance) override;

Pre-processing that runs on the GameThread. Work that cannot safely touch UObjects from the worker thread is handled here.

  • Shared collision initialization (InitializeSharedCollision): registering with the Subsystem mutates a TMap, so it runs on the thread-safe GameThread side.
  • Collects warning-log identifier names (AnimInstance class name, component name, owner Actor name) once on the first call (avoids UObject access from the worker thread).
note

Only nodes whose HasPreUpdate() returns true have PreUpdate() called. The physics simulation itself runs in EvaluateSkeletalControl_AnyThread on the worker thread; PreUpdate is dedicated to GameThread-only initialization and cache collection.

IsValidToEvaluate

virtual bool IsValidToEvaluate(
const USkeleton* Skeleton,
const FBoneContainer& RequiredBones
) override;

Determines whether the node can be evaluated.

GatherDebugData

virtual void GatherDebugData(FNodeDebugData& DebugData) override;

Collects debug information.

NeedsDynamicReset

virtual bool NeedsDynamicReset() const override { return true; }

Always returns true so that ResetDynamics (teleport handling) is called.

Runtime Re-initialization

RequestModifyBonesReinit / RequestSharedCollisionReinit

void RequestModifyBonesReinit();      // Rebuild the bone chain on the next Evaluate
void RequestSharedCollisionReinit(); // Re-initialize shared collision on the next Evaluate

Schedules a safe re-initialization when you change settings at runtime that affect topology or collision configuration (sets a flag, runs on the next Evaluate). Called internally by the setters of UKawaiiPhysicsLibrary.

Coordinate Transform Helpers

GetBoneTransformInSimSpace

FTransform GetBoneTransformInSimSpace(
FComponentSpacePoseContext& Output,
const FCompactPoseBoneIndex& BoneIndex
) const;

Gets bone Transform in simulation space.

ConvertSimulationSpaceTransform

FTransform ConvertSimulationSpaceTransform(
FComponentSpacePoseContext& Output,
EKawaiiPhysicsSimulationSpace From,
EKawaiiPhysicsSimulationSpace To,
const FTransform& InTransform
) const;

Converts Transform between simulation spaces. Per-type variants are available:

FVector ConvertSimulationSpaceVector(...) const;     // Convert a direction vector
FVector ConvertSimulationSpaceLocation(...) const; // Convert a position
FQuat ConvertSimulationSpaceRotation(...) const; // Convert a rotation
void ConvertSimulationSpace(FComponentSpacePoseContext& Output,
EKawaiiPhysicsSimulationSpace From, EKawaiiPhysicsSimulationSpace To); // Convert all bones at once

Type Reference (Enum / Struct)

Definitions of the key enums and structs referenced by the properties.

FKawaiiPhysicsSettings

The core physics settings struct (PhysicsSettings property). The balance between Damping (how easily it sways) and Stiffness (how strongly it returns) determines the overall softness. Each member can be modulated by bone-length ratio via curves (DampingCurveData, etc.).

MemberTypeDefaultRangeDescription
Dampingfloat0.1≥ 0Damping; smaller values reflect more acceleration, so it sways more
Stiffnessfloat0.05≥ 0Stiffness; larger values maintain the original (animated) pose more strongly
WorldDampingLocationfloat0.8≥ 0Suppresses reflection of component movement. 0 = full reflection (max sway) / 1 = follow (no sway). Reflection = 1 - value
WorldDampingRotationfloat0.8≥ 0Suppresses reflection of component rotation (same as above; reflection = 1 - value)
Radiusfloat3.0≥ 0Collision radius of each bone (editor display name: Collision Radius)
LimitAnglefloat0.0≥ 0Max rotation angle (degrees) per step from physics. 0 = unlimited; helps suppress jitter
note

Contrary to their names, higher WorldDampingLocation / WorldDampingRotation values mean less sway (1 follows the component exactly = no sway).

For detailed explanations and diagrams of each member, see Physics Parameters.

EKawaiiPhysicsSimulationSpace

ValueDescription
ComponentSpaceRelative to the skeletal mesh component (default)
WorldSpaceWorld-based; avoids issues from sudden root-bone movement
BaseBoneSpaceRelative to a reference bone (SimulationBaseBone)

EPlanarConstraint

ValueDescription
NoneNo constraint (default)
XConstrain to the X-axis plane
YConstrain to the Y-axis plane
ZConstrain to the Z-axis plane

EBoneForwardAxis

X_Positive (default) / X_Negative / Y_Positive / Y_Negative / Z_Positive / Z_Negative

EXPBDComplianceType

Stiffness material type for Bone Constraints (BoneConstraintGlobalComplianceType).

Concrete / Wood / Leather (default) / Tendon / Rubber / Muscle / Fat

tip

For member details of collision shapes (FSphericalLimit, etc.), Sync Bone (FKawaiiPhysicsSyncBone), and Bone Constraint (FModifyBoneConstraint), see the feature-specific pages.

Usage Example

Basic usage in Animation Blueprint:

  1. Add KawaiiPhysics node to AnimGraph
  2. Set RootBone
  3. Adjust Damping/Stiffness in PhysicsSettings
  4. Add collision as needed
// Example accessing from C++
FAnimNode_KawaiiPhysics* Node = ...;
Node->PhysicsSettings.Damping = 0.2f;
Node->PhysicsSettings.Stiffness = 0.1f;
Node->Gravity = FVector(0, 0, -980.0f);