Configure then bind/run a float motion into a MotionRuntime. 更多...
#include <MotionBuilder.h>
Public 成员函数 | |
| MotionBuilder (MotionRuntime &runtime, float from, float to, float duration) | |
| Motion builder. | |
| MotionBuilder & | ease (std::string kind) |
| Ease. | |
| MotionBuilder & | delay (float seconds) |
| Delay. | |
| MotionBuilder & | loops (int count, MotionLoopMode mode=MotionLoopMode::Restart) |
| Loops. | |
| MotionBuilder & | onUpdate (MotionRuntime::FloatCallback cb) |
| On update. | |
| MotionBuilder & | onComplete (MotionRuntime::VoidCallback cb) |
| On complete. | |
| MotionBuilder & | onCancel (MotionRuntime::VoidCallback cb) |
| On cancel. | |
| MotionBuilder & | cancelOnError (bool enabled) |
| Cancel on error. | |
| MotionBuilder & | style (MotionStyle style) |
| Select Tween / Punch / Shake evaluation. | |
| MotionBuilder & | frequency (int count) |
| Oscillation count for Punch/Shake (default 10). | |
| MotionBuilder & | dampingRatio (float ratio) |
| Damping ratio for Punch/Shake (0 = none, 1 = full). | |
| MotionBuilder & | seed (std::uint32_t value) |
| Deterministic seed for Shake signs. | |
| MotionBuilder & | to (IMotionFloatSink &sink) |
| Attach a sink without spawning (for MotionSequence). | |
| eve::Result< MotionHandle > | run () |
| Start without a sink; read values via MotionRuntime::floatValue. | |
| eve::Result< MotionHandle > | bind (IMotionFloatSink &sink) |
Start and push each sample into sink (borrowed). | |
| MotionRuntime & | runtime () noexcept |
| const MotionRuntime & | runtime () const noexcept |
| eve::Result< MotionRuntime::FloatDesc > | takeDesc () |
| Extract the configured desc for sequence scheduling (consumes builder). | |
友元 | |
| class | MotionSequence |
详细描述
Configure then bind/run a float motion into a MotionRuntime.
- 注解
bind(sink)/to(sink)borrow the sink; the caller must keep it alive while the motion is active. Prefer a stack/test-owned sink or a module-owned one.
在文件 MotionBuilder.h 第 26 行定义.
构造及析构函数说明
◆ MotionBuilder()
| eve::animation::MotionBuilder::MotionBuilder | ( | MotionRuntime & | runtime, |
| float | from, | ||
| float | to, | ||
| float | duration | ||
| ) |
Motion builder.
在文件 MotionBuilder.cpp 第 17 行定义.
引用了 duration, eve::animation::MotionRuntime::FloatDesc::duration, eve::animation::MotionRuntime::FloatDesc::from, from, eve::animation::MotionRuntime::FloatDesc::to , 以及 to.
成员函数说明
◆ bind()
| eve::Result< MotionHandle > eve::animation::MotionBuilder::bind | ( | IMotionFloatSink & | sink | ) |
Start and push each sample into sink (borrowed).
在文件 MotionBuilder.cpp 第 72 行定义.
引用了 eve::Result< T >::failure(), eve::animation::MotionRuntime::FloatDesc::sink , 以及 eve::animation::MotionRuntime::spawnFloat().
◆ cancelOnError()
| MotionBuilder & eve::animation::MotionBuilder::cancelOnError | ( | bool | enabled | ) |
Cancel on error.
在文件 MotionBuilder.cpp 第 55 行定义.
引用了 eve::animation::MotionRuntime::FloatDesc::cancelOnError , 以及 enabled.
◆ dampingRatio()
| MotionBuilder & eve::animation::MotionBuilder::dampingRatio | ( | float | ratio | ) |
Damping ratio for Punch/Shake (0 = none, 1 = full).
在文件 MotionBuilder.cpp 第 234 行定义.
◆ delay()
| MotionBuilder & eve::animation::MotionBuilder::delay | ( | float | seconds | ) |
◆ ease()
| MotionBuilder & eve::animation::MotionBuilder::ease | ( | std::string | kind | ) |
◆ frequency()
| MotionBuilder & eve::animation::MotionBuilder::frequency | ( | int | count | ) |
Oscillation count for Punch/Shake (default 10).
在文件 MotionBuilder.cpp 第 230 行定义.
引用了 count , 以及 eve::animation::MotionRuntime::FloatDesc::frequency.
◆ loops()
| MotionBuilder & eve::animation::MotionBuilder::loops | ( | int | count, |
| MotionLoopMode | mode = MotionLoopMode::Restart |
||
| ) |
Loops.
在文件 MotionBuilder.cpp 第 34 行定义.
引用了 count, eve::animation::MotionRuntime::FloatDesc::loopMode , 以及 eve::animation::MotionRuntime::FloatDesc::loops.
◆ onCancel()
| MotionBuilder & eve::animation::MotionBuilder::onCancel | ( | MotionRuntime::VoidCallback | cb | ) |
◆ onComplete()
| MotionBuilder & eve::animation::MotionBuilder::onComplete | ( | MotionRuntime::VoidCallback | cb | ) |
On complete.
在文件 MotionBuilder.cpp 第 45 行定义.
◆ onUpdate()
| MotionBuilder & eve::animation::MotionBuilder::onUpdate | ( | MotionRuntime::FloatCallback | cb | ) |
◆ run()
| eve::Result< MotionHandle > eve::animation::MotionBuilder::run | ( | ) |
Start without a sink; read values via MotionRuntime::floatValue.
在文件 MotionBuilder.cpp 第 65 行定义.
引用了 eve::Result< T >::failure(), eve::animation::MotionRuntime::FloatDesc::sink , 以及 eve::animation::MotionRuntime::spawnFloat().
◆ runtime() [1/2]
|
inlinenoexcept |
在文件 MotionBuilder.h 第 68 行定义.
◆ runtime() [2/2]
|
inlinenoexcept |
在文件 MotionBuilder.h 第 67 行定义.
◆ seed()
| MotionBuilder & eve::animation::MotionBuilder::seed | ( | std::uint32_t | value | ) |
Deterministic seed for Shake signs.
在文件 MotionBuilder.cpp 第 238 行定义.
引用了 eve::animation::MotionRuntime::FloatDesc::seed , 以及 value.
◆ style()
| MotionBuilder & eve::animation::MotionBuilder::style | ( | MotionStyle | style | ) |
Select Tween / Punch / Shake evaluation.
在文件 MotionBuilder.cpp 第 226 行定义.
引用了 style() , 以及 eve::animation::MotionRuntime::FloatDesc::style.
被这些函数引用 eve::animation::Animation::punch(), eve::animation::Animation::shake() , 以及 style().
◆ takeDesc()
| eve::Result< MotionRuntime::FloatDesc > eve::animation::MotionBuilder::takeDesc | ( | ) |
Extract the configured desc for sequence scheduling (consumes builder).
- 后置条件
- Further run/bind/takeDesc fail with PreconditionViolation.
在文件 MotionBuilder.cpp 第 79 行定义.
引用了 eve::Result< T >::failure() , 以及 eve::Result< T >::success().
◆ to()
| MotionBuilder & eve::animation::MotionBuilder::to | ( | IMotionFloatSink & | sink | ) |
Attach a sink without spawning (for MotionSequence).
- 注解
- Does not start playback; call run()/bind() or hand to a sequence.
在文件 MotionBuilder.cpp 第 60 行定义.
友元及相关函数文档
◆ MotionSequence
|
friend |
在文件 MotionBuilder.h 第 77 行定义.
该类的文档由以下文件生成:
- src/modules/animation/MotionBuilder.h
- src/modules/animation/MotionBuilder.cpp