Navigation
API > API/Plugins > API/Plugins/MotionTrajectory
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UCharacterTrajectoryComponent
References
| Module | MotionTrajectory |
| Header | /Engine/Plugins/Experimental/Animation/MotionTrajectory/Source/MotionTrajectory/Public/CharacterTrajectoryComponent.h |
| Include | #include "CharacterTrajectoryComponent.h" |
Syntax
UCLASS&40;Blueprintable, BlueprintType, Meta&61;&40;BlueprintSpawnableComponent&41;, Experimental&41;
class UCharacterTrajectoryComponent : public UActorComponent
Remarks
Component for generating trajectories usable by Motion Matching. This component generates trajectories from ACharacter. This is intended to provide an example and starting point for using Motion Matching with a common setup using the default UCharacterMovementComponent. It is expected work flow to extend or replace this component for projects that use a custom movement component or custom movement modes.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAutoUpdateTrajectory | By default the component will always update trajectory. | |
| TObjectPtr< UCharacterMovementComponent > | CharacterMovementComponent | ||
| FRotator | DesiredControllerRotationLastUpdate | ||
| FQuat | ForwardFacingCS | Forward axis for the SkeletalMeshComponent. It's common for skeletal mesh and animation data to not be X forward. | |
| float | HistoryLengthSeconds | This should generally match the longest history required by a Motion Matching Database in the project. | |
| int32 | HistorySamplesPerSecond | Higher values will cost more storage and processing time, but give higher accuracy. | |
| float | MaxControllerRotationRate | Maximum controller rotation rate in degrees per second used to clamp the character owner controller desired rotation to generate the prediction trajectory. | |
| int32 | NumHistorySamples | ||
| float | PredictionLengthSeconds | This should match the longest trajectory prediction required by a Motion Matching Database in the project. | |
| int32 | PredictionSamplesPerSecond | Higher values will cost more storage and processing time, but give higher accuracy. | |
| float | RotateTowardsMovementSpeed | If the character is forward facing (i.e. bOrientRotationToMovement is true), this controls how quickly the trajectory will rotate to face acceleration. | |
| float | SecondsPerHistorySample | ||
| float | SecondsPerPredictionSample | ||
| TObjectPtr< USkeletalMeshComponent > | SkelMeshComponent | ||
| FPoseSearchQueryTrajectory | Trajectory | Trajectory stored in world space so it can be directly passed to Motion Matching. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCharacterTrajectoryComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FRotator | CalculateControllerRotationRate
(
float DeltaSeconds, |
||
| FRotator | GetFacingFromMeshComponent
(
const USkeletalMeshComponent* MeshComponent |
This can be used to override the facing used for trajectory calculation. | |
| FRotator | GetFacingFromMeshComponent_Implementation
(
const USkeletalMeshComponent* MeshComponent |
This can be used to override the facing used for trajectory calculation. | |
| void | OnMovementUpdated
(
float DeltaSeconds, |
||
| void | UpdateHistory
(
float DeltaSeconds |
||
| void | UpdatePrediction
(
const FVector& PositionWS, |
||
| void | UpdateTrajectory
(
float DeltaSeconds |
This can be called when bAutoUpdateTrajectory is false to manually control when trajectory updates. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | BeginPlay () |
Begins Play for the component. | |
| void | Initializes the component. | ||
| void | Handle this component being Uninitialized. |