Volumetric particle soft body using overlapping shape-matching clusters. 更多...
#include <SoftBody3D.h>
Public 成员函数 | |
| ~SoftBody3D () override | |
| Soft body 3 d. | |
| SoftBody3D (const SoftBody3D &)=delete | |
| SoftBody3D & | operator= (const SoftBody3D &)=delete |
| void | update (float dt) |
| Advances using a legacy variable timestep clamped to 50 ms. | |
| eve::Result< void > | step (const eve::SimulationStep &step, const SimulationSettings &settings) override |
| Advances through the checked fixed-step backend contract. | |
| SimulationObservation | observation () const noexcept override |
| Returns completed fixed-step metadata by value. | |
| SimulationBackendKind | kind () const noexcept override |
| Identifies the built-in CPU implementation. | |
| SimulationDeterminism | determinism () const noexcept override |
| Results are repeatable within documented floating-point tolerance. | |
| eve::Result< void > | restoreObservation (const SimulationObservation &observation) override |
| Restores checked progress metadata; particle state is unchanged. | |
| void | setGravity (float x, float y, float z) |
| Sets the gravity. | |
| float | getGravityX () const |
| Returns the gravity x. | |
| float | getGravityY () const |
| Returns the gravity y. | |
| float | getGravityZ () const |
| Returns the gravity z. | |
| void | setDeformationResistance (float value) |
| Sets the deformation resistance. | |
| float | getDeformationResistance () const |
| Returns the deformation resistance. | |
| void | setIterations (int value) |
| Sets the iterations. | |
| int | getIterations () const |
| Returns the iterations. | |
| void | setDamping (float value) |
| Sets the damping. | |
| float | getDamping () const |
| Returns the damping. | |
| void | setParticleRadius (float value) |
| Sets the particle radius. | |
| float | getParticleRadius () const |
| Returns the particle radius. | |
| void | setParticleMass (float value) |
| Sets the particle mass. | |
| float | getParticleMass () const |
| Returns the particle mass. | |
| void | setPlasticity (float yield, float creep, float recovery, float maxDeformation) |
| Sets the plasticity. | |
| float | getPlasticYield () const |
| Returns the plastic yield. | |
| float | getPlasticCreep () const |
| Returns the plastic creep. | |
| float | getPlasticRecovery () const |
| Returns the plastic recovery. | |
| float | getMaxDeformation () const |
| Returns the max deformation. | |
| void | setSelfCollision (bool enabled) |
| Sets the self collision. | |
| bool | getSelfCollision () const |
| Returns the self collision. | |
| void | setBounds (float x, float y, float z, float width, float height, float depth) |
| Sets the bounds. | |
| void | clearBounds () |
| Clears bounds. | |
| void | pin (int index) |
| Pin. | |
| void | unpin (int index) |
| Unpin. | |
| bool | isPinned (int index) const |
| True when pinned. | |
| int | grabAt (float x, float y, float z, float radius) |
| Grab at. | |
| void | moveGrab (float x, float y, float z) |
| Moves grab. | |
| void | releaseGrab () |
| Release grab. | |
| bool | isGrabbing () const |
| True when grabbing. | |
| int | getGrabIndex () const |
| Returns the grab index. | |
| void | applyForce (float x, float y, float z) |
| Applies force. | |
| void | interactAt (float x, float y, float z, float radius, float strength) |
| Interact at. | |
| void | setCollideWorld (World3D *world) |
| Borrows a rigid-body world used for particle contacts. | |
| World3D * | getCollideWorld () const |
| Returns the collide world. | |
| void | setCollisionWorld (softbody::ISoftBodyCollisionWorld *world) |
| Set a backend-neutral borrowed collision provider. @lifetime The provider must outlive this object or be cleared before destruction. | |
| void | reset () |
| Resets . | |
| void | destroy () |
| Destroys . | |
| bool | isDestroyed () const noexcept |
| Whether destroy() has disabled this runtime instance. | |
| int | getCols () const |
| int | getRows () const |
| int | getLayers () const |
| int | getParticleCount () const |
| float | getParticleX (int index) const |
| float | getParticleY (int index) const |
| float | getParticleZ (int index) const |
| void | setParticlePosition (int index, float x, float y, float z) |
| float | getVolumeRatio () const |
| Returns current cell volume divided by undeformed rest volume. | |
Public 成员函数 继承自 eve::physics::ISimulationBackend | |
| virtual | ~ISimulationBackend ()=default |
| Releases the backend; borrowed domain state is not destroyed. | |
静态 Public 成员函数 | |
| static eve::Result< std::unique_ptr< SoftBody3D > > | create (const SoftBody3DDefinition &definition) |
| Creates a soft body from the canonical versioned definition. | |
| static eve::Result< std::unique_ptr< SoftBody3D > > | create (int cols, int rows, int layers, float spacing, float originX, float originY, float originZ) |
| Creates a validated volumetric soft body. | |
详细描述
Volumetric particle soft body using overlapping shape-matching clusters.
Particles form a regular 3D lattice in meter space (+Y up). Every lattice cell is an overlapping eight-particle cluster, which preserves local volume and orientation while allowing elastic and optional plastic deformation. The object is simulation-thread affine and owns all particle/constraint state. A World3D supplied through setCollideWorld() is borrowed and must outlive this object or be cleared before world destruction.
在文件 SoftBody3D.h 第 27 行定义.
构造及析构函数说明
◆ ~SoftBody3D()
|
override |
◆ SoftBody3D()
|
delete |
成员函数说明
◆ applyForce()
| void eve::physics::SoftBody3D::applyForce | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ clearBounds()
|
inline |
Clears bounds.
在文件 SoftBody3D.h 第 121 行定义.
◆ create() [1/2]
|
static |
Creates a soft body from the canonical versioned definition.
- 参数
-
definition Validated owning creation data copied into runtime state.
- 返回
- An owning object, or a structured validation diagnostic.
在文件 SoftBody3D.cpp 第 52 行定义.
引用了 eve::physics::SoftBody3DDefinition::ensureSchemaRegistered() , 以及 valid.
被这些函数引用 create() , 以及 eve::physics::Physics::newSoftBody3D().
◆ create() [2/2]
|
static |
Creates a validated volumetric soft body.
- 参数
-
cols Particle columns along +X, at least 2. rows Particle rows along +Y, at least 2. layers Particle layers along +Z, at least 2. spacing Rest spacing in meters, greater than zero. originX Minimum rest X coordinate. originY Minimum rest Y coordinate. originZ Minimum rest Z coordinate.
- 返回
- An owning object or InvalidArgument diagnostic; no state is published on failure. @thread Call and use the result on the owning simulation thread. @reentrancy No callbacks are invoked.
在文件 SoftBody3D.cpp 第 39 行定义.
◆ destroy()
| void eve::physics::SoftBody3D::destroy | ( | ) |
◆ determinism()
|
inlineoverridevirtualnoexcept |
Results are repeatable within documented floating-point tolerance.
实现了 eve::physics::ISimulationBackend.
在文件 SoftBody3D.h 第 69 行定义.
◆ getCollideWorld()
| World3D * eve::physics::SoftBody3D::getCollideWorld | ( | ) | const |
Returns the collide world.
在文件 SoftBody3DWorldBridge.cpp 第 75 行定义.
◆ getCols()
|
inline |
在文件 SoftBody3D.h 第 171 行定义.
◆ getDamping()
|
inline |
Returns the damping.
在文件 SoftBody3D.h 第 95 行定义.
◆ getDeformationResistance()
| float eve::physics::SoftBody3D::getDeformationResistance | ( | ) | const |
Returns the deformation resistance.
在文件 SoftBody3D.cpp 第 126 行定义.
◆ getGrabIndex()
|
inline |
Returns the grab index.
在文件 SoftBody3D.h 第 138 行定义.
◆ getGravityX()
|
inline |
Returns the gravity x.
在文件 SoftBody3D.h 第 79 行定义.
◆ getGravityY()
|
inline |
Returns the gravity y.
在文件 SoftBody3D.h 第 81 行定义.
◆ getGravityZ()
|
inline |
Returns the gravity z.
在文件 SoftBody3D.h 第 83 行定义.
◆ getIterations()
|
inline |
Returns the iterations.
在文件 SoftBody3D.h 第 91 行定义.
◆ getLayers()
| int eve::physics::SoftBody3D::getLayers | ( | ) | const |
在文件 SoftBody3D.cpp 第 149 行定义.
◆ getMaxDeformation()
| float eve::physics::SoftBody3D::getMaxDeformation | ( | ) | const |
Returns the max deformation.
在文件 SoftBody3D.cpp 第 148 行定义.
◆ getParticleCount()
|
inline |
在文件 SoftBody3D.h 第 174 行定义.
被这些函数引用 eve::physics::SoftBody3DRenderer::draw() , 以及 grabAt().
◆ getParticleMass()
|
inline |
Returns the particle mass.
在文件 SoftBody3D.h 第 103 行定义.
◆ getParticleRadius()
| float eve::physics::SoftBody3D::getParticleRadius | ( | ) | const |
Returns the particle radius.
在文件 SoftBody3D.cpp 第 133 行定义.
◆ getParticleX()
| float eve::physics::SoftBody3D::getParticleX | ( | int | index | ) | const |
◆ getParticleY()
| float eve::physics::SoftBody3D::getParticleY | ( | int | index | ) | const |
◆ getParticleZ()
| float eve::physics::SoftBody3D::getParticleZ | ( | int | index | ) | const |
◆ getPlasticCreep()
| float eve::physics::SoftBody3D::getPlasticCreep | ( | ) | const |
Returns the plastic creep.
在文件 SoftBody3D.cpp 第 146 行定义.
◆ getPlasticRecovery()
| float eve::physics::SoftBody3D::getPlasticRecovery | ( | ) | const |
Returns the plastic recovery.
在文件 SoftBody3D.cpp 第 147 行定义.
◆ getPlasticYield()
| float eve::physics::SoftBody3D::getPlasticYield | ( | ) | const |
Returns the plastic yield.
在文件 SoftBody3D.cpp 第 145 行定义.
◆ getRows()
|
inline |
在文件 SoftBody3D.h 第 172 行定义.
◆ getSelfCollision()
|
inline |
Returns the self collision.
在文件 SoftBody3D.h 第 117 行定义.
◆ getVolumeRatio()
| float eve::physics::SoftBody3D::getVolumeRatio | ( | ) | const |
Returns current cell volume divided by undeformed rest volume.
在文件 SoftBody3D.cpp 第 453 行定义.
◆ grabAt()
| int eve::physics::SoftBody3D::grabAt | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | radius | ||
| ) |
Grab at.
在文件 SoftBody3D.cpp 第 175 行定义.
引用了 best, dx, dy, dz, found, getParticleCount(), moveGrab(), p, radius, x, y , 以及 z.
◆ interactAt()
| void eve::physics::SoftBody3D::interactAt | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | radius, | ||
| float | strength | ||
| ) |
◆ isDestroyed()
|
inlinenoexcept |
Whether destroy() has disabled this runtime instance.
在文件 SoftBody3D.h 第 169 行定义.
◆ isGrabbing()
|
inline |
True when grabbing.
在文件 SoftBody3D.h 第 136 行定义.
◆ isPinned()
| bool eve::physics::SoftBody3D::isPinned | ( | int | index | ) | const |
◆ kind()
|
inlineoverridevirtualnoexcept |
Identifies the built-in CPU implementation.
实现了 eve::physics::ISimulationBackend.
在文件 SoftBody3D.h 第 67 行定义.
◆ moveGrab()
| void eve::physics::SoftBody3D::moveGrab | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ observation()
|
inlineoverridevirtualnoexcept |
Returns completed fixed-step metadata by value.
实现了 eve::physics::ISimulationBackend.
在文件 SoftBody3D.h 第 65 行定义.
被这些函数引用 restoreObservation().
◆ operator=()
|
delete |
◆ pin()
| void eve::physics::SoftBody3D::pin | ( | int | index | ) |
◆ releaseGrab()
|
inline |
Release grab.
在文件 SoftBody3D.h 第 134 行定义.
◆ reset()
| void eve::physics::SoftBody3D::reset | ( | ) |
◆ restoreObservation()
|
overridevirtual |
Restores checked progress metadata; particle state is unchanged.
重载 eve::physics::ISimulationBackend .
在文件 SoftBody3D.cpp 第 442 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), observation(), eve::PreconditionViolation, eve::Status::success(), eve::Result< T >::success() , 以及 valid.
◆ setBounds()
| void eve::physics::SoftBody3D::setBounds | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | width, | ||
| float | height, | ||
| float | depth | ||
| ) |
◆ setCollideWorld()
| void eve::physics::SoftBody3D::setCollideWorld | ( | World3D * | world | ) |
Borrows a rigid-body world used for particle contacts.
- 参数
-
world Nullable observer; pass null to disable world collision. @ownership The soft body never owns the world. @lifetime The world must outlive this object or be cleared before destruction.
在文件 SoftBody3DWorldBridge.cpp 第 69 行定义.
引用了 world.
◆ setCollisionWorld()
|
inline |
Set a backend-neutral borrowed collision provider. @lifetime The provider must outlive this object or be cleared before destruction.
在文件 SoftBody3D.h 第 158 行定义.
引用了 world.
◆ setDamping()
| void eve::physics::SoftBody3D::setDamping | ( | float | value | ) |
◆ setDeformationResistance()
| void eve::physics::SoftBody3D::setDeformationResistance | ( | float | value | ) |
◆ setGravity()
| void eve::physics::SoftBody3D::setGravity | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setIterations()
| void eve::physics::SoftBody3D::setIterations | ( | int | value | ) |
◆ setParticleMass()
| void eve::physics::SoftBody3D::setParticleMass | ( | float | value | ) |
◆ setParticlePosition()
| void eve::physics::SoftBody3D::setParticlePosition | ( | int | index, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ setParticleRadius()
| void eve::physics::SoftBody3D::setParticleRadius | ( | float | value | ) |
◆ setPlasticity()
| void eve::physics::SoftBody3D::setPlasticity | ( | float | yield, |
| float | creep, | ||
| float | recovery, | ||
| float | maxDeformation | ||
| ) |
Sets the plasticity.
在文件 SoftBody3D.cpp 第 138 行定义.
◆ setSelfCollision()
|
inline |
◆ step()
|
overridevirtual |
Advances through the checked fixed-step backend contract.
实现了 eve::physics::ISimulationBackend.
在文件 SoftBody3D.cpp 第 428 行定义.
引用了 eve::Applied, eve::SimulationStep::delta, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::PreconditionViolation, eve::Duration::seconds(), settings, eve::Status::success(), eve::Result< T >::success() , 以及 valid.
◆ unpin()
| void eve::physics::SoftBody3D::unpin | ( | int | index | ) |
◆ update()
| void eve::physics::SoftBody3D::update | ( | float | dt | ) |
Advances using a legacy variable timestep clamped to 50 ms.
在文件 SoftBody3D.cpp 第 406 行定义.
该类的文档由以下文件生成:
- src/modules/physics/softbody/SoftBody3D.h
- src/modules/physics/softbody/SoftBody3D.cpp
- src/modules/physics/SoftBody3DWorldBridge.cpp
Public 成员函数 继承自