载入中...
搜索中...
未找到
AnimSyncGroup.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Time.h"
5
6#include <vector>
7
8namespace eve::animation {
9
10class AnimPlayer;
11
14public:
16 void addPlayer(AnimPlayer* player, float phaseOffset = 0.f);
18 void clear() { entries_.clear(); leader_ = 0; phase_ = 0.f; usedMarkerSync_ = false; }
20 int getCount() const { return static_cast<int>(entries_.size()); }
22 void setLeader(int index);
24 int getLeader() const { return leader_; }
26 [[nodiscard]] eve::Result<void> advance(const eve::SimulationStep& step);
28 void update(float dt);
30 float getPhase() const { return phase_; }
32 bool getUsedMarkerSync() const { return usedMarkerSync_; }
33
34private:
35 struct Entry { AnimPlayer* player = nullptr; float phaseOffset = 0.f; };
36 std::vector<Entry> entries_;
37 int leader_ = 0;
38 float phase_ = 0.f;
39 bool usedMarkerSync_ = false;
41 bool hasLastTick_ = false;
42};
43
44} // namespace eve::animation
#define EVENGINE_API_WORLD
Definition Export.h:109
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:314
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer.
Definition AnimPlayer.h:30
Marker-aware synchronization group for locomotion animation players.
int getLeader() const
Returns the leader.
float getPhase() const
Returns the phase.
bool getUsedMarkerSync() const
Whether the latest update used compatible sync markers for at least one follower.
int getCount() const
Returns the count.
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158