Lightweight Verlet + XPBD simulator for guide curves only. 更多...
#include <Simulation.h>
Public 成员函数 | |
| GuideSimulator ()=default | |
| Guide simulator. | |
| Result< void > | reset (const StrandsDatas &guides, const GuideSimParams ¶ms={}) |
Capture rest topology and pin every curve root. @ownership Copies guides; caller retains the source. | |
| void | clear () |
| Clears . | |
| void | setParams (const GuideSimParams ¶ms) |
| Sets the params. | |
| const GuideSimParams & | params () const |
| Params. | |
| bool | isReady () const |
| True when ready. | |
| size_t | particleCount () const |
| Particle count. | |
| size_t | curveCount () const |
| Curve count. | |
| Result< void > | setPinnedRoots (const float *rootPositionsXYZ, int rootCount) |
| Teleport pinned roots (e.g. after skin binding deform). | |
| Result< void > | step (float dt) |
Advance simulation by dt seconds (clamped by params.maxDt). | |
| Result< StrandsDatas > | snapshot () const |
Export current particle positions as StrandsDatas (same topology). @ownership Returned buffer uniquely owned by the caller. | |
详细描述
Lightweight Verlet + XPBD simulator for guide curves only.
Owns mutable particle state derived from a rest StrandsDatas. Call snapshot() to obtain a deformed guides buffer for interpolateStrands.
@thread Affine to the caller; not synchronized. @reentrancy Does not invoke callbacks. @determinism Tolerance-bounded for identical params/seeded inputs.
在文件 Simulation.h 第 52 行定义.
构造及析构函数说明
◆ GuideSimulator()
|
default |
Guide simulator.
成员函数说明
◆ clear()
| void eve::graphics::hair::GuideSimulator::clear | ( | ) |
Clears .
在文件 Simulation.cpp 第 78 行定义.
◆ curveCount()
|
inline |
Curve count.
在文件 Simulation.h 第 77 行定义.
◆ isReady()
|
inline |
◆ params()
|
inline |
◆ particleCount()
|
inline |
Particle count.
在文件 Simulation.h 第 75 行定义.
◆ reset()
| Result< void > eve::graphics::hair::GuideSimulator::reset | ( | const StrandsDatas & | guides, |
| const GuideSimParams & | params = {} |
||
| ) |
Capture rest topology and pin every curve root. @ownership Copies guides; caller retains the source.
在文件 Simulation.cpp 第 18 行定义.
引用了 eve::graphics::hair::GuideSimParams::compliance, eve::graphics::hair::StrandsDatas::curveCount(), eve::graphics::hair::StrandsDatas::curvePoints(), eve::graphics::hair::GuideSimParams::damping, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::InvariantViolation, eve::graphics::hair::GuideSimParams::iterations, eve::graphics::hair::GuideSimParams::maxDt, ok, p, params(), eve::graphics::hair::StrandsDatas::pointCount(), eve::graphics::hair::StrandsDatas::points(), position, s, eve::Result< T >::success() , 以及 eve::graphics::hair::StrandsDatas::validate().
◆ setParams()
| void eve::graphics::hair::GuideSimulator::setParams | ( | const GuideSimParams & | params | ) |
◆ setPinnedRoots()
| Result< void > eve::graphics::hair::GuideSimulator::setPinnedRoots | ( | const float * | rootPositionsXYZ, |
| int | rootCount | ||
| ) |
Teleport pinned roots (e.g. after skin binding deform).
- 参数
-
rootPositionsXYZ Packed xyz, length = 3 * curveCount().
在文件 Simulation.cpp 第 95 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), idx, eve::InvalidArgument, isReady(), p , 以及 eve::Result< T >::success().
◆ snapshot()
| Result< StrandsDatas > eve::graphics::hair::GuideSimulator::snapshot | ( | ) | const |
Export current particle positions as StrandsDatas (same topology). @ownership Returned buffer uniquely owned by the caller.
在文件 Simulation.cpp 第 201 行定义.
引用了 curve, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::InvariantViolation, isReady(), eve::graphics::hair::StrandCurve::pointOffset, points, eve::graphics::hair::StrandsDatas::setCurves(), eve::graphics::hair::StrandsDatas::setPoints(), eve::Result< T >::success(), valid , 以及 eve::graphics::hair::StrandsDatas::validate().
◆ step()
| Result< void > eve::graphics::hair::GuideSimulator::step | ( | float | dt | ) |
Advance simulation by dt seconds (clamped by params.maxDt).
在文件 Simulation.cpp 第 166 行定义.
引用了 eve::graphics::hair::GuideSimParams::damping, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::hair::GuideSimParams::gravity, eve::InvalidArgument, isReady(), eve::graphics::hair::GuideSimParams::maxDt, eve::Result< T >::success() , 以及 eve::graphics::hair::GuideSimParams::wind.
该类的文档由以下文件生成:
- src/modules/graphics/hair/Simulation.h
- src/modules/graphics/hair/Simulation.cpp