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

Interactive 3D cloth — Verlet particles + distance constraints. Meter space, +Y up, grid laid out in the XZ plane with the top row pinned. 更多...

#include <Cloth3D.h>

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

Public 成员函数

 Cloth3D (int cols, int rows, float spacing, float originX, float originY, float originZ)
 Cloth 3 d.
 
 Cloth3D (const ClothModel &model)
 Create runtime cloth state by copying a reusable ClothModel.
 
 ~Cloth3D ()
 Cloth 3 d.
 
 Cloth3D (const Cloth3D &)=delete
 
Cloth3D & operator= (const Cloth3D &)=delete
 
void update (float dt)
 Updates .
 
eve::Result< void > step (const eve::SimulationStep &step, const SimulationSettings &settings) override
 Advances cloth with the shared ticked backend contract.
 
SimulationObservation observation () const noexcept override
 Returns completed tick/time observables.
 
SimulationBackendKind kind () const noexcept override
 Identifies this production CPU cloth backend.
 
SimulationDeterminism determinism () const noexcept override
 CPU cloth uses bounded floating-point determinism.
 
std::string getBackendName () const
 Return stable backend name for scripts and diagnostics.
 
bool supportsFeature (const std::string &feature) const
 Query a stable cloth feature name without assuming CPU/GPU parity.
 
eve::Result< void > restoreObservation (const SimulationObservation &observation) override
 Restores tick/progress metadata after an owner-level restore.
 
void setGravity (float gx, float gy, float gz)
 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 setStiffness (float stiffness)
 Constraint relaxation strength in [0,1] (default 0.85).
 
float getStiffness () const
 Returns the stiffness.
 
void setStretchCompliance (float compliance)
 Set XPBD stretch compliance in m/N; zero preserves legacy PBD.
 
float getStretchCompliance () const
 Return XPBD stretch compliance in m/N.
 
void setShearCompliance (float compliance)
 Set XPBD shear compliance in m/N; zero preserves legacy PBD.
 
float getShearCompliance () const
 Return XPBD shear compliance in m/N.
 
void setBendCompliance (float compliance)
 Set XPBD distance-bend compliance in m/N; zero preserves legacy PBD.
 
float getBendCompliance () const
 Return XPBD distance-bend compliance in m/N.
 
void setTetherScale (float scale)
 Set tether maximum-length scale; zero disables tethers, one uses baked lengths.
 
float getTetherScale () const
 Return the current tether length scale.
 
void setTetherCompliance (float compliance)
 Set XPBD tether compliance in m/N.
 
float getTetherCompliance () const
 Return XPBD tether compliance in m/N.
 
void setPressure (float pressure)
 Set closed-mesh target volume ratio; zero disables volume solving.
 
float getPressure () const
 Return the closed-mesh target volume ratio.
 
void setVolumeCompliance (float compliance)
 Set XPBD closed-volume compliance in m^3/N.
 
float getVolumeCompliance () const
 Return XPBD closed-volume compliance.
 
float getCurrentVolume () const
 Return current signed mesh volume, or zero for an open model.
 
void setIterations (int iterations)
 Constraint solver iterations per substep (default 4).
 
int getIterations () const
 Returns the iterations.
 
void setDamping (float damping)
 Damping applied to Verlet velocity [0,1] (default 0.01).
 
float getDamping () const
 Returns the damping.
 
void setParticleSize (float size)
 Particle radius in meters (default 0.1): self-collision separation, draw scale and rigid-body collision thickness.
 
float getParticleSize () const
 Returns the particle size.
 
void setSelfCollision (bool on)
 Enable proximity-based self-collision between non-adjacent particles and triangles (default true). Triangle-level pass keeps non-adjacent faces at least 2*particleSize apart, so the sheet cannot slip through itself between particles.
 
bool getSelfCollision () const
 Returns the self collision.
 
void setParticleMass (float mass)
 Implicit particle mass in kg (default 0.1). Used for mass-proportional momentum exchange when colliding with dynamic rigid bodies.
 
float getParticleMass () const
 Returns the particle mass.
 
void setFoldStiffness (float k)
 Strength of the dihedral fold clamp [0,1] (default 0.5).
 
float getFoldStiffness () const
 Returns the fold stiffness.
 
void setMaxFoldAngle (float degrees)
 Maximum fold angle between adjacent triangles in degrees Range is 0..180 degrees; default is 120. Zero is fully flat and 180 is folded onto itself; larger values allow stronger draping without creasing.
 
float getMaxFoldAngle () const
 Returns the max fold angle.
 
void setBounds (float x, float y, float z, float w, float h, float d)
 Axis-aligned box (origin + extents, meters); particles bounce inside.
 
void clearBounds ()
 Clears bounds.
 
void setCollisionMaterial (float friction, float restitution)
 Configure cloth contact friction and restitution in [0,1].
 
float getCollisionFriction () const
 Return cloth-side Coulomb friction.
 
float getCollisionRestitution () const
 Return cloth-side restitution.
 
void setCollisionFilter (uint64_t categoryBits, uint64_t maskBits)
 Configure symmetric category/mask filtering for World3D contacts.
 
uint64_t getCollisionCategoryBits () const
 Return cloth collision category bits.
 
uint64_t getCollisionMaskBits () const
 Return cloth collision mask bits.
 
void setTearThreshold (float strain)
 Set automatic structural-edge tear strain; zero disables, values must exceed one.
 
float getTearThreshold () const
 Return the automatic tear strain threshold, or zero when disabled.
 
void setMaxTearsPerStep (int count)
 Limit automatic structural tears per simulation substep.
 
int getMaxTearsPerStep () const
 Return the automatic tear budget per substep.
 
void tearConstraint (int particleA, int particleB)
 Tear an existing structural edge.
 
int getTornConstraintCount () const
 Return the cumulative number of torn structural constraints.
 
void pin (int index)
 
void unpin (int index)
 Unpin.
 
void pinTopRow ()
 Pin top row.
 
bool isPinned (int index) const
 True when pinned.
 
void setParticleInverseMass (int index, float inverseMass)
 Set per-particle inverse mass; zero makes the particle kinematic/pinned.
 
float getParticleInverseMass (int index) const
 Return per-particle inverse mass, or zero for an invalid index.
 
void setSkinConstraint (int index, float x, float y, float z, float nx, float ny, float nz, float radius, float backstopDistance=-1.f, float backstopRadius=0.f, float compliance=0.f)
 Constrain a particle around an animated skin reference and optional backstop sphere.
 
void updateSkinReference (int index, float x, float y, float z, float nx, float ny, float nz)
 Update the animated reference pose of an existing skin constraint.
 
void clearSkinConstraint (int index)
 Remove a particle's skin/backstop constraint.
 
bool hasSkinConstraint (int index) const
 Return whether a particle has a skin/backstop constraint.
 
void attachParticle (int index, float x, float y, float z, float compliance=0.f)
 Attach a particle to a world-space target using an XPBD point constraint.
 
void updateAttachment (int index, float x, float y, float z)
 Move an existing attachment target without recreating it.
 
void detachParticle (int index)
 Detach a particle; its simulated velocity remains continuous.
 
bool isAttached (int index) const
 Return whether a particle currently has an attachment.
 
int grabAt (float x, float y, float z, float radius=0.3f)
 Grab nearest free particle within radius (meters). Returns particle index, or -1 if none.
 
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 fx, float fy, float fz)
 Applies force.
 
void setWindVelocity (float vx, float vy, float vz)
 Set world-space air velocity used by the aerodynamic model (m/s).
 
float getWindVelocityX () const
 Return configured air velocity along X in m/s.
 
float getWindVelocityY () const
 Return configured air velocity along Y in m/s.
 
float getWindVelocityZ () const
 Return configured air velocity along Z in m/s.
 
void setAerodynamics (float airDensity, float dragCoefficient, float liftCoefficient)
 Configure two-sided triangle aerodynamics.
 
float getAirDensity () const
 Return aerodynamic fluid density in kg/m³.
 
float getDragCoefficient () const
 Return the aerodynamic drag coefficient.
 
float getLiftCoefficient () const
 Return the aerodynamic lift coefficient.
 
void interactAt (float x, float y, float z, float radius, float strength)
 Pointer-field interaction like Fluid2D::interactAt (3D): positive strength attracts, negative repels within radius (meters).
 
void setCollideWorld (World3D *world)
 Attach a World3D so free particles collide with its non-sensor shapes in meter space. Passing null detaches it. Dynamic bodies receive a small push.
 
World3D * getCollideWorld () const
 Returns the attached collision world, or null when detached.
 
void reset ()
 Restore the flat grid pose (top row pinned) and clear transient state.
 
void setColor (float r, float g, float b, float a=1.f)
 Sets the color.
 
float getColorR () const
 Returns the color r.
 
float getColorG () const
 Returns the color g.
 
float getColorB () const
 Returns the color b.
 
float getColorA () const
 Returns the color a.
 
void draw (graphics::Graphics *gfx)
 Draw the cloth as a triangle mesh (requires an open 3D frame).
 
int getCols () const
 Returns the cols.
 
int getRows () const
 Returns the rows.
 
int getParticleCount () const
 Returns the particle count.
 
int getTriangleCount () const
 Return the current render/collision triangle count, reduced by tearing.
 
int getDistanceConstraintCount () const
 Return the current distance-constraint count.
 
int getTetherConstraintCount () const
 Return baked geodesic tether count.
 
int getSkinConstraintCount () const
 Return active skin-constraint count.
 
int getAttachmentCount () const
 Return active attachment count.
 
float getParticleX (int index) const
 
float getParticleY (int index) const
 Returns the particle y.
 
float getParticleZ (int index) const
 Returns the particle z.
 
void setParticlePosition (int index, float x, float y, float z)
 Sets the particle position.
 
float getSpacing () const
 Returns the spacing.
 
float getOriginX () const
 Returns the origin x.
 
float getOriginY () const
 Returns the origin y.
 
float getOriginZ () const
 Returns the origin z.
 
void destroy ()
 Destroys .
 
- Public 成员函数 继承自 eve::physics::ISimulationBackend
virtual ~ISimulationBackend ()=default
 Releases the backend; borrowed domain state is not destroyed.
 

详细描述

Interactive 3D cloth — Verlet particles + distance constraints. Meter space, +Y up, grid laid out in the XZ plane with the top row pinned.

Supports self-collision (spatial-hash proximity), a dihedral fold-angle limit between adjacent triangles (avoids excessive creasing), and particle-vs-rigid-body collision when attached to a World3D. Script-owned, independent of the Box3D world.

在文件 Cloth3D.h 第 32 行定义.

构造及析构函数说明

◆ Cloth3D() [1/3]

eve::physics::Cloth3D::Cloth3D ( int  cols,
int  rows,
float  spacing,
float  originX,
float  originY,
float  originZ 
)

Cloth 3 d.

参数
colsgrid columns (>= 2), along +X
rowsgrid rows (>= 2), along +Z
spacingparticle spacing in meters
originXtop-left particle X (meters)
originYtop-left particle Y (meters)
originZtop-left particle Z (meters)

在文件 Cloth3D.cpp 第 216 行定义.

引用了 cols, eve::physics::ClothModel::grid(), model, rows , 以及 spacing.

◆ Cloth3D() [2/3]

eve::physics::Cloth3D::Cloth3D ( const ClothModel &  model)
explicit

Create runtime cloth state by copying a reusable ClothModel.

参数
modelValidated model; the runtime does not retain a reference to it. @ownership Cloth3D owns its copied particle and constraint state. @lifetime The source model only needs to remain alive for this constructor call. @thread Construct and use on the owning physics thread. @reentrancy Invokes no callbacks.

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

引用了 model.

◆ ~Cloth3D()

eve::physics::Cloth3D::~Cloth3D ( )

Cloth 3 d.

在文件 Cloth3D.cpp 第 226 行定义.

引用了 destroy().

◆ Cloth3D() [3/3]

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

成员函数说明

◆ applyForce()

void eve::physics::Cloth3D::applyForce ( float  fx,
float  fy,
float  fz 
)

Applies force.

Uniform wind / force impulse applied this frame (m/s²).

在文件 Cloth3D.cpp 第 546 行定义.

◆ attachParticle()

void eve::physics::Cloth3D::attachParticle ( int  index,
float  x,
float  y,
float  z,
float  compliance = 0.f 
)

Attach a particle to a world-space target using an XPBD point constraint.

在文件 Cloth3DConstraints.cpp 第 101 行定义.

引用了 found, index, value, x, y , 以及 z.

◆ clearBounds()

void eve::physics::Cloth3D::clearBounds ( )

Clears bounds.

在文件 Cloth3D.cpp 第 465 行定义.

被这些函数引用 setBounds().

◆ clearSkinConstraint()

void eve::physics::Cloth3D::clearSkinConstraint ( int  index)

Remove a particle's skin/backstop constraint.

在文件 Cloth3DConstraints.cpp 第 92 行定义.

引用了 index.

◆ destroy()

void eve::physics::Cloth3D::destroy ( )

Destroys .

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

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

◆ detachParticle()

void eve::physics::Cloth3D::detachParticle ( int  index)

Detach a particle; its simulated velocity remains continuous.

在文件 Cloth3DConstraints.cpp 第 121 行定义.

引用了 index.

◆ determinism()

SimulationDeterminism eve::physics::Cloth3D::determinism ( ) const
inlineoverridevirtualnoexcept

CPU cloth uses bounded floating-point determinism.

实现了 eve::physics::ISimulationBackend.

在文件 Cloth3D.h 第 73 行定义.

◆ draw()

void eve::physics::Cloth3D::draw ( graphics::Graphics *  gfx)

Draw the cloth as a triangle mesh (requires an open 3D frame).

在文件 Cloth3D.cpp 第 1267 行定义.

引用了 a, b, c, d, eve::graphics::Graphics::drawMesh(), getParticleCount(), indexCount, indices, eve::graphics::Graphics::newMeshFromArrays(), nx, ny, nz, p, pos, r, side, u, eve::graphics::Graphics::updateMeshVertices(), uv, v , 以及 vertexCount.

◆ getAirDensity()

float eve::physics::Cloth3D::getAirDensity ( ) const

Return aerodynamic fluid density in kg/m³.

在文件 Cloth3D.cpp 第 439 行定义.

◆ getAttachmentCount()

int eve::physics::Cloth3D::getAttachmentCount ( ) const
inline

Return active attachment count.

在文件 Cloth3D.h 第 367 行定义.

◆ getBackendName()

std::string eve::physics::Cloth3D::getBackendName ( ) const
inline

Return stable backend name for scripts and diagnostics.

在文件 Cloth3D.h 第 77 行定义.

◆ getBendCompliance()

float eve::physics::Cloth3D::getBendCompliance ( ) const

Return XPBD distance-bend compliance in m/N.

在文件 Cloth3DConstraints.cpp 第 13 行定义.

◆ getCollideWorld()

World3D * eve::physics::Cloth3D::getCollideWorld ( ) const
inline

Returns the attached collision world, or null when detached.

返回
Borrowed nullable World3D pointer owned by the physics registry. @ownership Cloth3D does not own the world and callers must not delete it. @lifetime Valid until the world is destroyed or detached. @thread Call on the owning physics thread. @reentrancy The accessor invokes no callbacks and is invalid across world mutation.

在文件 Cloth3D.h 第 333 行定义.

◆ getCollisionCategoryBits()

uint64_t eve::physics::Cloth3D::getCollisionCategoryBits ( ) const

Return cloth collision category bits.

在文件 Cloth3DConstraints.cpp 第 20 行定义.

◆ getCollisionFriction()

float eve::physics::Cloth3D::getCollisionFriction ( ) const

Return cloth-side Coulomb friction.

在文件 Cloth3DConstraints.cpp 第 18 行定义.

◆ getCollisionMaskBits()

uint64_t eve::physics::Cloth3D::getCollisionMaskBits ( ) const

Return cloth collision mask bits.

在文件 Cloth3DConstraints.cpp 第 21 行定义.

◆ getCollisionRestitution()

float eve::physics::Cloth3D::getCollisionRestitution ( ) const

Return cloth-side restitution.

在文件 Cloth3DConstraints.cpp 第 19 行定义.

◆ getColorA()

float eve::physics::Cloth3D::getColorA ( ) const
inline

Returns the color a.

在文件 Cloth3D.h 第 347 行定义.

◆ getColorB()

float eve::physics::Cloth3D::getColorB ( ) const
inline

Returns the color b.

在文件 Cloth3D.h 第 345 行定义.

◆ getColorG()

float eve::physics::Cloth3D::getColorG ( ) const
inline

Returns the color g.

在文件 Cloth3D.h 第 343 行定义.

◆ getColorR()

float eve::physics::Cloth3D::getColorR ( ) const
inline

Returns the color r.

在文件 Cloth3D.h 第 341 行定义.

◆ getCols()

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

Returns the cols.

在文件 Cloth3D.h 第 353 行定义.

◆ getCurrentVolume()

float eve::physics::Cloth3D::getCurrentVolume ( ) const

Return current signed mesh volume, or zero for an open model.

在文件 Cloth3DConstraints.cpp 第 142 行定义.

引用了 a, b, c, triangle , 以及 volume.

◆ getDamping()

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

Returns the damping.

在文件 Cloth3D.h 第 139 行定义.

◆ getDistanceConstraintCount()

int eve::physics::Cloth3D::getDistanceConstraintCount ( ) const

Return the current distance-constraint count.

在文件 Cloth3DConstraints.cpp 第 23 行定义.

◆ getDragCoefficient()

float eve::physics::Cloth3D::getDragCoefficient ( ) const

Return the aerodynamic drag coefficient.

在文件 Cloth3D.cpp 第 441 行定义.

◆ getFoldStiffness()

float eve::physics::Cloth3D::getFoldStiffness ( ) const
inline

Returns the fold stiffness.

在文件 Cloth3D.h 第 170 行定义.

◆ getGrabIndex()

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

Returns the grab index.

在文件 Cloth3D.h 第 256 行定义.

◆ getGravityX()

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

Returns the gravity x.

在文件 Cloth3D.h 第 87 行定义.

◆ getGravityY()

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

Returns the gravity y.

在文件 Cloth3D.h 第 89 行定义.

◆ getGravityZ()

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

Returns the gravity z.

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

◆ getIterations()

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

Returns the iterations.

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

◆ getLiftCoefficient()

float eve::physics::Cloth3D::getLiftCoefficient ( ) const

Return the aerodynamic lift coefficient.

在文件 Cloth3D.cpp 第 443 行定义.

◆ getMaxFoldAngle()

float eve::physics::Cloth3D::getMaxFoldAngle ( ) const
inline

Returns the max fold angle.

在文件 Cloth3D.h 第 180 行定义.

◆ getMaxTearsPerStep()

int eve::physics::Cloth3D::getMaxTearsPerStep ( ) const

Return the automatic tear budget per substep.

在文件 Cloth3DTearing.cpp 第 14 行定义.

◆ getOriginX()

float eve::physics::Cloth3D::getOriginX ( ) const
inline

Returns the origin x.

在文件 Cloth3D.h 第 379 行定义.

◆ getOriginY()

float eve::physics::Cloth3D::getOriginY ( ) const
inline

Returns the origin y.

在文件 Cloth3D.h 第 381 行定义.

◆ getOriginZ()

float eve::physics::Cloth3D::getOriginZ ( ) const
inline

Returns the origin z.

在文件 Cloth3D.h 第 383 行定义.

◆ getParticleCount()

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

Returns the particle count.

在文件 Cloth3D.h 第 357 行定义.

被这些函数引用 draw() , 以及 grabAt().

◆ getParticleInverseMass()

float eve::physics::Cloth3D::getParticleInverseMass ( int  index) const

Return per-particle inverse mass, or zero for an invalid index.

在文件 Cloth3D.cpp 第 507 行定义.

引用了 index.

◆ getParticleMass()

float eve::physics::Cloth3D::getParticleMass ( ) const
inline

Returns the particle mass.

在文件 Cloth3D.h 第 165 行定义.

◆ getParticleSize()

float eve::physics::Cloth3D::getParticleSize ( ) const
inline

Returns the particle size.

在文件 Cloth3D.h 第 147 行定义.

◆ getParticleX()

float eve::physics::Cloth3D::getParticleX ( int  index) const

在文件 Cloth3D.cpp 第 569 行定义.

引用了 index , 以及 x.

◆ getParticleY()

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

Returns the particle y.

在文件 Cloth3D.cpp 第 574 行定义.

引用了 index , 以及 y.

◆ getParticleZ()

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

Returns the particle z.

在文件 Cloth3D.cpp 第 579 行定义.

引用了 index , 以及 z.

◆ getPressure()

float eve::physics::Cloth3D::getPressure ( ) const

Return the closed-mesh target volume ratio.

在文件 Cloth3DConstraints.cpp 第 16 行定义.

◆ getRows()

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

Returns the rows.

在文件 Cloth3D.h 第 355 行定义.

◆ getSelfCollision()

bool eve::physics::Cloth3D::getSelfCollision ( ) const
inline

Returns the self collision.

在文件 Cloth3D.h 第 157 行定义.

◆ getShearCompliance()

float eve::physics::Cloth3D::getShearCompliance ( ) const

Return XPBD shear compliance in m/N.

在文件 Cloth3DConstraints.cpp 第 12 行定义.

◆ getSkinConstraintCount()

int eve::physics::Cloth3D::getSkinConstraintCount ( ) const

Return active skin-constraint count.

在文件 Cloth3DConstraints.cpp 第 25 行定义.

◆ getSpacing()

float eve::physics::Cloth3D::getSpacing ( ) const
inline

Returns the spacing.

在文件 Cloth3D.h 第 377 行定义.

◆ getStiffness()

float eve::physics::Cloth3D::getStiffness ( ) const
inline

Returns the stiffness.

在文件 Cloth3D.h 第 96 行定义.

◆ getStretchCompliance()

float eve::physics::Cloth3D::getStretchCompliance ( ) const

Return XPBD stretch compliance in m/N.

在文件 Cloth3DConstraints.cpp 第 11 行定义.

◆ getTearThreshold()

float eve::physics::Cloth3D::getTearThreshold ( ) const

Return the automatic tear strain threshold, or zero when disabled.

在文件 Cloth3DTearing.cpp 第 13 行定义.

◆ getTetherCompliance()

float eve::physics::Cloth3D::getTetherCompliance ( ) const

Return XPBD tether compliance in m/N.

在文件 Cloth3DConstraints.cpp 第 15 行定义.

◆ getTetherConstraintCount()

int eve::physics::Cloth3D::getTetherConstraintCount ( ) const

Return baked geodesic tether count.

在文件 Cloth3DConstraints.cpp 第 24 行定义.

◆ getTetherScale()

float eve::physics::Cloth3D::getTetherScale ( ) const

Return the current tether length scale.

在文件 Cloth3DConstraints.cpp 第 14 行定义.

◆ getTornConstraintCount()

int eve::physics::Cloth3D::getTornConstraintCount ( ) const

Return the cumulative number of torn structural constraints.

在文件 Cloth3DTearing.cpp 第 15 行定义.

◆ getTriangleCount()

int eve::physics::Cloth3D::getTriangleCount ( ) const

Return the current render/collision triangle count, reduced by tearing.

在文件 Cloth3DConstraints.cpp 第 22 行定义.

◆ getVolumeCompliance()

float eve::physics::Cloth3D::getVolumeCompliance ( ) const

Return XPBD closed-volume compliance.

在文件 Cloth3DConstraints.cpp 第 17 行定义.

◆ getWindVelocityX()

float eve::physics::Cloth3D::getWindVelocityX ( ) const

Return configured air velocity along X in m/s.

在文件 Cloth3D.cpp 第 427 行定义.

◆ getWindVelocityY()

float eve::physics::Cloth3D::getWindVelocityY ( ) const

Return configured air velocity along Y in m/s.

在文件 Cloth3D.cpp 第 429 行定义.

◆ getWindVelocityZ()

float eve::physics::Cloth3D::getWindVelocityZ ( ) const

Return configured air velocity along Z in m/s.

在文件 Cloth3D.cpp 第 431 行定义.

◆ grabAt()

int eve::physics::Cloth3D::grabAt ( float  x,
float  y,
float  z,
float  radius = 0.3f 
)

Grab nearest free particle within radius (meters). Returns particle index, or -1 if none.

在文件 Cloth3D.cpp 第 511 行定义.

引用了 best, dx, dy, dz, getParticleCount(), moveGrab(), p, radius, x, y , 以及 z.

◆ hasSkinConstraint()

bool eve::physics::Cloth3D::hasSkinConstraint ( int  index) const

Return whether a particle has a skin/backstop constraint.

在文件 Cloth3DConstraints.cpp 第 96 行定义.

引用了 index.

◆ interactAt()

void eve::physics::Cloth3D::interactAt ( float  x,
float  y,
float  z,
float  radius,
float  strength 
)

Pointer-field interaction like Fluid2D::interactAt (3D): positive strength attracts, negative repels within radius (meters).

在文件 Cloth3D.cpp 第 552 行定义.

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

◆ isAttached()

bool eve::physics::Cloth3D::isAttached ( int  index) const

Return whether a particle currently has an attachment.

在文件 Cloth3DConstraints.cpp 第 125 行定义.

引用了 index.

◆ isGrabbing()

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

True when grabbing.

在文件 Cloth3D.h 第 254 行定义.

◆ isPinned()

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

True when pinned.

在文件 Cloth3D.cpp 第 495 行定义.

引用了 index , 以及 pinned.

◆ kind()

SimulationBackendKind eve::physics::Cloth3D::kind ( ) const
inlineoverridevirtualnoexcept

Identifies this production CPU cloth backend.

实现了 eve::physics::ISimulationBackend.

在文件 Cloth3D.h 第 71 行定义.

◆ moveGrab()

void eve::physics::Cloth3D::moveGrab ( float  x,
float  y,
float  z 
)

Moves grab.

在文件 Cloth3D.cpp 第 530 行定义.

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

被这些函数引用 grabAt().

◆ observation()

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

Returns completed tick/time observables.

实现了 eve::physics::ISimulationBackend.

在文件 Cloth3D.h 第 69 行定义.

被这些函数引用 restoreObservation().

◆ operator=()

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

◆ pin()

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

在文件 Cloth3D.cpp 第 477 行定义.

引用了 index.

被这些函数引用 pinTopRow().

◆ pinTopRow()

void eve::physics::Cloth3D::pinTopRow ( )

Pin top row.

在文件 Cloth3D.cpp 第 491 行定义.

引用了 c , 以及 pin().

◆ releaseGrab()

void eve::physics::Cloth3D::releaseGrab ( )

Release grab.

在文件 Cloth3D.cpp 第 544 行定义.

◆ reset()

void eve::physics::Cloth3D::reset ( )

Restore the flat grid pose (top row pinned) and clear transient state.

在文件 Cloth3D.cpp 第 230 行定义.

◆ restoreObservation()

eve::Result< void > eve::physics::Cloth3D::restoreObservation ( const SimulationObservation &  observation)
overridevirtual

◆ setAerodynamics()

void eve::physics::Cloth3D::setAerodynamics ( float  airDensity,
float  dragCoefficient,
float  liftCoefficient 
)

Configure two-sided triangle aerodynamics.

Forces use each deformed triangle's current area and normal, relative air velocity, and the configured particle mass. Setting both coefficients to zero disables aerodynamics without changing the wind velocity.

参数
airDensityNon-negative fluid density in kg/m³ (air is about 1.225).
dragCoefficientNon-negative pressure-drag coefficient.
liftCoefficientNon-negative lift coefficient. @thread Call on the owning physics thread between simulation steps. @reentrancy Invokes no callbacks.

在文件 Cloth3D.cpp 第 433 行定义.

◆ setBendCompliance()

void eve::physics::Cloth3D::setBendCompliance ( float  compliance)

Set XPBD distance-bend compliance in m/N; zero preserves legacy PBD.

在文件 Cloth3D.cpp 第 365 行定义.

◆ setBounds()

void eve::physics::Cloth3D::setBounds ( float  x,
float  y,
float  z,
float  w,
float  h,
float  d 
)

Axis-aligned box (origin + extents, meters); particles bounce inside.

在文件 Cloth3D.cpp 第 451 行定义.

引用了 clearBounds(), d, h, w, x, y , 以及 z.

◆ setCollideWorld()

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

Attach a World3D so free particles collide with its non-sensor shapes in meter space. Passing null detaches it. Dynamic bodies receive a small push.

Attach a borrowed 3D world for collision queries; null detaches it. @ownership Cloth3D never owns the World3D pointer; the physics registry owns it. @lifetime The association is valid only while the world remains alive; clear it before world destruction. @thread Call on the owning physics thread. @reentrancy Does not invoke callbacks; do not destroy the world re-entrantly.

在文件 Cloth3D.cpp 第 560 行定义.

引用了 world.

◆ setCollisionFilter()

void eve::physics::Cloth3D::setCollisionFilter ( uint64_t  categoryBits,
uint64_t  maskBits 
)

Configure symmetric category/mask filtering for World3D contacts.

在文件 Cloth3D.cpp 第 472 行定义.

◆ setCollisionMaterial()

void eve::physics::Cloth3D::setCollisionMaterial ( float  friction,
float  restitution 
)

Configure cloth contact friction and restitution in [0,1].

在文件 Cloth3D.cpp 第 467 行定义.

引用了 restitution.

◆ setColor()

void eve::physics::Cloth3D::setColor ( float  r,
float  g,
float  b,
float  a = 1.f 
)

Sets the color.

在文件 Cloth3D.cpp 第 562 行定义.

引用了 a, b, g , 以及 r.

◆ setDamping()

void eve::physics::Cloth3D::setDamping ( float  damping)

Damping applied to Verlet velocity [0,1] (default 0.01).

在文件 Cloth3D.cpp 第 371 行定义.

◆ setFoldStiffness()

void eve::physics::Cloth3D::setFoldStiffness ( float  k)

Strength of the dihedral fold clamp [0,1] (default 0.5).

在文件 Cloth3D.cpp 第 447 行定义.

◆ setGravity()

void eve::physics::Cloth3D::setGravity ( float  gx,
float  gy,
float  gz 
)

Sets the gravity.

在文件 Cloth3D.cpp 第 349 行定义.

◆ setIterations()

void eve::physics::Cloth3D::setIterations ( int  iterations)

Constraint solver iterations per substep (default 4).

在文件 Cloth3D.cpp 第 369 行定义.

引用了 iterations.

◆ setMaxFoldAngle()

void eve::physics::Cloth3D::setMaxFoldAngle ( float  degrees)

Maximum fold angle between adjacent triangles in degrees Range is 0..180 degrees; default is 120. Zero is fully flat and 180 is folded onto itself; larger values allow stronger draping without creasing.

在文件 Cloth3D.cpp 第 449 行定义.

引用了 degrees.

◆ setMaxTearsPerStep()

void eve::physics::Cloth3D::setMaxTearsPerStep ( int  count)

Limit automatic structural tears per simulation substep.

在文件 Cloth3DTearing.cpp 第 21 行定义.

引用了 count.

◆ setParticleInverseMass()

void eve::physics::Cloth3D::setParticleInverseMass ( int  index,
float  inverseMass 
)

Set per-particle inverse mass; zero makes the particle kinematic/pinned.

在文件 Cloth3D.cpp 第 500 行定义.

引用了 index.

◆ setParticleMass()

void eve::physics::Cloth3D::setParticleMass ( float  mass)

Implicit particle mass in kg (default 0.1). Used for mass-proportional momentum exchange when colliding with dynamic rigid bodies.

在文件 Cloth3D.cpp 第 375 行定义.

◆ setParticlePosition()

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

Sets the particle position.

在文件 Cloth3D.cpp 第 584 行定义.

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

◆ setParticleSize()

void eve::physics::Cloth3D::setParticleSize ( float  size)

Particle radius in meters (default 0.1): self-collision separation, draw scale and rigid-body collision thickness.

在文件 Cloth3D.cpp 第 373 行定义.

引用了 size.

◆ setPressure()

void eve::physics::Cloth3D::setPressure ( float  pressure)

Set closed-mesh target volume ratio; zero disables volume solving.

在文件 Cloth3DConstraints.cpp 第 136 行定义.

◆ setSelfCollision()

void eve::physics::Cloth3D::setSelfCollision ( bool  on)

Enable proximity-based self-collision between non-adjacent particles and triangles (default true). Triangle-level pass keeps non-adjacent faces at least 2*particleSize apart, so the sheet cannot slip through itself between particles.

在文件 Cloth3D.cpp 第 445 行定义.

◆ setShearCompliance()

void eve::physics::Cloth3D::setShearCompliance ( float  compliance)

Set XPBD shear compliance in m/N; zero preserves legacy PBD.

在文件 Cloth3D.cpp 第 361 行定义.

◆ setSkinConstraint()

void eve::physics::Cloth3D::setSkinConstraint ( int  index,
float  x,
float  y,
float  z,
float  nx,
float  ny,
float  nz,
float  radius,
float  backstopDistance = -1.f,
float  backstopRadius = 0.f,
float  compliance = 0.f 
)

Constrain a particle around an animated skin reference and optional backstop sphere.

在文件 Cloth3DConstraints.cpp 第 51 行定义.

引用了 found, index, nx, ny, nz, radius, value, x, y , 以及 z.

◆ setStiffness()

void eve::physics::Cloth3D::setStiffness ( float  stiffness)

Constraint relaxation strength in [0,1] (default 0.85).

在文件 Cloth3D.cpp 第 355 行定义.

◆ setStretchCompliance()

void eve::physics::Cloth3D::setStretchCompliance ( float  compliance)

Set XPBD stretch compliance in m/N; zero preserves legacy PBD.

在文件 Cloth3D.cpp 第 357 行定义.

◆ setTearThreshold()

void eve::physics::Cloth3D::setTearThreshold ( float  strain)

Set automatic structural-edge tear strain; zero disables, values must exceed one.

在文件 Cloth3DTearing.cpp 第 17 行定义.

◆ setTetherCompliance()

void eve::physics::Cloth3D::setTetherCompliance ( float  compliance)

Set XPBD tether compliance in m/N.

在文件 Cloth3DConstraints.cpp 第 132 行定义.

◆ setTetherScale()

void eve::physics::Cloth3D::setTetherScale ( float  scale)

Set tether maximum-length scale; zero disables tethers, one uses baked lengths.

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

引用了 scale.

◆ setVolumeCompliance()

void eve::physics::Cloth3D::setVolumeCompliance ( float  compliance)

Set XPBD closed-volume compliance in m^3/N.

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

◆ setWindVelocity()

void eve::physics::Cloth3D::setWindVelocity ( float  vx,
float  vy,
float  vz 
)

Set world-space air velocity used by the aerodynamic model (m/s).

参数
vxAir velocity along X.
vyAir velocity along Y.
vzAir velocity along Z. @thread Call on the owning physics thread between simulation steps. @reentrancy Invokes no callbacks.

在文件 Cloth3D.cpp 第 421 行定义.

引用了 vx, vy , 以及 vz.

◆ step()

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

◆ supportsFeature()

bool eve::physics::Cloth3D::supportsFeature ( const std::string &  feature) const

Query a stable cloth feature name without assuming CPU/GPU parity.

在文件 Cloth3DConstraints.cpp 第 44 行定义.

◆ tearConstraint()

void eve::physics::Cloth3D::tearConstraint ( int  particleA,
int  particleB 
)

Tear an existing structural edge.

异常
eve::Exceptionif the edge cannot tear.

在文件 Cloth3DTearing.cpp 第 23 行定义.

引用了 found.

◆ unpin()

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

Unpin.

在文件 Cloth3D.cpp 第 484 行定义.

引用了 index.

◆ update()

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

Updates .

在文件 Cloth3D.cpp 第 1201 行定义.

◆ updateAttachment()

void eve::physics::Cloth3D::updateAttachment ( int  index,
float  x,
float  y,
float  z 
)

Move an existing attachment target without recreating it.

在文件 Cloth3DConstraints.cpp 第 112 行定义.

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

◆ updateSkinReference()

void eve::physics::Cloth3D::updateSkinReference ( int  index,
float  x,
float  y,
float  z,
float  nx,
float  ny,
float  nz 
)

Update the animated reference pose of an existing skin constraint.

在文件 Cloth3DConstraints.cpp 第 77 行定义.

引用了 found, index, nx, ny, nz, x, y , 以及 z.


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