Composable runtime pose graph supporting clips, blends, additive layers, per-bone masks, one-shots and 1D/2D blend spaces. Script type: AnimGraph.
更多...
#include <AnimGraph.h>
Public 成员函数 | |
| AnimGraph (AnimSkeleton *skeleton) | |
| Anim graph. | |
| ~AnimGraph () override=default | |
| Anim graph. | |
| AnimGraph (const AnimGraph &)=delete | |
| AnimGraph & | operator= (const AnimGraph &)=delete |
| int | addClip (AnimClip *clip) |
| Adds clip. | |
| int | addBlend (int a, int b, float weight=0.5f) |
| Adds blend. | |
| int | addAdditive (int base, int additive, float weight=1.f) |
| Adds additive. | |
| int | addLayer (int base, int overlay, float weight=1.f) |
| Adds layer. | |
| int | addOneShot (int base, int shot, float fadeIn=0.1f, float fadeOut=0.1f) |
| Adds one shot. | |
| int | addBlendSpace1D () |
| Adds blend space 1 d. | |
| int | addBlendSpace2D () |
| Adds blend space 2 d. | |
| void | addBlendSpace1DPoint (int node, float x, int child) |
| Adds blend space 1 d point. | |
| void | addBlendSpace2DPoint (int node, float x, float y, int child) |
| Adds blend space 2 d point. | |
| void | setBoneMask (int node, int boneIndex, float weight, bool includeChildren=false) |
| Sets the bone mask. | |
| void | clearBoneMask (int node) |
| Clears bone mask. | |
| void | setRoot (int node) |
| Sets the root. | |
| int | getRoot () const |
| Returns the root. | |
| int | getNodeCount () const |
| Returns the node count. | |
| void | setWeight (int node, float weight) |
| Sets the weight. | |
| void | setPosition1D (int node, float x) |
| Sets the position 1 d. | |
| void | setPosition2D (int node, float x, float y) |
| Sets the position 2 d. | |
| void | setSpeed (int node, float speed) |
| Sets the speed. | |
| void | trigger (int node) |
| Trigger. | |
| bool | isOneShotActive (int node) const |
| True when one shot active. | |
| eve::Result< void > | setAdditiveReference (int node, const std::string &reference) |
| Set additive reference for an Additive node: "bind" or "identity". Defaults to identity (sample is already a local-space delta). | |
| bool | setAdditiveReferenceCompat (int node, const std::string &reference) |
| Compatibility facade over setAdditiveReference. | |
| std::string | getAdditiveReference (int node) const |
| Return "bind" / "identity", or empty for non-additive / invalid nodes. | |
| eve::Result< void > | advance (const eve::SimulationStep &step) override |
| Evaluate the graph using one scheduler-owned deterministic step. | |
| void | update (float dt) |
| Legacy seconds facade; explicitly forwards to advance(). | |
| AnimPose * | getPose () override |
| Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction. | |
| AnimSkeleton * | getSkeleton () const override |
| Return the graph skeleton. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction. | |
| bool | hasCurrentTick () const noexcept override |
| True when current tick. | |
| eve::SimulationTick | currentTick () const noexcept override |
| Current tick. | |
Public 成员函数 继承自 eve::animation::IAnimPoseSource | |
| virtual | ~IAnimPoseSource ()=default |
| Releases IAnimPoseSource resources. | |
| virtual int | getEventCount () const |
| Events emitted by the most recent advance; default is none. | |
| virtual std::string | getEventName (int) const |
| virtual std::string | getEventPayload (int) const |
详细描述
Composable runtime pose graph supporting clips, blends, additive layers, per-bone masks, one-shots and 1D/2D blend spaces. Script type: AnimGraph.
Nodes are stable integer handles. A graph owns runtime state but not skeletons or clips; those must outlive the graph. Call advance(step) once per frame and read getPose(). Graph evaluation is memoized so shared subgraphs sample only once.
在文件 AnimGraph.h 第 26 行定义.
构造及析构函数说明
◆ AnimGraph() [1/2]
|
explicit |
Anim graph.
在文件 AnimGraph.cpp 第 15 行定义.
引用了 eve::animation::AnimSkeleton::getBoneCount() , 以及 eve::animation::AnimPose::resize().
◆ ~AnimGraph()
|
overridedefault |
Anim graph.
◆ AnimGraph() [2/2]
|
delete |
成员函数说明
◆ addAdditive()
| int eve::animation::AnimGraph::addAdditive | ( | int | base, |
| int | additive, | ||
| float | weight = 1.f |
||
| ) |
◆ addBlend()
| int eve::animation::AnimGraph::addBlend | ( | int | a, |
| int | b, | ||
| float | weight = 0.5f |
||
| ) |
◆ addBlendSpace1D()
| int eve::animation::AnimGraph::addBlendSpace1D | ( | ) |
Adds blend space 1 d.
在文件 AnimGraph.cpp 第 89 行定义.
◆ addBlendSpace1DPoint()
| void eve::animation::AnimGraph::addBlendSpace1DPoint | ( | int | node, |
| float | x, | ||
| int | child | ||
| ) |
◆ addBlendSpace2D()
| int eve::animation::AnimGraph::addBlendSpace2D | ( | ) |
Adds blend space 2 d.
在文件 AnimGraph.cpp 第 90 行定义.
◆ addBlendSpace2DPoint()
| void eve::animation::AnimGraph::addBlendSpace2DPoint | ( | int | node, |
| float | x, | ||
| float | y, | ||
| int | child | ||
| ) |
◆ addClip()
| int eve::animation::AnimGraph::addClip | ( | AnimClip * | clip | ) |
◆ addLayer()
| int eve::animation::AnimGraph::addLayer | ( | int | base, |
| int | overlay, | ||
| float | weight = 1.f |
||
| ) |
◆ addOneShot()
◆ advance()
|
overridevirtual |
Evaluate the graph using one scheduler-owned deterministic step.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimGraph.cpp 第 296 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), eve::animation::detail::secondsForStep(), step, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 update().
◆ clearBoneMask()
| void eve::animation::AnimGraph::clearBoneMask | ( | int | node | ) |
◆ currentTick()
|
inlineoverridevirtualnoexcept |
◆ getAdditiveReference()
| std::string eve::animation::AnimGraph::getAdditiveReference | ( | int | node | ) | const |
Return "bind" / "identity", or empty for non-additive / invalid nodes.
在文件 AnimGraph.cpp 第 180 行定义.
引用了 getNodeCount(), eve::animation::Identity, n , 以及 node.
◆ getNodeCount()
|
inline |
◆ getPose()
|
inlineoverridevirtual |
Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimGraph.h 第 97 行定义.
◆ getRoot()
|
inline |
Returns the root.
在文件 AnimGraph.h 第 63 行定义.
◆ getSkeleton()
|
inlineoverridevirtual |
Return the graph skeleton. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimGraph.h 第 103 行定义.
◆ hasCurrentTick()
|
inlineoverridevirtualnoexcept |
◆ isOneShotActive()
| bool eve::animation::AnimGraph::isOneShotActive | ( | int | node | ) | const |
◆ operator=()
◆ setAdditiveReference()
| eve::Result< void > eve::animation::AnimGraph::setAdditiveReference | ( | int | node, |
| const std::string & | reference | ||
| ) |
Set additive reference for an Additive node: "bind" or "identity". Defaults to identity (sample is already a local-space delta).
在文件 AnimGraph.cpp 第 156 行定义.
引用了 eve::Applied, eve::animation::BindPose, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::animation::Identity, eve::InvalidArgument, n, node, reference, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 setAdditiveReferenceCompat().
◆ setAdditiveReferenceCompat()
| bool eve::animation::AnimGraph::setAdditiveReferenceCompat | ( | int | node, |
| const std::string & | reference | ||
| ) |
Compatibility facade over setAdditiveReference.
在文件 AnimGraph.cpp 第 171 行定义.
引用了 node, reference , 以及 setAdditiveReference().
◆ setBoneMask()
| void eve::animation::AnimGraph::setBoneMask | ( | int | node, |
| int | boneIndex, | ||
| float | weight, | ||
| bool | includeChildren = false |
||
| ) |
Sets the bone mask.
在文件 AnimGraph.cpp 第 106 行定义.
引用了 eve::animation::clampf(), eve::animation::AnimSkeleton::getBoneCount(), eve::animation::AnimSkeleton::getParent(), n, node, p , 以及 weight.
◆ setPosition1D()
| void eve::animation::AnimGraph::setPosition1D | ( | int | node, |
| float | x | ||
| ) |
◆ setPosition2D()
| void eve::animation::AnimGraph::setPosition2D | ( | int | node, |
| float | x, | ||
| float | y | ||
| ) |
◆ setRoot()
| void eve::animation::AnimGraph::setRoot | ( | int | node | ) |
◆ setSpeed()
| void eve::animation::AnimGraph::setSpeed | ( | int | node, |
| float | speed | ||
| ) |
◆ setWeight()
| void eve::animation::AnimGraph::setWeight | ( | int | node, |
| float | weight | ||
| ) |
◆ trigger()
| void eve::animation::AnimGraph::trigger | ( | int | node | ) |
◆ update()
| void eve::animation::AnimGraph::update | ( | float | dt | ) |
Legacy seconds facade; explicitly forwards to advance().
在文件 AnimGraph.cpp 第 305 行定义.
引用了 advance(), eve::Result< void >::ignore(), eve::animation::detail::legacyStep() , 以及 step.
该类的文档由以下文件生成:
- src/modules/animation/AnimGraph.h
- src/modules/animation/AnimGraph.cpp
Public 成员函数 继承自