977 lines
27 KiB
C++
977 lines
27 KiB
C++
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||
|
||
#pragma once
|
||
|
||
#include "CoreMinimal.h"
|
||
#include "GMS_LocomotionEnumLibrary.h"
|
||
#include "Animation/TrajectoryTypes.h"
|
||
#include "BoneControllers/AnimNode_OffsetRootBone.h"
|
||
#include "UObject/Object.h"
|
||
#include "GMS_AnimState.generated.h"
|
||
|
||
class UAnimSequenceBase;
|
||
class UAnimSequence;
|
||
|
||
/**
|
||
* Stores locomotion-related animation state data.
|
||
* 存储与运动相关的动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Locomotion
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* World-space location of the character.
|
||
* 角色的世界空间位置。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector Location{ForceInit};
|
||
|
||
/**
|
||
* Displacement from the previous frame.
|
||
* 上一帧的位移。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float PreviousDisplacement{0.0f};
|
||
|
||
/**
|
||
* Speed of displacement (cm/s).
|
||
* 位移速度(厘米/秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float DisplacementSpeed{0.0f};
|
||
|
||
/**
|
||
* World-space rotation of the character.
|
||
* 角色的世界空间旋转。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FRotator Rotation{ForceInit};
|
||
|
||
/**
|
||
* Quaternion representation of the rotation.
|
||
* 旋转的四元数表示。
|
||
*/
|
||
UPROPERTY()
|
||
FQuat RotationQuaternion{ForceInit};
|
||
|
||
/**
|
||
* Current velocity vector.
|
||
* 当前速度向量。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector Velocity{ForceInit};
|
||
|
||
/**
|
||
* 2D local-space velocity vector.
|
||
* 2D本地空间速度向量。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector LocalVelocity2D{ForceInit};
|
||
|
||
/**
|
||
* Indicates if the character has velocity.
|
||
* 指示角色是否有速度。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bHasVelocity = false;
|
||
|
||
/**
|
||
* Current speed of the character (cm/s).
|
||
* 角色的当前速度(厘米/秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ForceUnits = "cm/s"))
|
||
float Speed{0.0f};
|
||
|
||
/**
|
||
* Yaw angle of the local velocity (degrees).
|
||
* 本地速度的偏航角(度)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -180, ClampMax = 180, ForceUnits = "deg"))
|
||
float LocalVelocityYawAngle{0.0f};
|
||
|
||
/**
|
||
* Yaw angle of the local velocity with offset (degrees).
|
||
* 带偏移的本地速度偏航角(度)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -180, ClampMax = 180, ForceUnits = "deg"))
|
||
float LocalVelocityYawAngleWithOffset{0.0f};
|
||
|
||
/**
|
||
* Cardinal direction of the local velocity.
|
||
* 本地速度的主要方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EGMS_MovementDirection LocalVelocityDirection{EGMS_MovementDirection::Forward};
|
||
|
||
/**
|
||
* Cardinal direction of the local velocity without offset.
|
||
* 无偏移的本地速度主要方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EGMS_MovementDirection LocalVelocityDirectionNoOffset{EGMS_MovementDirection::Forward};
|
||
|
||
/**
|
||
* Octagonal direction of the local velocity.
|
||
* 本地速度的八方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EGMS_MovementDirection_8Way LocalVelocityOctagonalDirection{EGMS_MovementDirection_8Way::Forward};
|
||
|
||
/**
|
||
* Indicates if there is active input.
|
||
* 指示是否有活跃输入。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bHasInput{false};
|
||
|
||
/**
|
||
* Velocity acceleration vector.
|
||
* 速度加速度向量。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector VelocityAcceleration{ForceInit};
|
||
|
||
/**
|
||
* 2D local-space acceleration vector.
|
||
* 2D本地空间加速度向量。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector LocalAcceleration2D{ForceInit};
|
||
|
||
/**
|
||
* Indicates if the character is moving.
|
||
* 指示角色是否在移动。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bMoving{false};
|
||
|
||
/**
|
||
* Actor's rotation yaw speed.
|
||
* Actor的旋转偏航角变化速度。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -180, ClampMax = 180, ForceUnits = "deg"))
|
||
float YawVelocity{0.0f};
|
||
|
||
/**
|
||
* Scale factor for animations.
|
||
* 动画的缩放因子。
|
||
*/
|
||
float Scale{1.0f};
|
||
|
||
/**
|
||
* Radius of the character's capsule.
|
||
* 角色胶囊体的半径。
|
||
*/
|
||
float CapsuleRadius{0.0f};
|
||
|
||
/**
|
||
* Half-height of the character's capsule.
|
||
* 角色胶囊体的一半高度。
|
||
*/
|
||
float CapsuleHalfHeight{0.0f};
|
||
|
||
/**
|
||
* Maximum acceleration of the character.
|
||
* 角色的最大加速度。
|
||
*/
|
||
float MaxAcceleration{0.0f};
|
||
|
||
/**
|
||
* Maximum braking deceleration of the character.
|
||
* 角色的最大制动减速度。
|
||
*/
|
||
float MaxBrakingDeceleration{0.0f};
|
||
|
||
/**
|
||
* Z value for walkable floor detection.
|
||
* 可行走地板检测的Z值。
|
||
*/
|
||
float WalkableFloorZ{0.0f};
|
||
};
|
||
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Trajectory
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FTransformTrajectory Trajectory;
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector PastVelocity{FVector::ZeroVector};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector CurrentVelocity{FVector::ZeroVector};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector FutureVelocity{FVector::ZeroVector};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float DesiredControllerYaw{0.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores root bone animation state data.
|
||
* 存储根骨骼动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Root
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Translation mode for the root bone.
|
||
* 根骨骼的平移模式。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EOffsetRootBoneMode TranslationMode{EOffsetRootBoneMode::Release};
|
||
|
||
/**
|
||
* Rotation mode for the root bone.
|
||
* 根骨骼的旋转模式。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EOffsetRootBoneMode RotationMode{EOffsetRootBoneMode::Release};
|
||
|
||
/**
|
||
* Current world-space transform of the root bone.
|
||
* 根骨骼的当前世界空间变换。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FTransform RootTransform{FTransform::Identity};
|
||
|
||
/**
|
||
* Yaw offset relative to the actor's rotation (degrees; <0 left, >0 right).
|
||
* 相对于Actor旋转的偏航偏移(度;<0左侧,>0右侧)。
|
||
*/
|
||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="State")
|
||
float YawOffset{0};
|
||
|
||
/**
|
||
* Maximum rotation error in degrees; values <0 disable the limit.
|
||
* 最大旋转误差(度);值<0禁用限制。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float MaxRotationError{-1.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores turn-in-place animation state data.
|
||
* 存储原地转身动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_TurnInPlace
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Indicates if the state was updated this frame.
|
||
* 指示此帧是否更新了状态。
|
||
*/
|
||
UPROPERTY()
|
||
uint8 bUpdatedThisFrame : 1 {false};
|
||
|
||
/**
|
||
* Animation sequence for turn-in-place.
|
||
* 原地转身的动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequenceBase> Animation;
|
||
|
||
/**
|
||
* Indicates if the character should turn.
|
||
* 指示角色是否应该转身。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
uint8 bShouldTurn : 1 {false};
|
||
|
||
/**
|
||
* Accumulated time for the animation.
|
||
* 动画的累计时间。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float AccumulatedTime{0};
|
||
|
||
/**
|
||
* Playback rate for the animation.
|
||
* 动画的播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ForceUnits = "x"))
|
||
float PlayRate{1.0f};
|
||
|
||
/**
|
||
* Scaled playback rate for the animation.
|
||
* 动画的缩放播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ForceUnits = "x"))
|
||
float ScaledPlayRate{1.0f};
|
||
|
||
/**
|
||
* Delay before activating the turn-in-place animation.
|
||
* 原地转身动画激活前的延迟。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ForceUnits = "s"))
|
||
float ActivationDelay{0.0f};
|
||
|
||
/**
|
||
* Angle that triggers the turn-in-place animation.
|
||
* 触发原地转身动画的角度。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float TriggeredAngle{0.0f};
|
||
|
||
/**
|
||
* Indicates if the turn is 180 degrees.
|
||
* 指示是否为180度转身。
|
||
*/
|
||
bool b180{false};
|
||
};
|
||
|
||
/**
|
||
* Stores in-air animation state data.
|
||
* 存储空中动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_InAir
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Vertical speed of the character (cm/s).
|
||
* 角色的垂直速度(厘米/秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ForceUnits = "cm/s"))
|
||
float VerticalSpeed{0.0f};
|
||
|
||
/**
|
||
* Indicates if the character is jumping.
|
||
* 指示角色是否在跳跃。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bJumping{false};
|
||
|
||
/**
|
||
* Indicates if the character is falling.
|
||
* 指示角色是否在下落。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bFalling{false};
|
||
|
||
/**
|
||
* Playback rate for the jump animation.
|
||
* 跳跃动画的播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ForceUnits = "x"))
|
||
float JumpPlayRate{1.0f};
|
||
|
||
/**
|
||
* Indicates if valid ground is detected.
|
||
* 指示是否检测到有效地面。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bValidGround{false};
|
||
|
||
/**
|
||
* Distance to the ground (cm).
|
||
* 到地面的距离(厘米)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", meta=(ForceUnits = "cm"))
|
||
float GroundDistance{0.0f};
|
||
|
||
/**
|
||
* Time to reach the jump apex (s).
|
||
* 到达跳跃顶点的时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1, ForceUnits = "s"))
|
||
float TimeToJumpApex{0.0f};
|
||
|
||
/**
|
||
* Time spent falling (s).
|
||
* 下落的时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1, ForceUnits = "s"))
|
||
float FallingTime{0.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores idle animation state data.
|
||
* 存储空闲动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Idle
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Animation sequence for idle.
|
||
* 空闲动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequence> Animation{nullptr};
|
||
|
||
/**
|
||
* Indicates if the idle animation is looped.
|
||
* 指示空闲动画是否循环。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
bool bLoop{true};
|
||
|
||
/**
|
||
* Playback rate for the idle animation.
|
||
* 空闲动画的播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float PlayRate{1.0f};
|
||
|
||
/**
|
||
* Blend time for the idle animation.
|
||
* 空闲动画的混合时间。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float BlendTime{1.0f};
|
||
|
||
/**
|
||
* Blend profile for the idle animation.
|
||
* 空闲动画的混合配置文件。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UBlendProfile> BlendProfile{nullptr};
|
||
};
|
||
|
||
/**
|
||
* Stores runtime state for idle break animations.
|
||
* 存储空闲中断动画的运行时状态。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_IdleBreak
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Time until the next idle break animation (s).
|
||
* 到下一个空闲中断动画的时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float TimeUntilNextIdleBreak{0.0f};
|
||
|
||
/**
|
||
* Index of the current idle break animation.
|
||
* 当前空闲中断动画的索引。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
int32 CurrentIdleBreakIndex{0};
|
||
|
||
/**
|
||
* Delay between idle break animations (s).
|
||
* 空闲中断动画之间的延迟(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float IdleBreakDelayTime{0.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores lean animation state data.
|
||
* 存储倾斜动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Lean
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Horizontal acceleration amount for leaning (clamped -1 to 1).
|
||
* 用于倾斜的水平加速度量(限制在-1到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -1, ClampMax = 1))
|
||
float RightAmount{0.0f};
|
||
|
||
/**
|
||
* Vertical acceleration amount for leaning (clamped -1 to 1).
|
||
* 用于倾斜的垂直加速度量(限制在-1到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -1, ClampMax = 1))
|
||
float ForwardAmount{0.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores pivot animation state data.
|
||
* 存储枢轴动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Pivot
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Animation sequence for the pivot.
|
||
* 枢轴动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequence> Animation;
|
||
|
||
/**
|
||
* Acceleration at the start of the pivot.
|
||
* 枢轴开始时的加速度。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector StartingAcceleration{ForceInit};
|
||
|
||
/**
|
||
* Accumulated time for the pivot animation.
|
||
* 枢轴动画的累计时间。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float AccumulatedTime{ForceInit};
|
||
|
||
/**
|
||
* Time at which the pivot stops for distance matching.
|
||
* 距离匹配时枢轴停止的时间。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float TimeAtPivotStop{ForceInit};
|
||
|
||
/**
|
||
* Alpha for stride warping during the pivot.
|
||
* 枢轴期间步幅适配的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float StrideWarpingAlpha{ForceInit};
|
||
|
||
/**
|
||
* Clamp for the playback rate (min, max).
|
||
* 播放速率的限制(最小,最大)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector2D PlayRateClamp{0.f, 0.f};
|
||
|
||
/**
|
||
* 2D direction of the pivot.
|
||
* 枢轴的2D方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="State")
|
||
FVector Direction2D{ForceInit};
|
||
|
||
/**
|
||
* Desired movement direction for the pivot.
|
||
* 枢轴的期望移动方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="State")
|
||
EGMS_MovementDirection DesiredDirection{ForceInit};
|
||
|
||
/**
|
||
* Initial movement direction for the pivot.
|
||
* 枢轴的初始移动方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="State")
|
||
EGMS_MovementDirection InitialDirection{ForceInit};
|
||
|
||
/**
|
||
* Remaining cooldown time for the pivot (s).
|
||
* 枢轴的剩余冷却时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="State")
|
||
float RemainingCooldown{ForceInit};
|
||
|
||
/**
|
||
* Indicates if the pivot is moving perpendicular to the initial direction.
|
||
* 指示枢轴是否垂直于初始方向移动。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="State")
|
||
bool bMovingPerpendicularToInitialDirection{ForceInit};
|
||
};
|
||
|
||
/**
|
||
* Stores start animation state data.
|
||
* 存储开始动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Start
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Animation sequence for the start movement.
|
||
* 开始移动的动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequence> Animation{nullptr};
|
||
|
||
/**
|
||
* Smooth target rotation for the start movement.
|
||
* 开始移动的平滑目标旋转。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FRotator SmoothTargetRotation{ForceInit};
|
||
|
||
/**
|
||
* Yaw delta between acceleration direction and root direction at start (degrees).
|
||
* 开始时加速度方向与根方向的偏航差(度)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -180, ClampMax = 180, ForceUnits = "deg"))
|
||
float YawDeltaToAcceleration{ForceInit};
|
||
|
||
/**
|
||
* Local velocity direction at the start.
|
||
* 开始时的本地速度方向。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
EGMS_MovementDirection LocalVelocityDirection{ForceInit};
|
||
|
||
/**
|
||
* Alpha for stride warping during the start.
|
||
* 开始期间步幅适配的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float StrideWarpingAlpha{ForceInit};
|
||
|
||
/**
|
||
* Clamp for the playback rate (min, max).
|
||
* 播放速率的限制(最小,最大)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FVector2D PlayRateClamp{ForceInit};
|
||
|
||
/**
|
||
* Alpha for orientation warping during the start.
|
||
* 开始期间朝向扭曲的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float OrientationAlpha{1.0f};
|
||
|
||
/**
|
||
* Time spent in the start state (s).
|
||
* 开始状态的持续时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float TimeInState{0.0f};
|
||
|
||
/**
|
||
* Blend profile for the start animation.
|
||
* 开始动画的混合配置文件。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UBlendProfile> BlendProfile{nullptr};
|
||
|
||
/**
|
||
* Remaining time for the start animation (s).
|
||
* 开始动画的剩余时间(秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float TimeRemaining{0.0f};
|
||
|
||
/**
|
||
* Playback rate for the start animation.
|
||
* 开始动画的播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float PlayRate{0.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores cycle animation state data.
|
||
* 存储循环动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Cycle
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Animation sequence for the cycle.
|
||
* 循环动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequence> Animation{nullptr};
|
||
|
||
/**
|
||
* Alpha for orientation warping during the cycle.
|
||
* 循环期间朝向扭曲的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float OrientationAlpha{ForceInit};
|
||
|
||
/**
|
||
* Alpha for stride warping during the cycle.
|
||
* 循环期间步幅适配的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float StrideWarpingAlpha{ForceInit};
|
||
|
||
/**
|
||
* Playback rate for the cycle animation.
|
||
* 循环动画的播放速率。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float PlayRate{1.0f};
|
||
|
||
/**
|
||
* Blend profile for the cycle animation.
|
||
* 循环动画的混合配置文件。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UBlendProfile> BlendProfile{nullptr};
|
||
};
|
||
|
||
/**
|
||
* Stores stop animation state data.
|
||
* 存储停止动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Stop
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Animation sequence for the stop.
|
||
* 停止动画序列。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
TObjectPtr<UAnimSequence> Animation{nullptr};
|
||
|
||
/**
|
||
* Alpha for orientation warping during the stop.
|
||
* 停止期间朝向扭曲的Alpha值。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
float OrientationAlpha{1.0f};
|
||
};
|
||
|
||
/**
|
||
* Stores view-related animation state data.
|
||
* 存储与视图相关的动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_View
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
/**
|
||
* Rotation of the view.
|
||
* 视图的旋转。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS")
|
||
FRotator Rotation{ForceInit};
|
||
|
||
/**
|
||
* Yaw angle between the actor and camera (degrees).
|
||
* Actor与相机之间的偏航角(度)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -180, ClampMax = 180, ForceUnits = "deg"))
|
||
float YawAngle{0.0f};
|
||
|
||
/**
|
||
* Speed of yaw angle change (degrees/s).
|
||
* 偏航角变化速度(度/秒)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ForceUnits = "deg/s"))
|
||
float YawSpeed{0.0f};
|
||
|
||
/**
|
||
* Pitch angle of the view (degrees).
|
||
* 视图的俯仰角(度)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = -90, ClampMax = 90, ForceUnits = "deg"))
|
||
float PitchAngle{0.0f};
|
||
|
||
/**
|
||
* Amount of pitch applied (clamped 0 to 1).
|
||
* 应用的俯仰量(限制在0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float PitchAmount{0.5f};
|
||
};
|
||
|
||
/**
|
||
* Stores layering animation state data for body parts.
|
||
* 存储身体部位的分层动画状态数据。
|
||
*/
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_Layering
|
||
{
|
||
GENERATED_BODY()
|
||
virtual ~FGMS_AnimState_Layering() = default;
|
||
/**
|
||
* Blend amount for the head (0 to 1).
|
||
* 头部混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HeadBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Additive blend amount for the head (0 to 1).
|
||
* 头部附加混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HeadAdditiveBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the head (0 to 1).
|
||
* 头部槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HeadSlotBlendAmount{1.0f};
|
||
|
||
/**
|
||
* Blend amount for the left arm (0 to 1).
|
||
* 左臂混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Additive blend amount for the left arm (0 to 1).
|
||
* 左臂附加混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftAdditiveBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the left arm (0 to 1).
|
||
* 左臂槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftSlotBlendAmount{1.0f};
|
||
|
||
/**
|
||
* Local space blend amount for the left arm (0 to 1).
|
||
* 左臂本地空间混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftLocalSpaceBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Mesh space blend amount for the left arm (0 to 1).
|
||
* 左臂网格空间混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftMeshSpaceBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Blend amount for the right arm (0 to 1).
|
||
* 右臂混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Additive blend amount for the right arm (0 to 1).
|
||
* 右臂附加混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightAdditiveBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the right arm (0 to 1).
|
||
* 右臂槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightSlotBlendAmount{1.0f};
|
||
|
||
/**
|
||
* Local space blend amount for the right arm (0 to 1).
|
||
* 右臂本地空间混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightLocalSpaceBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Mesh space blend amount for the right arm (0 to 1).
|
||
* 右臂网格空间混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightMeshSpaceBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Blend amount for the left hand (0 to 1).
|
||
* 左手混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HandLeftBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Blend amount for the right hand (0 to 1).
|
||
* 右手混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HandRightBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Blend amount for the spine (0 to 1).
|
||
* 脊椎混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float SpineBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Additive blend amount for the spine (0 to 1).
|
||
* 脊椎附加混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float SpineAdditiveBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the spine (0 to 1).
|
||
* 脊椎槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float SpineSlotBlendAmount{1.0f};
|
||
|
||
/**
|
||
* Blend amount for the pelvis (0 to 1).
|
||
* 骨盆混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float PelvisBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the pelvis (0 to 1).
|
||
* 骨盆槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float PelvisSlotBlendAmount{1.0f};
|
||
|
||
/**
|
||
* Blend amount for the legs (0 to 1).
|
||
* 腿部混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float LegsBlendAmount{0.0f};
|
||
|
||
/**
|
||
* Slot blend amount for the legs (0 to 1).
|
||
* 腿部槽混合量(0到1)。
|
||
*/
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float LegsSlotBlendAmount{1.0f};
|
||
|
||
void ApplyValueFromSequence(const UAnimSequence* InSequence, float ExplicitTime);
|
||
|
||
virtual void ZeroOut();
|
||
};
|
||
|
||
USTRUCT(BlueprintType)
|
||
struct GENERICMOVEMENTSYSTEM_API FGMS_AnimState_LayeringSmooth
|
||
{
|
||
GENERATED_BODY()
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float HeadBlendAmount{0.0f};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmLeftBlendAmount{0.0f};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float ArmRightBlendAmount{0.0f};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float SpineBlendAmount{0.0f};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float PelvisBlendAmount{0.0f};
|
||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="GMS", Meta = (ClampMin = 0, ClampMax = 1))
|
||
float LegsBlendAmount{0.0f};
|
||
};
|