载入中...
搜索中...
未找到
RootMotionPolicy.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
5#include "common/Result.h"
6
7#include <cstdint>
8#include <string_view>
9
10namespace eve::animation {
11
12class AnimPose;
13
21enum class RootMotionLockAxes : std::uint8_t {
22 None = 0,
23 X = 1u << 0,
24 Y = 1u << 1,
25 Z = 1u << 2,
26 HorizontalXZ = static_cast<std::uint8_t>(X) | static_cast<std::uint8_t>(Z),
27 VerticalY = Y,
28 All = static_cast<std::uint8_t>(X) | static_cast<std::uint8_t>(Y) | static_cast<std::uint8_t>(Z),
29};
30
33 return static_cast<RootMotionLockAxes>(static_cast<std::uint8_t>(a) | static_cast<std::uint8_t>(b));
34}
35
38 return static_cast<RootMotionLockAxes>(static_cast<std::uint8_t>(a) & static_cast<std::uint8_t>(b));
39}
40
42[[nodiscard]] constexpr bool hasLock(RootMotionLockAxes mask, RootMotionLockAxes axis) noexcept {
43 return (static_cast<std::uint8_t>(mask) & static_cast<std::uint8_t>(axis)) != 0;
44}
45
52enum class RootMotionApplySpace : std::uint8_t {
53 BoneLocal = 0,
55};
56
71
77
85 const RootMotionPolicy& policy);
86
96 int boneIndex,
97 const TransformTRS& referenceRoot,
98 const RootMotionPolicy& policy);
99
105
111
112} // namespace eve::animation
eve::EntitySpatialPose pose
int mask
#define EVENGINE_API_WORLD
Definition Export.h:109
std::string name
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:17
RootMotionLockAxes
Per-axis translation locks for extracted root-motion deltas.
eve::Result< void > bakeRootMotionIntoPose(AnimPose &pose, int boneIndex, const TransformTRS &referenceRoot, const RootMotionPolicy &policy)
Remove extracted root motion from a pose when bake flags are set.
eve::Result< void > validateRootMotionPolicy(const RootMotionPolicy &policy)
Validate policy fields.
TransformTRS applyRootMotionPolicy(const TransformTRS &rawDelta, const RootMotionPolicy &policy)
Filter a raw root-bone delta into a controller-facing delta.
constexpr RootMotionLockAxes operator|(RootMotionLockAxes a, RootMotionLockAxes b) noexcept
Bitwise OR for RootMotionLockAxes masks.
RootMotionApplySpace
Coordinate space used when publishing root-motion translation.
eve::Result< RootMotionLockAxes > parseRootMotionLockAxes(std::string_view name)
Parse a script/C++ lock-axis name.
constexpr bool hasLock(RootMotionLockAxes mask, RootMotionLockAxes axis) noexcept
True when mask contains the given axis bit.
eve::Result< RootMotionApplySpace > parseRootMotionApplySpace(std::string_view name)
Parse a script/C++ apply-space name.
constexpr RootMotionLockAxes operator&(RootMotionLockAxes a, RootMotionLockAxes b) noexcept
Bitwise AND for RootMotionLockAxes masks.
Policy applied after raw root-bone delta extraction. @ownership Value type; owned by AnimPlayer or th...
float characterYaw
Yaw in radians for CharacterFacing; ignored for BoneLocal.
Local TRS used by skeletal animation (quaternion xyzw).
Definition AnimMath.h:9