载入中...
搜索中...
未找到
eve::physics::SoftBody3D类 参考final

Volumetric particle soft body using overlapping shape-matching clusters. 更多...

#include <SoftBody3D.h>

类 eve::physics::SoftBody3D 继承关系图:
eve::physics::ISimulationBackend

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()

eve::physics::SoftBody3D::~SoftBody3D ( )
override

Soft body 3 d.

在文件 SoftBody3D.cpp 第 105 行定义.

引用了 destroy().

◆ SoftBody3D()

eve::physics::SoftBody3D::SoftBody3D ( const SoftBody3D &  )
delete

成员函数说明

◆ applyForce()

void eve::physics::SoftBody3D::applyForce ( float  x,
float  y,
float  z 
)

Applies force.

在文件 SoftBody3D.cpp 第 205 行定义.

引用了 x, y , 以及 z.

◆ clearBounds()

void eve::physics::SoftBody3D::clearBounds ( )
inline

Clears bounds.

在文件 SoftBody3D.h 第 121 行定义.

◆ create() [1/2]

eve::Result< std::unique_ptr< SoftBody3D > > eve::physics::SoftBody3D::create ( const SoftBody3DDefinition &  definition)
static

Creates a soft body from the canonical versioned definition.

参数
definitionValidated 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]

eve::Result< std::unique_ptr< SoftBody3D > > eve::physics::SoftBody3D::create ( int  cols,
int  rows,
int  layers,
float  spacing,
float  originX,
float  originY,
float  originZ 
)
static

Creates a validated volumetric soft body.

参数
colsParticle columns along +X, at least 2.
rowsParticle rows along +Y, at least 2.
layersParticle layers along +Z, at least 2.
spacingRest spacing in meters, greater than zero.
originXMinimum rest X coordinate.
originYMinimum rest Y coordinate.
originZMinimum 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 行定义.

引用了 cols, create(), rows , 以及 spacing.

◆ destroy()

void eve::physics::SoftBody3D::destroy ( )

Destroys .

在文件 SoftBody3D.cpp 第 107 行定义.

被这些函数引用 ~SoftBody3D().

◆ determinism()

SimulationDeterminism eve::physics::SoftBody3D::determinism ( ) const
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()

int eve::physics::SoftBody3D::getCols ( ) const
inline

在文件 SoftBody3D.h 第 171 行定义.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ getDamping()

float eve::physics::SoftBody3D::getDamping ( ) const
inline

Returns the damping.

在文件 SoftBody3D.h 第 95 行定义.

◆ getDeformationResistance()

float eve::physics::SoftBody3D::getDeformationResistance ( ) const

Returns the deformation resistance.

在文件 SoftBody3D.cpp 第 126 行定义.

◆ getGrabIndex()

int eve::physics::SoftBody3D::getGrabIndex ( ) const
inline

Returns the grab index.

在文件 SoftBody3D.h 第 138 行定义.

◆ getGravityX()

float eve::physics::SoftBody3D::getGravityX ( ) const
inline

Returns the gravity x.

在文件 SoftBody3D.h 第 79 行定义.

◆ getGravityY()

float eve::physics::SoftBody3D::getGravityY ( ) const
inline

Returns the gravity y.

在文件 SoftBody3D.h 第 81 行定义.

◆ getGravityZ()

float eve::physics::SoftBody3D::getGravityZ ( ) const
inline

Returns the gravity z.

在文件 SoftBody3D.h 第 83 行定义.

◆ getIterations()

int eve::physics::SoftBody3D::getIterations ( ) const
inline

Returns the iterations.

在文件 SoftBody3D.h 第 91 行定义.

◆ getLayers()

int eve::physics::SoftBody3D::getLayers ( ) const

在文件 SoftBody3D.cpp 第 149 行定义.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ getMaxDeformation()

float eve::physics::SoftBody3D::getMaxDeformation ( ) const

Returns the max deformation.

在文件 SoftBody3D.cpp 第 148 行定义.

◆ getParticleCount()

int eve::physics::SoftBody3D::getParticleCount ( ) const
inline

在文件 SoftBody3D.h 第 174 行定义.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw() , 以及 grabAt().

◆ getParticleMass()

float eve::physics::SoftBody3D::getParticleMass ( ) const
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

在文件 SoftBody3D.cpp 第 220 行定义.

引用了 index , 以及 x.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ getParticleY()

float eve::physics::SoftBody3D::getParticleY ( int  index) const

在文件 SoftBody3D.cpp 第 224 行定义.

引用了 index , 以及 y.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ getParticleZ()

float eve::physics::SoftBody3D::getParticleZ ( int  index) const

在文件 SoftBody3D.cpp 第 228 行定义.

引用了 index , 以及 z.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ 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()

int eve::physics::SoftBody3D::getRows ( ) const
inline

在文件 SoftBody3D.h 第 172 行定义.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ getSelfCollision()

bool eve::physics::SoftBody3D::getSelfCollision ( ) const
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 行定义.

引用了 p , 以及 volume.

◆ 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 
)

Interact at.

在文件 SoftBody3D.cpp 第 211 行定义.

引用了 radius, strength, x, y , 以及 z.

◆ isDestroyed()

bool eve::physics::SoftBody3D::isDestroyed ( ) const
inlinenoexcept

Whether destroy() has disabled this runtime instance.

在文件 SoftBody3D.h 第 169 行定义.

被这些函数引用 eve::physics::SoftBody3DRenderer::draw().

◆ isGrabbing()

bool eve::physics::SoftBody3D::isGrabbing ( ) const
inline

True when grabbing.

在文件 SoftBody3D.h 第 136 行定义.

◆ isPinned()

bool eve::physics::SoftBody3D::isPinned ( int  index) const

True when pinned.

在文件 SoftBody3D.cpp 第 170 行定义.

引用了 index , 以及 pinned.

◆ kind()

SimulationBackendKind eve::physics::SoftBody3D::kind ( ) const
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 
)

Moves grab.

在文件 SoftBody3D.cpp 第 194 行定义.

引用了 p, x, y , 以及 z.

被这些函数引用 grabAt().

◆ observation()

SimulationObservation eve::physics::SoftBody3D::observation ( ) const
inlineoverridevirtualnoexcept

Returns completed fixed-step metadata by value.

实现了 eve::physics::ISimulationBackend.

在文件 SoftBody3D.h 第 65 行定义.

被这些函数引用 restoreObservation().

◆ operator=()

SoftBody3D & eve::physics::SoftBody3D::operator= ( const SoftBody3D &  )
delete

◆ pin()

void eve::physics::SoftBody3D::pin ( int  index)

Pin.

在文件 SoftBody3D.cpp 第 162 行定义.

引用了 index , 以及 pinned.

◆ releaseGrab()

void eve::physics::SoftBody3D::releaseGrab ( )
inline

Release grab.

在文件 SoftBody3D.h 第 134 行定义.

◆ reset()

void eve::physics::SoftBody3D::reset ( )

Resets .

在文件 SoftBody3D.cpp 第 242 行定义.

引用了 offset , 以及 p.

◆ restoreObservation()

eve::Result< void > eve::physics::SoftBody3D::restoreObservation ( const SimulationObservation &  observation)
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 
)

Sets the bounds.

在文件 SoftBody3D.cpp 第 151 行定义.

引用了 depth, height, width, x, y , 以及 z.

◆ setCollideWorld()

void eve::physics::SoftBody3D::setCollideWorld ( World3D *  world)

Borrows a rigid-body world used for particle contacts.

参数
worldNullable 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()

void eve::physics::SoftBody3D::setCollisionWorld ( softbody::ISoftBodyCollisionWorld *  world)
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)

Sets the damping.

在文件 SoftBody3D.cpp 第 129 行定义.

引用了 value.

◆ setDeformationResistance()

void eve::physics::SoftBody3D::setDeformationResistance ( float  value)

Sets the deformation resistance.

在文件 SoftBody3D.cpp 第 124 行定义.

引用了 value.

◆ setGravity()

void eve::physics::SoftBody3D::setGravity ( float  x,
float  y,
float  z 
)

Sets the gravity.

在文件 SoftBody3D.cpp 第 118 行定义.

引用了 x, y , 以及 z.

◆ setIterations()

void eve::physics::SoftBody3D::setIterations ( int  value)

Sets the iterations.

在文件 SoftBody3D.cpp 第 128 行定义.

引用了 value.

◆ setParticleMass()

void eve::physics::SoftBody3D::setParticleMass ( float  value)

Sets the particle mass.

在文件 SoftBody3D.cpp 第 134 行定义.

引用了 value.

◆ setParticlePosition()

void eve::physics::SoftBody3D::setParticlePosition ( int  index,
float  x,
float  y,
float  z 
)

在文件 SoftBody3D.cpp 第 232 行定义.

引用了 index, p, x, y , 以及 z.

◆ setParticleRadius()

void eve::physics::SoftBody3D::setParticleRadius ( float  value)

Sets the particle radius.

在文件 SoftBody3D.cpp 第 130 行定义.

引用了 value.

◆ setPlasticity()

void eve::physics::SoftBody3D::setPlasticity ( float  yield,
float  creep,
float  recovery,
float  maxDeformation 
)

Sets the plasticity.

在文件 SoftBody3D.cpp 第 138 行定义.

◆ setSelfCollision()

void eve::physics::SoftBody3D::setSelfCollision ( bool  enabled)
inline

Sets the self collision.

在文件 SoftBody3D.h 第 115 行定义.

引用了 enabled.

◆ step()

eve::Result< void > eve::physics::SoftBody3D::step ( const eve::SimulationStep &  step,
const SimulationSettings &  settings 
)
overridevirtual

◆ unpin()

void eve::physics::SoftBody3D::unpin ( int  index)

Unpin.

在文件 SoftBody3D.cpp 第 166 行定义.

引用了 index , 以及 pinned.

◆ update()

void eve::physics::SoftBody3D::update ( float  dt)

Advances using a legacy variable timestep clamped to 50 ms.

在文件 SoftBody3D.cpp 第 406 行定义.


该类的文档由以下文件生成: