载入中...
搜索中...
未找到
ClimbingAnimation.cpp
浏览该文件的文档.
27bool finite(Vec3 value) { return std::isfinite(value.x) && std::isfinite(value.y) && std::isfinite(value.z); }
31eve::Result<void> beginClimbingAnimation(animation::AnimPlayer& player, animation::AnimClip& clip,
40 eve::DiagnosticCode::PreconditionViolation, "climbing animation clip must have a positive finite duration",
48eve::Result<void> beginClimbingAnimation(animation::AnimPlayer& player, animation::AnimClip& clip,
51 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
72 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "facing and pelvis offset must be finite",
78 frame.motion.rootTranslation = {player.getRootMotionX(), player.getRootMotionY(), player.getRootMotionZ()};
85 frame.motion.rootYawRadians = std::atan2(2.f * (qw * qy + qx * qz), 1.f - 2.f * (qy * qy + qz * qz));
89 eve::DiagnosticCode::InvariantViolation, "animation player produced non-finite root motion", "rootMotion",
105eve::Result<ClimbingGraphProvider> driveClimbingGraph(animation::AnimGraph& graph, int oneShotNode,
109 eve::DiagnosticCode::InvalidArgument, "graph projection requires a committed execution id", "executionId",
113 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "climbing graph one-shot node is invalid",
115 if (state.activeExecutionId == executionId && state.provider == ClimbingGraphProvider::AnimGraph)
122 eve::DiagnosticCode::PreconditionViolation, exception.what(), "oneShotNode", {}, "climbing.animation"));
135 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "motion-matching intent must be finite",
147ClimbingGraphProvider useDirectClimbingPose(ClimbingExecutionId executionId, ClimbingGraphState& state) noexcept {
Borrowed Animation player/graph adapters for climbing root motion and semantic notifies.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
virtual const char * what() const
Returns a string containing reason for the exception.
Definition Exception.h:24
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Keyframed skeletal animation clip (local TRS tracks per bone). Script type: AnimClip.
Definition AnimClip.h:145
Composable runtime pose graph supporting clips, blends, additive layers, per-bone masks,...
Definition AnimGraph.h:26
Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer.
Definition AnimPlayer.h:30
AnimSkeleton * getSkeleton() const override
Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object rema...
Definition AnimPlayer.h:44
std::string getEventName(int index) const override
Name of a dispatched event, or empty for invalid index.
Definition AnimPlayer.cpp:150
eve::Result< void > advance(const eve::SimulationStep &step) override
Advance playback and sample into internal pose.
Definition AnimPlayer.cpp:251
void setRootMotionBone(int boneIndex)
Select the bone whose per-frame motion is extracted (default 0).
Definition AnimPlayer.cpp:116
int getEventCount() const override
Number of events crossed by the most recent play/update call.
Definition AnimPlayer.h:133
float getRootMotionX() const
Controller-facing translation X after policy filtering (BoneLocal or CharacterFacing).
Definition AnimPlayer.h:112
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
Definition AnimSkeleton.h:16
Runtime motion matching player: builds a query feature from current pose + desired trajectory,...
Definition MotionMatcher.h:66
void setDesiredVelocity(float x, float z)
Desired planar velocity in character/world XZ (units/sec).
Definition MotionMatcher.cpp:34
eve::Result< void > advance(const eve::SimulationStep &step)
Advance matching and pose blending by one scheduler step.
Definition MotionMatcher.cpp:387
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
constexpr bool isZero() const noexcept
Returns whether this value is zero.
Definition StrongUint64.h:28
Definition Climbing.cpp:19
eve::Result< ClimbingAnimationFrame > advanceClimbingAnimation(animation::AnimPlayer &player, const eve::SimulationStep &step, Vec3 facing, Vec3 pelvisOffset)
Advances a borrowed player once and extracts root motion plus known semantic notifies.
Definition ClimbingAnimation.cpp:67
eve::Result< ClimbingGraphProvider > driveClimbingGraph(animation::AnimGraph &graph, int oneShotNode, ClimbingExecutionId executionId, ClimbingGraphState &state)
Triggers a graph one-shot exactly once for a new climbing execution.
Definition ClimbingAnimation.cpp:105
eve::Result< void > beginClimbingAnimation(animation::AnimPlayer &player, animation::AnimClip &clip, int rootMotionBone)
Starts a borrowed clip in a borrowed player and selects its root-motion bone.
Definition ClimbingAnimation.cpp:31
eve::Result< ClimbingGraphProvider > driveClimbingMotionMatching(animation::MotionMatcher &matcher, const eve::SimulationStep &step, Vec3 desiredVelocity, float desiredYaw, ClimbingGraphState &state)
Advances ordinary locomotion Motion Matching and marks it as the current presentation provider.
Definition ClimbingAnimation.cpp:130
@ BranchClose
@ CollisionCompact
@ ContactRightHand
@ BranchOpen
@ ContactLeftHand
ClimbingGraphProvider useDirectClimbingPose(ClimbingExecutionId executionId, ClimbingGraphState &state) noexcept
Selects the explicit no-graph degradation path without mutating gameplay authority.
Definition ClimbingAnimation.cpp:147
ClimbingGraphProvider
Presentation provider selected for the climbing action pose.
Definition ClimbingAnimation.h:21
@ MotionMatching
@ DirectPoseConstraints
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ InvariantViolation
@ NoOp
@ Applied
Stable animation asset and graph binding metadata.
Definition Climbing.h:100
Owning result of extracting one animation frame for authoritative climbing motion.
Definition ClimbingAnimation.h:30
std::uint32_t ignoredNotifyCount
Definition ClimbingAnimation.h:33
ClimbingMotionInput motion
Definition ClimbingAnimation.h:31
std::uint32_t recognizedNotifyCount
Definition ClimbingAnimation.h:32
Non-authoritative graph projection state; contains no borrowed pointers.
Definition ClimbingAnimation.h:24
std::vector< ClimbingNotifyKind > notifies
Owning semantic notifies crossed by the animation player during this exact simulation step.
Definition Climbing.h:547
Small owning world-space vector used at climbing module boundaries.
Definition ClimbingPrimitives.h:18