Owns multiple cloth sheets and advances their contacts synchronously. @ownership Owns every layer; no external runtime pointers are retained. @thread All operations run on the owning physics thread, between draw calls. @reentrancy No callbacks. No concurrent calls or layer updates during update(). Runtime-only state; no persistence or GPU parity is claimed. Replays use fixed dt and stable layer order, with a 1e-5 metre tolerance on the same CPU build. 更多...
#include <LayeredCloth3D.h>
Public 成员函数 | |
| LayeredCloth3D (int count, int cols, int rows, float spacing, float gap, float x, float y, float z) | |
| Construct parallel XZ grids, separated along +Y. | |
| LayeredCloth3D (std::span< const ClothModel > models) | |
| Copy validated arbitrary mesh models; source span is borrowed only during construction. | |
| ~LayeredCloth3D () | |
| Release owned runtime layers; render resources follow the graphics owner. | |
| LayeredCloth3D (const LayeredCloth3D &)=delete | |
| Owned layers cannot be copied between groups. | |
| LayeredCloth3D & | operator= (const LayeredCloth3D &)=delete |
| Owned layers cannot be copy-assigned between groups. | |
| Cloth3D & | layer (int index) |
| Borrow a layer for synchronous configuration; valid until owner destruction. Do not destroy or independently update it while the group is active. | |
| int | getLayerCount () const |
| Return the number of owned sheets. | |
| void | update (float dt) |
| Advance all layers by finite dt in [0,0.05], without dropping time. | |
| void | setSolver (int substeps, int passes) |
| Configure substeps [1,32] and coupling passes [1,16]; throws on invalid input. | |
| void | setInterCollision (bool enabled) |
| Enable or disable only contacts between different sheets. | |
| bool | getInterCollision () const |
| Return whether inter-layer contacts are enabled. | |
| int | getContactCount () const |
| Return projected contacts in the most recent update, including repeated passes. | |
| void | setWindVelocity (float x, float y, float z) |
| Set the air velocity of every sheet; throws on nonfinite input. | |
| void | reset () |
| Restore every layer's authored pose and clear contact statistics. | |
| void | draw (graphics::Graphics *gfx) |
| Draw owned cloth surfaces in an open 3D frame. | |
详细描述
Owns multiple cloth sheets and advances their contacts synchronously. @ownership Owns every layer; no external runtime pointers are retained. @thread All operations run on the owning physics thread, between draw calls. @reentrancy No callbacks. No concurrent calls or layer updates during update(). Runtime-only state; no persistence or GPU parity is claimed. Replays use fixed dt and stable layer order, with a 1e-5 metre tolerance on the same CPU build.
在文件 LayeredCloth3D.h 第 15 行定义.
构造及析构函数说明
◆ LayeredCloth3D() [1/3]
| eve::physics::LayeredCloth3D::LayeredCloth3D | ( | int | count, |
| int | cols, | ||
| int | rows, | ||
| float | spacing, | ||
| float | gap, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Construct parallel XZ grids, separated along +Y.
- 异常
-
eve::Exception for invalid grid, count, gap or coordinates. @cost Allocation and constraint baking scale with total grid particles; construct once and amortize over simulation frames.
在文件 Cloth3D.cpp 第 1368 行定义.
◆ LayeredCloth3D() [2/3]
|
explicit |
Copy validated arbitrary mesh models; source span is borrowed only during construction.
- 异常
-
eve::Exception if the model span is empty. @cost Copies topology and allocates each runtime once, amortized over frames.
在文件 Cloth3D.cpp 第 1385 行定义.
引用了 model.
◆ ~LayeredCloth3D()
|
default |
Release owned runtime layers; render resources follow the graphics owner.
◆ LayeredCloth3D() [3/3]
|
delete |
Owned layers cannot be copied between groups.
成员函数说明
◆ draw()
| void eve::physics::LayeredCloth3D::draw | ( | graphics::Graphics * | gfx | ) |
Draw owned cloth surfaces in an open 3D frame.
- 参数
-
gfx Borrowed graphics ABI pointer, used only for this call; must be nonnull.
在文件 Cloth3D.cpp 第 1412 行定义.
◆ getContactCount()
| int eve::physics::LayeredCloth3D::getContactCount | ( | ) | const |
Return projected contacts in the most recent update, including repeated passes.
在文件 Cloth3D.cpp 第 1403 行定义.
◆ getInterCollision()
| bool eve::physics::LayeredCloth3D::getInterCollision | ( | ) | const |
Return whether inter-layer contacts are enabled.
在文件 Cloth3D.cpp 第 1402 行定义.
◆ getLayerCount()
| int eve::physics::LayeredCloth3D::getLayerCount | ( | ) | const |
◆ layer()
| Cloth3D & eve::physics::LayeredCloth3D::layer | ( | int | index | ) |
Borrow a layer for synchronous configuration; valid until owner destruction. Do not destroy or independently update it while the group is active.
- 异常
-
eve::Exception for invalid index.
在文件 Cloth3D.cpp 第 1390 行定义.
引用了 getLayerCount() , 以及 index.
◆ operator=()
|
delete |
Owned layers cannot be copy-assigned between groups.
◆ reset()
| void eve::physics::LayeredCloth3D::reset | ( | ) |
Restore every layer's authored pose and clear contact statistics.
在文件 Cloth3D.cpp 第 1408 行定义.
◆ setInterCollision()
| void eve::physics::LayeredCloth3D::setInterCollision | ( | bool | enabled | ) |
◆ setSolver()
| void eve::physics::LayeredCloth3D::setSolver | ( | int | substeps, |
| int | passes | ||
| ) |
Configure substeps [1,32] and coupling passes [1,16]; throws on invalid input.
在文件 Cloth3D.cpp 第 1395 行定义.
◆ setWindVelocity()
| void eve::physics::LayeredCloth3D::setWindVelocity | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Set the air velocity of every sheet; throws on nonfinite input.
在文件 Cloth3D.cpp 第 1404 行定义.
◆ update()
| void eve::physics::LayeredCloth3D::update | ( | float | dt | ) |
Advance all layers by finite dt in [0,0.05], without dropping time.
- 异常
-
eve::Exception on invalid dt or a destroyed layer, before mutation. @cost Substeps times constraint iterations plus broad-phase candidate triangle contacts; dense overlaps can be quadratic in triangle count.
在文件 Cloth3D.cpp 第 1415 行定义.
该类的文档由以下文件生成:
- src/modules/physics/cloth/LayeredCloth3D.h
- src/modules/physics/cloth/Cloth3D.cpp