载入中...
搜索中...
未找到
ActionTimeline.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10#include "common/Identity.h"
11#include "common/Result.h"
13#include "common/Time.h"
14#include "common/Value.h"
15
16#include <cstdint>
17#include <optional>
18#include <string>
19#include <utility>
20#include <vector>
21
22namespace eve::action {
23
25inline constexpr std::string_view kActionTimelineSchemaId = "eve.action.timeline";
27inline constexpr std::uint64_t kActionTimelineSchemaVersion = 4;
28
30enum class ActionBlendCurve : std::uint8_t {
31 Linear,
33};
34
51
74
76[[nodiscard]] EVENGINE_API_PLATFORM std::string_view actionBlendCurveName(ActionBlendCurve curve) noexcept;
78[[nodiscard]] EVENGINE_API_PLATFORM std::optional<ActionBlendCurve> actionBlendCurveFromName(
79 std::string_view name) noexcept;
80
82enum class ActionTrackKind : std::uint8_t {
85 Effect,
86 Audio,
87 Camera,
89 Tag,
90 Custom,
91};
92
94[[nodiscard]] EVENGINE_API_PLATFORM std::string_view actionTrackKindName(ActionTrackKind kind) noexcept;
97
109
122
126 std::string label;
128 bool muted = false;
129 bool locked = false;
130 std::vector<ActionNotify> notifies;
131 std::vector<ActionNotifyState> states;
132
134 auto operator<=>(const ActionTrack&) const = default;
135};
136
138enum class ActionTimelineEventKind : std::uint8_t { Notify, StateEnter, StateExit };
139
157
170
181 Duration duration = Duration::zero();
183 std::string animationUri;
184 std::vector<ActionAnimationSection> animationSections;
187 std::vector<Duration> splitTimestamps;
188 std::vector<ActionTrack> tracks;
190
192 [[nodiscard]] Result<void> validate() const;
194 [[nodiscard]] std::size_t sectionCount() const noexcept { return splitTimestamps.size() + 1; }
196 [[nodiscard]] Result<std::pair<Duration, Duration>> sectionRange(std::size_t index) const;
197
204 bool includePrevious = false) const;
205
211 [[nodiscard]] Result<std::vector<ActionActiveBlock>> activeBlocks(Duration time) const;
212
214 [[nodiscard]] Result<Value> toValue() const;
216 [[nodiscard]] static Result<ActionTimeline> fromValue(const Value& value);
217};
218
219} // namespace eve::action
double value
float duration
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Strong identity values shared by persistence, content and logical-name APIs.
std::string text
TokenKind kind
std::string name
graphics::Canvas * previous
Move-only, checked operation results for the common layer.
Persistent data-contract version identity.
double current
Heightmap curve
Common time values and an injectable deterministic simulation clock.
uint32_t index
Owning, renderer-independent dynamic values.
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
static constexpr Duration zero() noexcept
Return zero duration.
Definition Time.h:60
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
std::map< std::string, Value > Object
Definition Value.h:34
std::string_view actionTrackKindName(ActionTrackKind kind) noexcept
Stable lowercase protocol spelling for a track kind.
std::optional< ActionBlendCurve > actionBlendCurveFromName(std::string_view name) noexcept
Parse a persisted montage cross-fade curve name.
constexpr std::uint64_t kActionTimelineSchemaVersion
Current action timeline schema version.
constexpr std::string_view kActionTimelineSchemaId
Canonical schema identifier for persisted action timelines.
Result< ActionTrackKind > parseActionTrackKind(std::string_view text)
Parse a stable track kind spelling.
std::string_view actionBlendCurveName(ActionBlendCurve curve) noexcept
Stable persisted name for a montage cross-fade curve.
ActionTimelineEventKind
Boundary emitted by deterministic timeline sampling.
ActionTrackKind
Semantic lane kind; hosts choose presentation without changing data.
ActionBlendCurve
Built-in deterministic cross-fade curve evaluated without asset callbacks.
Owning per-step sample of one currently active timeline state.
auto operator<=>(const ActionActiveBlock &) const =default
Operator <=>.
Objective animation segment placed on the montage presentation lane.
Duration sourceStart
Clip-local trim-in timestamp.
ActionBlendCurve blendCurve
Curve used for the incoming cross-fade.
auto operator<=>(const ActionAnimationSection &) const =default
Operator <=>.
Duration sourceEnd
Clip-local trim-out timestamp; zero means the physical clip end.
Montage-wide presentation settings persisted with the action timeline.
auto operator<=>(const ActionMontageSettings &) const =default
Operator <=>.
Typed interval with explicit enter/exit boundaries.
auto operator<=>(const ActionNotifyState &) const =default
Operator <=>.
Instantaneous typed event placed on an action track.
auto operator<=>(const ActionNotify &) const =default
Operator <=>.
Owning event projection returned by the runtime sampler.
ActionTimelineEventKind kind
auto operator<=>(const ActionTimelineEvent &) const =default
Operator <=>.
Canonical action timeline asset shared by runtime and editor.
std::size_t sectionCount() const noexcept
Number of objective physical sections.
ActionMontageSettings montage
std::vector< ActionAnimationSection > animationSections
std::string animationUri
Compatibility-only single-clip projection; v2 runtime uses animationSections.
std::vector< ActionTrack > tracks
std::vector< Duration > splitTimestamps
Sorted objective split timestamps forming N+1 physical sections.
Ordered semantic lane in one action timeline.
std::vector< ActionNotifyState > states
std::vector< ActionNotify > notifies
auto operator<=>(const ActionTrack &) const =default
Operator <=>.