10#include <unordered_map>
39 int addBlend(
int a,
int b,
float weight = 0.5f);
41 int addAdditive(
int base,
int additive,
float weight = 1.f);
43 int addLayer(
int base,
int overlay,
float weight = 1.f);
45 int addOneShot(
int base,
int shot,
float fadeIn = 0.1f,
float fadeOut = 0.1f);
47 int addBlendSpace1D();
49 int addBlendSpace2D();
52 void addBlendSpace1DPoint(
int node,
float x,
int child);
54 void addBlendSpace2DPoint(
int node,
float x,
float y,
int child);
56 void setBoneMask(
int node,
int boneIndex,
float weight,
bool includeChildren =
false);
58 void clearBoneMask(
int node);
61 void setRoot(
int node);
65 int getNodeCount()
const {
return static_cast<int>(nodes_.size()); }
69 void setPosition1D(
int node,
float x);
71 void setPosition2D(
int node,
float x,
float y);
73 void setSpeed(
int node,
float speed);
75 void trigger(
int node);
77 bool isOneShotActive(
int node)
const;
85 bool setAdditiveReferenceCompat(
int node,
const std::string&
reference);
87 std::string getAdditiveReference(
int node)
const;
92 void update(
float dt);
105 [[nodiscard]]
bool hasCurrentTick() const noexcept
override {
return hasLastTick_; }
110 enum class Kind { Clip, Blend,
Additive, Layer, OneShot, BlendSpace1D, BlendSpace2D };
112 float x = 0.f,
y = 0.f;
116 Kind
kind = Kind::Clip;
117 AnimClip*
clip =
nullptr;
122 float x = 0.f,
y = 0.f;
123 float fadeIn = 0.1f, fadeOut = 0.1f;
125 AnimAdditiveReference additiveReference = AnimAdditiveReference::Identity;
126 std::vector<Point>
points;
127 std::vector<float>
mask;
130 unsigned cacheGeneration = 0;
133 int addNode(Kind
kind);
134 Node& requireNode(
int node);
135 const Node& requireNode(
int node)
const;
136 void requireChild(
int child)
const;
138 const AnimPose& evaluateBlendSpace(Node&
node,
bool twoDimensional);
139 void blendMasked(AnimPose& out,
const AnimPose& base,
const AnimPose& overlay,
float weight,
140 const std::vector<float>*
mask)
const;
141 void applyAdditive(AnimPose& out,
const AnimPose& base,
const AnimPose& delta,
float weight,
142 const std::vector<float>*
mask, AnimAdditiveReference
reference)
const;
144 AnimSkeleton* skeleton_ =
nullptr;
145 std::vector<Node> nodes_;
148 unsigned generation_ = 0;
150 bool hasLastTick_ =
false;
152 void updateUnchecked(
float dt);
AuthorityStoreHandleRef reference
#define EVENGINE_API_WORLD
std::shared_ptr< const std::vector< glm::vec2 > > points
Common time values and an injectable deterministic simulation clock.
Move-only operation result carrying either a value or Status.
Keyframed skeletal animation clip (local TRS tracks per bone). Script type: AnimClip.
Composable runtime pose graph supporting clips, blends, additive layers, per-bone masks,...
eve::SimulationTick currentTick() const noexcept override
Current tick.
int getRoot() const
Returns the root.
bool hasCurrentTick() const noexcept override
True when current tick.
AnimPose * getPose() override
Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object rema...
~AnimGraph() override=default
Anim graph.
AnimGraph & operator=(const AnimGraph &)=delete
AnimGraph(const AnimGraph &)=delete
AnimSkeleton * getSkeleton() const override
Return the graph skeleton. @ownership Borrowed @lifetime Valid while the owning animation object rema...
int getNodeCount() const
Returns the node count.
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
Borrowed pose provider consumed by AnimLayerMixer.
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
std::vector< OnnxNamedTensor > evaluate(const ModelData &, std::span< const OnnxNamedTensor >, const std::vector< std::string > &, OnnxCompute *, OnnxRunOptions options)
Evaluate.
One deterministic fixed-step emitted by SimulationClock.