Rapier C — 3D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
Soft bodies

Particle recipes, materials, clusters, deformable meshes, and tearing. More...

Data Structures

struct  R3SoftBodyMaterial
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R3SoftRecoverySettings
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R3SoftFemParameters
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R3SoftBodiesSettings
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R3SoftEdgeSoftness
 Spring-coefficient override for one soft-body edge. More...
struct  R3SoftEdgeSoftnessView
 Borrowed elements; count counts elements. More...
struct  R3SoftEdgeTear
 Tear-resistance override for one soft-body edge. More...
struct  R3SoftEdgeTearView
 Borrowed elements; count counts elements. More...
struct  R3SoftBodyDescView
 Borrowed array of soft-body descriptions. More...
struct  R3SoftBodyDesc
 Copyable recipe, not an owned procedural builder. More...
struct  R3SoftBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R3SoftMeshBindingDesc
 Non-owning deformable binding description. More...
struct  R3SoftClusterSplit
 Cluster and proxy remapping after a soft-body split. More...
struct  R3SoftJointMove
 Impulse-joint movement between rigid proxies after tearing. More...
struct  R3SoftMeshId
 Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId. More...
struct  R3SoftMeshInfo
 Mesh identity and rendering metadata. More...

Macros

#define R3_SOFT_DESC_PARTICLES   0
 Soft-body selector: desc particles.
#define R3_SOFT_DESC_ROPE   1
 Soft-body selector: desc rope.
#define R3_SOFT_DESC_GRID   2
 Soft-body selector: desc grid.
#define R3_SOFT_DESC_CLOTH   3
 Soft-body selector: desc cloth.
#define R3_SOFT_DESC_CUBOID   4
 Soft-body selector: desc cuboid.
#define R3_SOFT_DESC_SURFACE   5
 Soft-body selector: desc surface.
#define R3_SOFT_DESC_DISK   6
 Soft-body selector: desc disk.
#define R3_SOFT_DESC_SPHERE   7
 Soft-body selector: desc sphere.
#define R3_SOFT_DESC_CLOTH_TUBE   8
 Soft-body selector: desc cloth tube.
#define R3_SOFT_DESC_VOLUMETRIC   9
 Soft-body selector: desc volumetric.
#define R3_SOFT_DESC_CLOTH_ANISOTROPIC   12
 Soft-body selector: cloth with separate warp, weft and shear softness (3D).
#define R3_SOFT_BINDING_SKINNED   0
 Soft-body selector: binding skinned.
#define R3_SOFT_BINDING_DIRECT   1
 Soft-body selector: binding direct.
#define R3_SOFT_BINDING_DIRECT_BY_POSITION   2
 Soft-body selector: binding direct by position.
#define R3_SOFT_CELL_VOLUME   0
 Cell model that constrains volume without elastic shear response.
#define R3_SOFT_CELL_COROTATIONAL   1
 Corotational elastic cell model.
#define R3_SOFT_CELL_NEO_HOOKEAN   2
 Neo-Hookean elastic cell model.
#define R3_SOFT_SOLVER_CONSTRAINTS   0
 Use the constraint-based soft-body solver.
#define R3_SOFT_SOLVER_FEM   1
 Use the finite-element solver; requires RAPIER_FEM.
#define R3_SOFT_EDGE_PLASTIC_FLOW_BOTH   0
 Edge plastic flow (R3SoftBodyMaterial::edgePlasticFlow): both a squeeze and a stretch set.
#define R3_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION   1
 Edge plastic flow: only a squeeze sets; a stretched edge springs back.
#define R3_SOFT_EDGE_PLASTIC_FLOW_TENSION   2
 Edge plastic flow: only a stretch sets; a squeezed edge springs back.
#define R3_SOFT_PATCH_CONSTRAINTS_KEEP   0
 Overlap patch constraints (R3SoftRecoverySettings::overlapPatchConstraints): keep them.
#define R3_SOFT_PATCH_CONSTRAINTS_STAND_DOWN   1
 Overlap patch constraints: stand them down inside the patch.
#define R3_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL   2
 Overlap patch constraints: align them with the overlap normal.
#define R3_SOFT_FRAME   4
 Read-only body type of soft-body cluster proxies; cannot be used to construct a rigid body.

Typedefs

typedef struct R3SoftBodyMaterial R3SoftBodyMaterial
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R3SoftRecoverySettings R3SoftRecoverySettings
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R3SoftFemParameters R3SoftFemParameters
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R3SoftBodiesSettings R3SoftBodiesSettings
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R3SoftEdgeSoftness R3SoftEdgeSoftness
 Spring-coefficient override for one soft-body edge.
typedef struct R3SoftEdgeSoftnessView R3SoftEdgeSoftnessView
 Borrowed elements; count counts elements.
typedef struct R3SoftEdgeTear R3SoftEdgeTear
 Tear-resistance override for one soft-body edge.
typedef struct R3SoftEdgeTearView R3SoftEdgeTearView
 Borrowed elements; count counts elements.
typedef struct R3SoftBodyDescView R3SoftBodyDescView
 Borrowed array of soft-body descriptions.
typedef struct R3SoftBodyDesc R3SoftBodyDesc
 Copyable recipe, not an owned procedural builder.
typedef struct R3SoftBodyHandle R3SoftBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R3SoftMeshBindingDesc R3SoftMeshBindingDesc
 Non-owning deformable binding description.
typedef struct R3SoftClusterSplit R3SoftClusterSplit
 Cluster and proxy remapping after a soft-body split.
typedef struct R3SoftJointMove R3SoftJointMove
 Impulse-joint movement between rigid proxies after tearing.
typedef struct R3SoftMeshId R3SoftMeshId
 Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId.
typedef struct R3SoftMeshInfo R3SoftMeshInfo
 Mesh identity and rendering metadata.

Functions

struct R3SoftBodyMaterial r3DefaultSoftBodyMaterial (void)
 Return native default soft body material.
struct R3SoftRecoverySettings r3DefaultSoftRecoverySettings (void)
 Return native default soft recovery settings.
struct R3SoftFemParameters r3DefaultSoftFemParameters (void)
 Return native default soft fem parameters.
struct R3SoftBodiesSettings r3DefaultSoftBodiesSettings (void)
 Return native default soft bodies settings.
struct R3SoftBodyDesc r3DefaultSoftBodyDesc (void)
 Return native default soft body desc.
struct R3SoftBodyHandle r3InsertSoftBody (struct R3World *world, const struct R3SoftBodyDesc *desc)
 Consumes no caller-owned resources.
struct R3SoftMeshBindingDesc r3DefaultSoftMeshBindingDesc (void)
 Return native default soft mesh binding desc.
size_t r3SoftBodyCount (const struct R3World *world)
 Return the number of soft body objects in the world.
size_t r3SoftBodyHandles (const struct R3World *world, struct R3SoftBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R3Bool r3SoftBody_Contains (struct R3SoftBodyHandle handle)
 Test whether the live world contains this soft body handle.
R3Status r3SoftBodiesSetResweepStrain (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftBodiesSettings::resweepStrain.
R3Real r3SoftBodiesResweepStrain (const struct R3World *world)
 Return the world setting documented by R3SoftBodiesSettings::resweepStrain.
R3Status r3SoftBodiesSetContactStiffening (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftBodiesSettings::contactStiffening.
R3Real r3SoftBodiesContactStiffening (const struct R3World *world)
 Return the world setting documented by R3SoftBodiesSettings::contactStiffening.
R3Status r3SoftBodiesSetMaxExtraSubsteps (struct R3World *world, size_t value)
 Set the world setting documented by R3SoftBodiesSettings::maxExtraSubsteps.
size_t r3SoftBodiesMaxExtraSubsteps (const struct R3World *world)
 Return the world setting documented by R3SoftBodiesSettings::maxExtraSubsteps.
R3Status r3RecoverySetAuthoredVelocityMargin (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::authoredVelocityMargin.
R3Status r3RecoverySetEdgeSpeculation (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::edgeSpeculation.
R3Status r3RecoverySetInvertedCellDetection (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::invertedCellDetection.
R3Status r3RecoverySetSelfCrossingDetection (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::selfCrossingDetection.
R3Status r3RecoverySetDetectionMotionGating (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::detectionMotionGating.
R3Status r3RecoverySetCrossBodyDetection (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::crossBodyDetection.
R3Status r3RecoverySetSelfStandDown (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::selfStandDown.
R3Status r3RecoverySetCrossBodyExpelGate (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::crossBodyExpelGate.
R3Status r3RecoverySetEdgeStandDown (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::edgeStandDown.
R3Status r3RecoverySetCrossingRepulsion (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::crossingRepulsion.
R3Status r3RecoverySetCrossingRepulsionGuide (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::crossingRepulsionGuide.
R3Status r3RecoverySetCrossingRepulsionSelfGuide (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::crossingRepulsionSelfGuide.
R3Status r3RecoverySetRecoveryPace (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftRecoverySettings::recoveryPace.
R3Status r3RecoverySetOverlapConstraints (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapConstraints.
R3Status r3RecoverySetOverlapRigid (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapRigid.
R3Status r3RecoverySetOverlapSkipSelfTangled (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapSkipSelfTangled.
R3Status r3RecoverySetOverlapEdgeStandDown (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapEdgeStandDown.
R3Status r3RecoverySetOverlapConstraintPace (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftRecoverySettings::overlapConstraintPace.
R3Status r3RecoverySetOverlapSkinVolume (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapSkinVolume.
R3Status r3RecoverySetOverlapKeptDepth (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftRecoverySettings::overlapKeptDepth.
R3Status r3RecoverySetOverlapSelfRegions (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapSelfRegions.
R3Status r3RecoverySetOverlapNormalPush (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapNormalPush.
R3Status r3RecoverySetOverlapMultiVolume (struct R3World *world, R3Bool value)
 Set the world setting documented by R3SoftRecoverySettings::overlapMultiVolume.
R3Status r3RecoverySetOverlapProgressMargin (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftRecoverySettings::overlapProgressMargin.
R3Status r3FemSetLinearTolerance (struct R3World *world, R3Real value)
 Set the world setting documented by R3SoftFemParameters::linearTolerance.
R3Status r3FemSetMaxLinearIterations (struct R3World *world, size_t value)
 Set the world setting documented by R3SoftFemParameters::maxLinearIterations.
R3Status r3FemSetMaxDenseDofs (struct R3World *world, size_t value)
 Set the world setting documented by R3SoftFemParameters::maxDenseDofs.
R3Status r3RemoveSoftBody (struct R3SoftBodyHandle handle)
 Remove a soft body and its associated simulation objects.
R3Status r3SoftBody_WakeUp (struct R3SoftBodyHandle handle)
 Wake the soft body and its rigid proxies.
R3Status r3FreeSoftBodyTearEvent (struct R3SoftBodyTearEvent *event)
 Release an owned soft body tear event.
struct R3SoftBodyHandle r3SoftBodyTearEvent_SoftBody (const struct R3SoftBodyTearEvent *event)
 Return the source soft-body handle for this tear event.
size_t r3SoftBodyTearEvent_Bodies (const struct R3SoftBodyTearEvent *event, struct R3SoftBodyHandle *buffer, size_t capacity)
 Copy the soft bodies the torn body is in after the tear, the one keeping the handle first: the torn body alone when nothing was split off.
struct R3ParticleDestination r3SoftBodyTearEvent_ParticleDestination (const struct R3SoftBodyTearEvent *event, uint32_t particle)
 Return the destination body and particle index for an original particle.
size_t r3SoftBodyTearEvent_TornEdges (const struct R3SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r3SoftBodyTearEvent_TornCells (const struct R3SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r3SoftBodyTearEvent_RemovedEdges (const struct R3SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r3SoftBodyTearEvent_SplitParticles (const struct R3SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r3SoftBodyTearEvent_InsertedParticles (const struct R3SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r3SoftBodyTearEvent_PieceParticles (const struct R3SoftBodyTearEvent *event, size_t piece_index, uint32_t *buffer, size_t capacity)
 Copy the particles of the piece_index-th body of r3SoftBodyTearEvent_Bodies, as indices in the torn body after the tear (the indices the other event fields use); entry i is the piece's particle i.
size_t r3SoftBodyTearEvent_Clusters (const struct R3SoftBodyTearEvent *event, struct R3SoftClusterSplit *buffer, size_t capacity)
 Copy cluster-to-piece and rigid-proxy remapping records.
size_t r3SoftBodyTearEvent_MovedJoints (const struct R3SoftBodyTearEvent *event, struct R3SoftJointMove *buffer, size_t capacity)
 Copy impulse-joint remapping records produced by the tear.
struct R3SoftBodyTearEvent * r3SoftBody_Tear (struct R3SoftBodyHandle handle, const uint32_t *edges, size_t edge_count, const uint32_t *cells, size_t cell_count)
 Tear the selected edges and return an owned remapping event.
uint32_t r3SoftBody_AddCluster (struct R3SoftBodyHandle handle, const uint32_t *particles, size_t count)
 Create a rigid proxy cluster from the supplied particle indices and return its cluster index.
R3Status r3SoftBody_RemoveCluster (struct R3SoftBodyHandle handle, uint32_t cluster)
 Remove the selected cluster and its rigid proxy.
struct R3OptionalParticleDestination r3SoftBodyTearEvent_TryParticleDestination (const struct R3SoftBodyTearEvent *event, uint32_t particle)
 Optional particle destination after a tear.
struct R3SoftBodyTearEvent * r3CutSoftBody (struct R3SoftBodyHandle handle, const struct R3Vector *blade)
 Cut using DIM points (a segment in 2D, triangle in 3D).
struct R3Vector r3SoftBody_ParticlePosition (struct R3SoftBodyHandle handle, size_t index)
 Return the world-space position of the indexed particle.
size_t r3SoftBody_ParticlePositions (struct R3SoftBodyHandle handle, struct R3Vector *buffer, size_t capacity)
 Copy world-space particle positions.
struct R3SoftBodyMaterial r3SoftBody_Material (struct R3SoftBodyHandle handle)
 Return a copy of the soft body material parameters.
R3Status r3SoftBody_SetParticlePosition (struct R3SoftBodyHandle handle, size_t index, struct R3Vector value)
 Set the world-space position of the indexed particle.
R3Status r3SoftBody_SetMaterial (struct R3SoftBodyHandle handle, const struct R3SoftBodyMaterial *data)
 Copy material parameters into the soft body.
R3Status r3SoftBody_AddParticleForce (struct R3SoftBodyHandle handle, size_t index, struct R3Vector value, R3Bool wake_up)
 Add a world-space force to the indexed particle.
R3Status r3SoftBodyDesc_SetParticles (struct R3SoftBodyDesc *desc, struct R3VectorView positions)
 Select an explicit particle recipe and borrow its positions.
R3Status r3SoftBodyDesc_SetSurfaceMesh (struct R3SoftBodyDesc *desc, struct R3VectorView vertices, R3SurfaceElementView elements)
 Select a surface recipe and borrow its vertices and elements.
R3Status r3SoftBodyDesc_SetAppended (struct R3SoftBodyDesc *desc, struct R3SoftBodyDescView view)
 Borrow descriptions to merge into this body (see R3SoftBodyDesc::appended); preserve all other fields.
R3Status r3SoftBodyDesc_SetAddedEdges (struct R3SoftBodyDesc *desc, struct R3EdgeView view)
 Borrow structural edges added after appending (see R3SoftBodyDesc::addedEdges); preserve all other fields.
R3Status r3SoftBodyDesc_SetSkin (struct R3SoftBodyDesc *desc, struct R3VectorView vertices, R3SurfaceElementView elements)
 Borrow skin geometry.
R3Status r3SoftBodyDesc_SetMasses (struct R3SoftBodyDesc *desc, struct R3RealView view)
 Borrow masses; preserve all other fields.
R3Status r3SoftBodyDesc_SetPinnedParticles (struct R3SoftBodyDesc *desc, struct R3IndexView view)
 Borrow pinned particles; preserve all other fields.
R3Status r3SoftBodyDesc_SetEdges (struct R3SoftBodyDesc *desc, struct R3EdgeView view)
 Borrow edges; preserve all other fields.
R3Status r3SoftBodyDesc_SetBendEdges (struct R3SoftBodyDesc *desc, struct R3EdgeView view)
 Borrow bend edges; preserve all other fields.
R3Status r3SoftBodyDesc_SetCells (struct R3SoftBodyDesc *desc, R3CellView view)
 Borrow cells; preserve all other fields.
R3Status r3SoftBodyDesc_SetSurface (struct R3SoftBodyDesc *desc, R3SurfaceElementView view)
 Borrow surface; preserve all other fields.
R3Status r3SoftBodyDesc_SetTensionOnlyEdges (struct R3SoftBodyDesc *desc, struct R3IndexView view)
 Borrow tension only edges; preserve all other fields.
R3Status r3SoftBodyDesc_SetDihedrals (struct R3SoftBodyDesc *desc, struct R3DihedralView view)
 Borrow dihedrals; preserve all other fields.
R3Status r3SoftBodyDesc_SetWire (struct R3SoftBodyDesc *desc, struct R3EdgeView view)
 Borrow wire; preserve all other fields.
struct R3SoftBodyDesc r3RopeSoftBodyDesc (struct R3Vector a, struct R3Vector b, size_t particles)
 Return a rope recipe with particles evenly spaced from a to b, including both endpoints.
struct R3SoftBodyDesc r3CuboidSoftBodyDesc (struct R3Vector center, struct R3Vector half_extents, size_t nx, size_t ny, size_t nz)
 Return a solid box recipe on an nx by ny by nz particle grid, subdivided into tetrahedra.
struct R3SoftBodyDesc r3ClothSoftBodyDesc (struct R3Vector origin, struct R3Vector du, struct R3Vector dv, size_t nu, size_t nv)
 Return a cloth recipe with nu by nv particles at origin + i * du + j * dv.
struct R3SoftBodyDesc r3ClothAnisotropicSoftBodyDesc (struct R3Vector origin, struct R3Vector du, struct R3Vector dv, size_t nu, size_t nv, struct R3SpringCoefficients warp, struct R3SpringCoefficients weft, struct R3SpringCoefficients shear)
 Return a cloth recipe like r3ClothSoftBodyDesc whose edges along du (warp), along dv (weft) and diagonal (shear) get their own softness; the material's bendSoftness still applies to the bending edges.
struct R3SoftBodyDesc r3SphereSoftBodyDesc (struct R3Vector center, R3Real radius, uint32_t subdivisions)
 Return a hollow icosphere recipe with the specified refinement levels and volume preservation.
struct R3SoftBodyDesc r3ClothTubeSoftBodyDesc (struct R3Vector origin, struct R3Vector axis, R3Real radius_start, R3Real radius_end, size_t num_around, size_t num_along)
 Return a cloth tube recipe from origin to origin + axis with num_along rings of num_around particles; radius varies linearly between the ends.
struct R3SoftBodyDesc r3VolumetricSoftBodyDesc (struct R3VectorView vertices, R3SurfaceElementView surface, struct R3VolumeMeshParameters parameters)
 Initializes a borrowed meshing recipe.
struct R3SoftBodyMaterial r3UniformSoftBodyMaterial (struct R3SpringCoefficients value)
 Returns a material with the same softness for each constraint family.
size_t r3SoftBodyDesc_ParticlePositions (const struct R3SoftBodyDesc *desc, struct R3Vector *buffer, size_t capacity)
 Copies generated particle positions into caller-owned storage; no persistent builder.
size_t r3SoftBodyDesc_CellIndices (const struct R3SoftBodyDesc *desc, uint32_t *buffer, size_t capacity)
 Copies generated cell indices into caller-owned storage.
struct R3Vector r3SoftBody_ParticleVelocity (struct R3SoftBodyHandle handle, size_t index)
 Return the world-space velocity of the indexed particle.
uint32_t r3SoftBody_Solver (struct R3SoftBodyHandle handle)
 Return the solver simulating the soft body's elasticity (R3_SOFT_SOLVER_*).
R3Status r3SoftBody_SetClusterEdgeSoftness (struct R3SoftBodyHandle handle, uint32_t cluster, const struct R3SpringCoefficients *softness)
 Override the softness of every structural or bending edge fully contained in a live cluster: regional stiffness for cloth and ropes.
R3Status r3SoftBody_ApplyImpulseAtPoint (struct R3SoftBodyHandle handle, struct R3Vector impulse, struct R3Vector point, R3Real falloff_radius, R3Bool wake_up)
 Apply a world-space impulse to every free particle within falloff_radius of the world-space point, scaled linearly from 1 at the point to 0 at that radius and divided by the particle's mass.
R3Status r3SoftBody_ApplyRadialImpulse (struct R3SoftBodyHandle handle, struct R3Vector center, R3Real magnitude, R3Real falloff_radius, R3Bool wake_up)
 Apply an impulse of the given magnitude pointing away from the world-space center to every free particle within falloff_radius, scaled linearly from 1 at the center to 0 at that radius and divided by the particle's mass.
R3Status r3SoftBody_ResetPlasticity (struct R3SoftBodyHandle handle)
 Undo every permanent (plastic) deformation: edge rest lengths, dihedral rest angles, cell rest shapes and particle rest positions return to their creation state.
R3Status r3SoftBody_TearEdge (struct R3SoftBodyHandle handle, size_t index)
 Mark the indexed edge as torn.
R3Status r3SoftBody_TearCell (struct R3SoftBodyHandle handle, size_t index)
 Mark the indexed cell as torn.
size_t r3SoftBodyTearEvent_PieceCount (const struct R3SoftBodyTearEvent *event)
 Return the number of soft bodies the torn body is in after the tear: the length of r3SoftBodyTearEvent_Bodies, and the exclusive bound of the piece_index of r3SoftBodyTearEvent_PieceParticles.
R3Bool r3RecoveryAuthoredVelocityMargin (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::authoredVelocityMargin.
R3Bool r3RecoveryEdgeSpeculation (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::edgeSpeculation.
R3Bool r3RecoveryInvertedCellDetection (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::invertedCellDetection.
R3Bool r3RecoverySelfCrossingDetection (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::selfCrossingDetection.
R3Bool r3RecoveryDetectionMotionGating (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::detectionMotionGating.
R3Bool r3RecoveryCrossBodyDetection (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::crossBodyDetection.
R3Bool r3RecoverySelfStandDown (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::selfStandDown.
R3Bool r3RecoveryCrossBodyExpelGate (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::crossBodyExpelGate.
R3Bool r3RecoveryEdgeStandDown (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::edgeStandDown.
R3Bool r3RecoveryCrossingRepulsion (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::crossingRepulsion.
R3Bool r3RecoveryCrossingRepulsionGuide (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::crossingRepulsionGuide.
R3Bool r3RecoveryCrossingRepulsionSelfGuide (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::crossingRepulsionSelfGuide.
R3Real r3RecoveryRecoveryPace (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::recoveryPace.
R3Bool r3RecoveryOverlapConstraints (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapConstraints.
R3Bool r3RecoveryOverlapRigid (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapRigid.
R3Bool r3RecoveryOverlapSkipSelfTangled (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapSkipSelfTangled.
R3Bool r3RecoveryOverlapEdgeStandDown (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapEdgeStandDown.
R3Real r3RecoveryOverlapConstraintPace (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapConstraintPace.
uint32_t r3RecoveryOverlapPatchConstraints (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapPatchConstraints.
R3Status r3RecoverySetOverlapPatchConstraints (struct R3World *world, uint32_t value)
 Set the world setting documented by R3SoftRecoverySettings::overlapPatchConstraints.
R3Bool r3RecoveryOverlapSkinVolume (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapSkinVolume.
R3Real r3RecoveryOverlapKeptDepth (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapKeptDepth.
R3Bool r3RecoveryOverlapSelfRegions (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapSelfRegions.
R3Bool r3RecoveryOverlapNormalPush (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapNormalPush.
R3Bool r3RecoveryOverlapMultiVolume (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapMultiVolume.
uint32_t r3RecoveryOverlapSplit (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapSplit.
R3Status r3RecoverySetOverlapSplit (struct R3World *world, uint32_t value)
 Set the world setting documented by R3SoftRecoverySettings::overlapSplit.
uint32_t r3RecoveryOverlapPatience (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapPatience.
R3Status r3RecoverySetOverlapPatience (struct R3World *world, uint32_t value)
 Set the world setting documented by R3SoftRecoverySettings::overlapPatience.
R3Real r3RecoveryOverlapProgressMargin (const struct R3World *world)
 Return the world setting documented by R3SoftRecoverySettings::overlapProgressMargin.
R3Real r3FemLinearTolerance (const struct R3World *world)
 Return the world setting documented by R3SoftFemParameters::linearTolerance.
size_t r3FemMaxLinearIterations (const struct R3World *world)
 Return the world setting documented by R3SoftFemParameters::maxLinearIterations.
size_t r3FemMaxDenseDofs (const struct R3World *world)
 Return the world setting documented by R3SoftFemParameters::maxDenseDofs.
size_t r3SoftBody_NumParticles (struct R3SoftBodyHandle handle)
 Return the soft body particle count.
uint32_t r3SoftBody_TopologyVersion (struct R3SoftBodyHandle handle)
 Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches.
R3Real r3SoftBody_Mass (struct R3SoftBodyHandle handle)
 Return the soft body mass.
R3Real r3SoftBody_Volume (struct R3SoftBodyHandle handle)
 Return the soft body current volume.
R3Real r3SoftBody_RestVolume (struct R3SoftBodyHandle handle)
 Return the soft body undeformed volume.
R3Real r3SoftBody_VolumeFactor (struct R3SoftBodyHandle handle)
 Return the soft body target volume multiplier.
struct R3Vector r3SoftBody_CenterOfMass (struct R3SoftBodyHandle handle)
 Return the soft body world-space center of mass.
struct R3RigidBodyHandle r3SoftBody_RootBody (struct R3SoftBodyHandle handle)
 Return the soft body root rigid-proxy handle.
R3Bool r3SoftBody_IsEnabled (struct R3SoftBodyHandle handle)
 Return whether the soft body is enabled.
R3Bool r3SoftBody_IsSleeping (struct R3SoftBodyHandle handle)
 Return whether the soft body is sleeping.
size_t r3SoftBody_ParticleVelocities (struct R3SoftBodyHandle handle, struct R3Vector *buffer, size_t capacity)
 Copy world-space particle velocities.
size_t r3SoftBody_Edges (struct R3SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened edge vertex indices.
size_t r3SoftBody_Cells (struct R3SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened cell vertex indices.
size_t r3SoftBody_Boundary (struct R3SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened boundary element indices.
size_t r3SoftBody_Pieces (struct R3SoftBodyHandle handle, struct R3SoftBodyHandle *buffer, size_t capacity)
 Copy piece identifiers.
R3Status r3SoftBody_SetParticleVelocity (struct R3SoftBodyHandle handle, size_t index, struct R3Vector value)
 Set the soft body particle world-space velocity.
R3Status r3SoftBody_SetParticleKinematicTarget (struct R3SoftBodyHandle handle, size_t index, struct R3Vector value)
 Set the next world-space target position of a pinned particle.
R3Status r3SoftBody_SetParticlePinned (struct R3SoftBodyHandle handle, size_t index, R3Bool value)
 Enable or disable pinning the particle for the soft body.
R3Status r3SoftBody_ApplyParticleImpulse (struct R3SoftBodyHandle handle, size_t index, struct R3Vector value, R3Bool wake_up)
 Apply a world-space impulse to one particle.
R3Status r3SoftBody_AddForce (struct R3SoftBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Accumulate a world-space force; it persists until reset.
R3Status r3SoftBody_ApplyImpulse (struct R3SoftBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Add the same world-space velocity change to every free particle: the whole body is kicked at the same velocity, whatever the particle masses (the value is not divided by the mass).
R3Status r3SoftBody_ResetForces (struct R3SoftBodyHandle handle, R3Bool wake_up)
 Clear accumulated user forces.
R3Status r3SoftBody_SetEnabled (struct R3SoftBodyHandle handle, R3Bool value)
 Enable or disable the soft body.
R3Status r3SoftBody_SetVolumeFactor (struct R3SoftBodyHandle handle, R3Real value)
 Set the soft body target volume multiplier.
R3Status r3SoftBody_AttachParticle (struct R3SoftBodyHandle handle, size_t index, struct R3RigidBodyHandle rigid_body)
 Attach a particle to a rigid body by a two-way point-to-point constraint (unlike pinning).
R3Bool r3SoftBody_DetachParticle (struct R3SoftBodyHandle handle, size_t index)
 Detach a particle from every rigid body it was attached to with r3SoftBody_AttachParticle.
size_t r3SoftBody_Clusters (struct R3SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy cluster indices.
struct R3RigidBodyHandle r3SoftBody_ClusterProxy (struct R3SoftBodyHandle handle, uint32_t cluster)
 Return the rigid proxy for the selected cluster.
size_t r3SoftBody_ClusterParticles (struct R3SoftBodyHandle handle, uint32_t cluster, uint32_t *buffer, size_t capacity)
 Copy particle indices for a cluster.
R3Status r3SoftBody_SetClusterPinned (struct R3SoftBodyHandle handle, uint32_t cluster, R3Bool value)
 Enable or disable pinning the cluster for the soft body.
R3Status r3SoftBody_SetClusterKinematicTarget (struct R3SoftBodyHandle handle, uint32_t cluster, struct R3Pose value)
 Set the next world-space target pose of a pinned cluster.
R3Status r3SoftBody_SetClusterShapeMatchingEnabled (struct R3SoftBodyHandle handle, uint32_t cluster, R3Bool value)
 Enable or disable using cluster shape matching for the soft body.
R3Status r3SoftBody_SetClusterStiffnessScale (struct R3SoftBodyHandle handle, uint32_t cluster, R3Real value)
 Scale the material stiffness (Young modulus) of every cell fully contained in a live cluster: regional materials without a separate body.
R3Status r3SoftBody_SetClusterTearResistance (struct R3SoftBodyHandle handle, uint32_t cluster, R3Real value)
 Set the soft body cluster tear-resistance multiplier.
size_t r3SoftBody_Meshes (struct R3SoftBodyHandle handle, struct R3SoftMeshInfo *buffer, size_t capacity)
 Copy collision mesh metadata.
size_t r3SoftBody_MeshVerticesById (struct R3SoftBodyHandle handle, struct R3SoftMeshId id, struct R3Vector *buffer, size_t capacity)
 Copy world-space vertices for a mesh ID.
size_t r3SoftBody_MeshIndicesById (struct R3SoftBodyHandle handle, struct R3SoftMeshId id, uint32_t *buffer, size_t capacity)
 Copy flattened indices for a mesh ID.
size_t r3SoftBody_MeshColliders (struct R3SoftBodyHandle handle, struct R3ColliderHandle *buffer, size_t capacity)
 Copy collision mesh collider handles.
size_t r3SoftBody_MeshVertices (struct R3SoftBodyHandle handle, struct R3ColliderHandle collider, struct R3Vector *buffer, size_t capacity)
 Copy world-space collision mesh vertices.
size_t r3SoftBody_MeshIndices (struct R3SoftBodyHandle handle, struct R3ColliderHandle collider, uint32_t *buffer, size_t capacity)
 Copy flattened collision mesh indices.
size_t r3SoftBody_MeshArity (struct R3SoftBodyHandle handle, struct R3ColliderHandle collider)
 Return indices per collision-mesh element (2 for segments, 3 for triangles).
uint32_t r3SoftBody_MeshTopologyVersion (struct R3SoftBodyHandle handle, struct R3ColliderHandle collider)
 Return the selected collision mesh topology revision for cache invalidation.
R3Status r3SoftBody_SetSolver (struct R3SoftBodyHandle handle, uint32_t solver)
 Set the soft body soft solver kind (R3_SOFT_SOLVER_*).
R3Status r3SoftBody_SetClusterShapeMatchingTarget (struct R3SoftBodyHandle handle, uint32_t cluster, const struct R3Pose *target)
 Set the soft body cluster shape-matching target pose.
R3Status r3SoftBody_SetEdgeTearResistance (struct R3SoftBodyHandle handle, size_t index, R3Real resistance)
 Set the soft body edge tear-resistance multiplier.
R3Bool r3SoftBody_MeshIsClosed (struct R3SoftBodyHandle handle, struct R3ColliderHandle collider)
 Return whether the selected collision mesh is closed.
struct R3SoftBodyHandle r3RigidBody_SoftBody (struct R3RigidBodyHandle handle)
 Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
R3Bool r3RigidBody_IsSoftFrame (struct R3RigidBodyHandle handle)
 Return whether the rigid body is a soft-body proxy.
R3Status r3SoftBody_ValidateHandle (struct R3SoftBodyHandle handle)
 Validate the index and generation in the live owning world.

Detailed Description

Particle recipes, materials, clusters, deformable meshes, and tearing.

Mesh indices and particle indices can change after tearing; use topology versions and tear remapping events to maintain application data. FEM requires RAPIER_FEM.

Macro Definition Documentation

◆ R3_SOFT_BINDING_DIRECT

#define R3_SOFT_BINDING_DIRECT   1

Soft-body selector: binding direct.

◆ R3_SOFT_BINDING_DIRECT_BY_POSITION

#define R3_SOFT_BINDING_DIRECT_BY_POSITION   2

Soft-body selector: binding direct by position.

◆ R3_SOFT_BINDING_SKINNED

#define R3_SOFT_BINDING_SKINNED   0

Soft-body selector: binding skinned.

◆ R3_SOFT_CELL_COROTATIONAL

#define R3_SOFT_CELL_COROTATIONAL   1

Corotational elastic cell model.

◆ R3_SOFT_CELL_NEO_HOOKEAN

#define R3_SOFT_CELL_NEO_HOOKEAN   2

Neo-Hookean elastic cell model.

◆ R3_SOFT_CELL_VOLUME

#define R3_SOFT_CELL_VOLUME   0

Cell model that constrains volume without elastic shear response.

◆ R3_SOFT_DESC_CLOTH

#define R3_SOFT_DESC_CLOTH   3

Soft-body selector: desc cloth.

◆ R3_SOFT_DESC_CLOTH_ANISOTROPIC

#define R3_SOFT_DESC_CLOTH_ANISOTROPIC   12

Soft-body selector: cloth with separate warp, weft and shear softness (3D).

◆ R3_SOFT_DESC_CLOTH_TUBE

#define R3_SOFT_DESC_CLOTH_TUBE   8

Soft-body selector: desc cloth tube.

◆ R3_SOFT_DESC_CUBOID

#define R3_SOFT_DESC_CUBOID   4

Soft-body selector: desc cuboid.

◆ R3_SOFT_DESC_DISK

#define R3_SOFT_DESC_DISK   6

Soft-body selector: desc disk.

◆ R3_SOFT_DESC_GRID

#define R3_SOFT_DESC_GRID   2

Soft-body selector: desc grid.

◆ R3_SOFT_DESC_PARTICLES

#define R3_SOFT_DESC_PARTICLES   0

Soft-body selector: desc particles.

◆ R3_SOFT_DESC_ROPE

#define R3_SOFT_DESC_ROPE   1

Soft-body selector: desc rope.

◆ R3_SOFT_DESC_SPHERE

#define R3_SOFT_DESC_SPHERE   7

Soft-body selector: desc sphere.

◆ R3_SOFT_DESC_SURFACE

#define R3_SOFT_DESC_SURFACE   5

Soft-body selector: desc surface.

◆ R3_SOFT_DESC_VOLUMETRIC

#define R3_SOFT_DESC_VOLUMETRIC   9

Soft-body selector: desc volumetric.

◆ R3_SOFT_EDGE_PLASTIC_FLOW_BOTH

#define R3_SOFT_EDGE_PLASTIC_FLOW_BOTH   0

Edge plastic flow (R3SoftBodyMaterial::edgePlasticFlow): both a squeeze and a stretch set.

◆ R3_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION

#define R3_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION   1

Edge plastic flow: only a squeeze sets; a stretched edge springs back.

◆ R3_SOFT_EDGE_PLASTIC_FLOW_TENSION

#define R3_SOFT_EDGE_PLASTIC_FLOW_TENSION   2

Edge plastic flow: only a stretch sets; a squeezed edge springs back.

◆ R3_SOFT_FRAME

#define R3_SOFT_FRAME   4

Read-only body type of soft-body cluster proxies; cannot be used to construct a rigid body.

◆ R3_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL

#define R3_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL   2

Overlap patch constraints: align them with the overlap normal.

◆ R3_SOFT_PATCH_CONSTRAINTS_KEEP

#define R3_SOFT_PATCH_CONSTRAINTS_KEEP   0

Overlap patch constraints (R3SoftRecoverySettings::overlapPatchConstraints): keep them.

◆ R3_SOFT_PATCH_CONSTRAINTS_STAND_DOWN

#define R3_SOFT_PATCH_CONSTRAINTS_STAND_DOWN   1

Overlap patch constraints: stand them down inside the patch.

◆ R3_SOFT_SOLVER_CONSTRAINTS

#define R3_SOFT_SOLVER_CONSTRAINTS   0

Use the constraint-based soft-body solver.

◆ R3_SOFT_SOLVER_FEM

#define R3_SOFT_SOLVER_FEM   1

Use the finite-element solver; requires RAPIER_FEM.

Typedef Documentation

◆ R3SoftBodiesSettings

typedef struct R3SoftBodiesSettings R3SoftBodiesSettings

Plain configuration data; initialize defaults, edit, then apply.

No destructor.

◆ R3SoftBodyDesc

typedef struct R3SoftBodyDesc R3SoftBodyDesc

Copyable recipe, not an owned procedural builder.

Initialize before editing. All array views borrow caller data until build/insert returns; counts for topology arrays are element counts (edges, triangles, or tetrahedra). Nonempty topology overrides the generator's topology. Zero counts retain it. Generator inputs: a/b are rope ends or center/half-extents; cloth uses a/du/dv. R3_SOFT_DESC_POLYGON reads positions; R3_SOFT_DESC_TRIMESH reads positions and cells (its triangles become edges and a boundary, not cells).

◆ R3SoftBodyDescView

typedef struct R3SoftBodyDescView R3SoftBodyDescView

Borrowed array of soft-body descriptions.

count counts descriptions. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R3SoftBodyHandle

typedef struct R3SoftBodyHandle R3SoftBodyHandle

Copyable non-owning handle: world pointer plus entity index and generation.

The world must remain alive throughout every use. Copying does not retain it. UINT32_MAX/UINT32_MAX with a NULL world is invalid.

◆ R3SoftBodyMaterial

typedef struct R3SoftBodyMaterial R3SoftBodyMaterial

Plain configuration data; initialize defaults, edit, then apply.

No destructor.

◆ R3SoftClusterSplit

typedef struct R3SoftClusterSplit R3SoftClusterSplit

Cluster and proxy remapping after a soft-body split.

◆ R3SoftEdgeSoftness

typedef struct R3SoftEdgeSoftness R3SoftEdgeSoftness

Spring-coefficient override for one soft-body edge.

◆ R3SoftEdgeSoftnessView

typedef struct R3SoftEdgeSoftnessView R3SoftEdgeSoftnessView

Borrowed elements; count counts elements.

Data must remain live through insertion.

◆ R3SoftEdgeTear

typedef struct R3SoftEdgeTear R3SoftEdgeTear

Tear-resistance override for one soft-body edge.

◆ R3SoftEdgeTearView

typedef struct R3SoftEdgeTearView R3SoftEdgeTearView

Borrowed elements; count counts elements.

Data must remain live through insertion.

◆ R3SoftFemParameters

typedef struct R3SoftFemParameters R3SoftFemParameters

Plain configuration data; initialize defaults, edit, then apply.

No destructor.

◆ R3SoftJointMove

typedef struct R3SoftJointMove R3SoftJointMove

Impulse-joint movement between rigid proxies after tearing.

◆ R3SoftMeshBindingDesc

typedef struct R3SoftMeshBindingDesc R3SoftMeshBindingDesc

Non-owning deformable binding description.

Direct particle indices are borrowed.

◆ R3SoftMeshId

typedef struct R3SoftMeshId R3SoftMeshId

Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId.

◆ R3SoftMeshInfo

typedef struct R3SoftMeshInfo R3SoftMeshInfo

Mesh identity and rendering metadata.

A render-only mesh has an invalid collider handle.

◆ R3SoftRecoverySettings

typedef struct R3SoftRecoverySettings R3SoftRecoverySettings

Plain configuration data; initialize defaults, edit, then apply.

No destructor.

Function Documentation

◆ r3ClothAnisotropicSoftBodyDesc()

struct R3SoftBodyDesc r3ClothAnisotropicSoftBodyDesc ( struct R3Vector origin,
struct R3Vector du,
struct R3Vector dv,
size_t nu,
size_t nv,
struct R3SpringCoefficients warp,
struct R3SpringCoefficients weft,
struct R3SpringCoefficients shear )

Return a cloth recipe like r3ClothSoftBodyDesc whose edges along du (warp), along dv (weft) and diagonal (shear) get their own softness; the material's bendSoftness still applies to the bending edges.

The softness is stored in warpSoftness, weftSoftness and shearSoftness. Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3ClothSoftBodyDesc()

struct R3SoftBodyDesc r3ClothSoftBodyDesc ( struct R3Vector origin,
struct R3Vector du,
struct R3Vector dv,
size_t nu,
size_t nv )

Return a cloth recipe with nu by nv particles at origin + i * du + j * dv.

Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3ClothTubeSoftBodyDesc()

struct R3SoftBodyDesc r3ClothTubeSoftBodyDesc ( struct R3Vector origin,
struct R3Vector axis,
R3Real radius_start,
R3Real radius_end,
size_t num_around,
size_t num_along )

Return a cloth tube recipe from origin to origin + axis with num_along rings of num_around particles; radius varies linearly between the ends.

Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3CuboidSoftBodyDesc()

struct R3SoftBodyDesc r3CuboidSoftBodyDesc ( struct R3Vector center,
struct R3Vector half_extents,
size_t nx,
size_t ny,
size_t nz )

Return a solid box recipe on an nx by ny by nz particle grid, subdivided into tetrahedra.

Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3CutSoftBody()

struct R3SoftBodyTearEvent * r3CutSoftBody ( struct R3SoftBodyHandle handle,
const struct R3Vector * blade )

Cut using DIM points (a segment in 2D, triangle in 3D).

A no-op returns a null event. The optional owned event must be freed with FreeSoftBodyTearEvent.

◆ r3DefaultSoftBodiesSettings()

struct R3SoftBodiesSettings r3DefaultSoftBodiesSettings ( void )

Return native default soft bodies settings.

This POD value owns no resources.

◆ r3DefaultSoftBodyDesc()

struct R3SoftBodyDesc r3DefaultSoftBodyDesc ( void )

Return native default soft body desc.

This POD value owns no resources.

◆ r3DefaultSoftBodyMaterial()

struct R3SoftBodyMaterial r3DefaultSoftBodyMaterial ( void )

Return native default soft body material.

This POD value owns no resources.

◆ r3DefaultSoftFemParameters()

struct R3SoftFemParameters r3DefaultSoftFemParameters ( void )

Return native default soft fem parameters.

This POD value owns no resources.

◆ r3DefaultSoftMeshBindingDesc()

struct R3SoftMeshBindingDesc r3DefaultSoftMeshBindingDesc ( void )

Return native default soft mesh binding desc.

This POD value owns no resources.

◆ r3DefaultSoftRecoverySettings()

struct R3SoftRecoverySettings r3DefaultSoftRecoverySettings ( void )

Return native default soft recovery settings.

This POD value owns no resources.

◆ r3FemLinearTolerance()

R3Real r3FemLinearTolerance ( const struct R3World * world)

Return the world setting documented by R3SoftFemParameters::linearTolerance.

◆ r3FemMaxDenseDofs()

size_t r3FemMaxDenseDofs ( const struct R3World * world)

Return the world setting documented by R3SoftFemParameters::maxDenseDofs.

◆ r3FemMaxLinearIterations()

size_t r3FemMaxLinearIterations ( const struct R3World * world)

Return the world setting documented by R3SoftFemParameters::maxLinearIterations.

◆ r3FemSetLinearTolerance()

R3Status r3FemSetLinearTolerance ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftFemParameters::linearTolerance.

◆ r3FemSetMaxDenseDofs()

R3Status r3FemSetMaxDenseDofs ( struct R3World * world,
size_t value )

Set the world setting documented by R3SoftFemParameters::maxDenseDofs.

◆ r3FemSetMaxLinearIterations()

R3Status r3FemSetMaxLinearIterations ( struct R3World * world,
size_t value )

Set the world setting documented by R3SoftFemParameters::maxLinearIterations.

◆ r3FreeSoftBodyTearEvent()

R3Status r3FreeSoftBodyTearEvent ( struct R3SoftBodyTearEvent * event)

Release an owned soft body tear event.

NULL is allowed. Do not pass borrowed pointers or free the object twice.

◆ r3InsertSoftBody()

struct R3SoftBodyHandle r3InsertSoftBody ( struct R3World * world,
const struct R3SoftBodyDesc * desc )

Consumes no caller-owned resources.

All borrowed arrays may be released on return.

◆ r3RecoveryAuthoredVelocityMargin()

R3Bool r3RecoveryAuthoredVelocityMargin ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::authoredVelocityMargin.

◆ r3RecoveryCrossBodyDetection()

R3Bool r3RecoveryCrossBodyDetection ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::crossBodyDetection.

◆ r3RecoveryCrossBodyExpelGate()

R3Bool r3RecoveryCrossBodyExpelGate ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::crossBodyExpelGate.

◆ r3RecoveryCrossingRepulsion()

R3Bool r3RecoveryCrossingRepulsion ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::crossingRepulsion.

◆ r3RecoveryCrossingRepulsionGuide()

R3Bool r3RecoveryCrossingRepulsionGuide ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::crossingRepulsionGuide.

◆ r3RecoveryCrossingRepulsionSelfGuide()

R3Bool r3RecoveryCrossingRepulsionSelfGuide ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::crossingRepulsionSelfGuide.

◆ r3RecoveryDetectionMotionGating()

R3Bool r3RecoveryDetectionMotionGating ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::detectionMotionGating.

◆ r3RecoveryEdgeSpeculation()

R3Bool r3RecoveryEdgeSpeculation ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::edgeSpeculation.

◆ r3RecoveryEdgeStandDown()

R3Bool r3RecoveryEdgeStandDown ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::edgeStandDown.

◆ r3RecoveryInvertedCellDetection()

R3Bool r3RecoveryInvertedCellDetection ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::invertedCellDetection.

◆ r3RecoveryOverlapConstraintPace()

R3Real r3RecoveryOverlapConstraintPace ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapConstraintPace.

◆ r3RecoveryOverlapConstraints()

R3Bool r3RecoveryOverlapConstraints ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapConstraints.

◆ r3RecoveryOverlapEdgeStandDown()

R3Bool r3RecoveryOverlapEdgeStandDown ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapEdgeStandDown.

◆ r3RecoveryOverlapKeptDepth()

R3Real r3RecoveryOverlapKeptDepth ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapKeptDepth.

◆ r3RecoveryOverlapMultiVolume()

R3Bool r3RecoveryOverlapMultiVolume ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapMultiVolume.

◆ r3RecoveryOverlapNormalPush()

R3Bool r3RecoveryOverlapNormalPush ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapNormalPush.

◆ r3RecoveryOverlapPatchConstraints()

uint32_t r3RecoveryOverlapPatchConstraints ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapPatchConstraints.

◆ r3RecoveryOverlapPatience()

uint32_t r3RecoveryOverlapPatience ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapPatience.

◆ r3RecoveryOverlapProgressMargin()

R3Real r3RecoveryOverlapProgressMargin ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapProgressMargin.

◆ r3RecoveryOverlapRigid()

R3Bool r3RecoveryOverlapRigid ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapRigid.

◆ r3RecoveryOverlapSelfRegions()

R3Bool r3RecoveryOverlapSelfRegions ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapSelfRegions.

◆ r3RecoveryOverlapSkinVolume()

R3Bool r3RecoveryOverlapSkinVolume ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapSkinVolume.

◆ r3RecoveryOverlapSkipSelfTangled()

R3Bool r3RecoveryOverlapSkipSelfTangled ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapSkipSelfTangled.

◆ r3RecoveryOverlapSplit()

uint32_t r3RecoveryOverlapSplit ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::overlapSplit.

◆ r3RecoveryRecoveryPace()

R3Real r3RecoveryRecoveryPace ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::recoveryPace.

◆ r3RecoverySelfCrossingDetection()

R3Bool r3RecoverySelfCrossingDetection ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::selfCrossingDetection.

◆ r3RecoverySelfStandDown()

R3Bool r3RecoverySelfStandDown ( const struct R3World * world)

Return the world setting documented by R3SoftRecoverySettings::selfStandDown.

◆ r3RecoverySetAuthoredVelocityMargin()

R3Status r3RecoverySetAuthoredVelocityMargin ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::authoredVelocityMargin.

◆ r3RecoverySetCrossBodyDetection()

R3Status r3RecoverySetCrossBodyDetection ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::crossBodyDetection.

◆ r3RecoverySetCrossBodyExpelGate()

R3Status r3RecoverySetCrossBodyExpelGate ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::crossBodyExpelGate.

◆ r3RecoverySetCrossingRepulsion()

R3Status r3RecoverySetCrossingRepulsion ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::crossingRepulsion.

◆ r3RecoverySetCrossingRepulsionGuide()

R3Status r3RecoverySetCrossingRepulsionGuide ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::crossingRepulsionGuide.

◆ r3RecoverySetCrossingRepulsionSelfGuide()

R3Status r3RecoverySetCrossingRepulsionSelfGuide ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::crossingRepulsionSelfGuide.

◆ r3RecoverySetDetectionMotionGating()

R3Status r3RecoverySetDetectionMotionGating ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::detectionMotionGating.

◆ r3RecoverySetEdgeSpeculation()

R3Status r3RecoverySetEdgeSpeculation ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::edgeSpeculation.

◆ r3RecoverySetEdgeStandDown()

R3Status r3RecoverySetEdgeStandDown ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::edgeStandDown.

◆ r3RecoverySetInvertedCellDetection()

R3Status r3RecoverySetInvertedCellDetection ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::invertedCellDetection.

◆ r3RecoverySetOverlapConstraintPace()

R3Status r3RecoverySetOverlapConstraintPace ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftRecoverySettings::overlapConstraintPace.

◆ r3RecoverySetOverlapConstraints()

R3Status r3RecoverySetOverlapConstraints ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapConstraints.

◆ r3RecoverySetOverlapEdgeStandDown()

R3Status r3RecoverySetOverlapEdgeStandDown ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapEdgeStandDown.

◆ r3RecoverySetOverlapKeptDepth()

R3Status r3RecoverySetOverlapKeptDepth ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftRecoverySettings::overlapKeptDepth.

◆ r3RecoverySetOverlapMultiVolume()

R3Status r3RecoverySetOverlapMultiVolume ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapMultiVolume.

◆ r3RecoverySetOverlapNormalPush()

R3Status r3RecoverySetOverlapNormalPush ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapNormalPush.

◆ r3RecoverySetOverlapPatchConstraints()

R3Status r3RecoverySetOverlapPatchConstraints ( struct R3World * world,
uint32_t value )

Set the world setting documented by R3SoftRecoverySettings::overlapPatchConstraints.

◆ r3RecoverySetOverlapPatience()

R3Status r3RecoverySetOverlapPatience ( struct R3World * world,
uint32_t value )

Set the world setting documented by R3SoftRecoverySettings::overlapPatience.

◆ r3RecoverySetOverlapProgressMargin()

R3Status r3RecoverySetOverlapProgressMargin ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftRecoverySettings::overlapProgressMargin.

◆ r3RecoverySetOverlapRigid()

R3Status r3RecoverySetOverlapRigid ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapRigid.

◆ r3RecoverySetOverlapSelfRegions()

R3Status r3RecoverySetOverlapSelfRegions ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapSelfRegions.

◆ r3RecoverySetOverlapSkinVolume()

R3Status r3RecoverySetOverlapSkinVolume ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapSkinVolume.

◆ r3RecoverySetOverlapSkipSelfTangled()

R3Status r3RecoverySetOverlapSkipSelfTangled ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::overlapSkipSelfTangled.

◆ r3RecoverySetOverlapSplit()

R3Status r3RecoverySetOverlapSplit ( struct R3World * world,
uint32_t value )

Set the world setting documented by R3SoftRecoverySettings::overlapSplit.

◆ r3RecoverySetRecoveryPace()

R3Status r3RecoverySetRecoveryPace ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftRecoverySettings::recoveryPace.

◆ r3RecoverySetSelfCrossingDetection()

R3Status r3RecoverySetSelfCrossingDetection ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::selfCrossingDetection.

◆ r3RecoverySetSelfStandDown()

R3Status r3RecoverySetSelfStandDown ( struct R3World * world,
R3Bool value )

Set the world setting documented by R3SoftRecoverySettings::selfStandDown.

◆ r3RemoveSoftBody()

R3Status r3RemoveSoftBody ( struct R3SoftBodyHandle handle)

Remove a soft body and its associated simulation objects.

Invalidates its handle.

◆ r3RigidBody_IsSoftFrame()

R3Bool r3RigidBody_IsSoftFrame ( struct R3RigidBodyHandle handle)

Return whether the rigid body is a soft-body proxy.

◆ r3RigidBody_SoftBody()

struct R3SoftBodyHandle r3RigidBody_SoftBody ( struct R3RigidBodyHandle handle)

Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.

◆ r3RopeSoftBodyDesc()

struct R3SoftBodyDesc r3RopeSoftBodyDesc ( struct R3Vector a,
struct R3Vector b,
size_t particles )

Return a rope recipe with particles evenly spaced from a to b, including both endpoints.

Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3SoftBodiesContactStiffening()

R3Real r3SoftBodiesContactStiffening ( const struct R3World * world)

Return the world setting documented by R3SoftBodiesSettings::contactStiffening.

◆ r3SoftBodiesMaxExtraSubsteps()

size_t r3SoftBodiesMaxExtraSubsteps ( const struct R3World * world)

Return the world setting documented by R3SoftBodiesSettings::maxExtraSubsteps.

◆ r3SoftBodiesResweepStrain()

R3Real r3SoftBodiesResweepStrain ( const struct R3World * world)

Return the world setting documented by R3SoftBodiesSettings::resweepStrain.

◆ r3SoftBodiesSetContactStiffening()

R3Status r3SoftBodiesSetContactStiffening ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftBodiesSettings::contactStiffening.

◆ r3SoftBodiesSetMaxExtraSubsteps()

R3Status r3SoftBodiesSetMaxExtraSubsteps ( struct R3World * world,
size_t value )

Set the world setting documented by R3SoftBodiesSettings::maxExtraSubsteps.

◆ r3SoftBodiesSetResweepStrain()

R3Status r3SoftBodiesSetResweepStrain ( struct R3World * world,
R3Real value )

Set the world setting documented by R3SoftBodiesSettings::resweepStrain.

◆ r3SoftBody_AddCluster()

uint32_t r3SoftBody_AddCluster ( struct R3SoftBodyHandle handle,
const uint32_t * particles,
size_t count )

Create a rigid proxy cluster from the supplied particle indices and return its cluster index.

◆ r3SoftBody_AddForce()

R3Status r3SoftBody_AddForce ( struct R3SoftBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Accumulate a world-space force; it persists until reset.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_AddParticleForce()

R3Status r3SoftBody_AddParticleForce ( struct R3SoftBodyHandle handle,
size_t index,
struct R3Vector value,
R3Bool wake_up )

Add a world-space force to the indexed particle.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_ApplyImpulse()

R3Status r3SoftBody_ApplyImpulse ( struct R3SoftBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Add the same world-space velocity change to every free particle: the whole body is kicked at the same velocity, whatever the particle masses (the value is not divided by the mass).

Pinned particles ignore it. wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_ApplyImpulseAtPoint()

R3Status r3SoftBody_ApplyImpulseAtPoint ( struct R3SoftBodyHandle handle,
struct R3Vector impulse,
struct R3Vector point,
R3Real falloff_radius,
R3Bool wake_up )

Apply a world-space impulse to every free particle within falloff_radius of the world-space point, scaled linearly from 1 at the point to 0 at that radius and divided by the particle's mass.

A falloff_radius of zero or less gives every free particle the whole impulse. Pinned particles ignore it. wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_ApplyParticleImpulse()

R3Status r3SoftBody_ApplyParticleImpulse ( struct R3SoftBodyHandle handle,
size_t index,
struct R3Vector value,
R3Bool wake_up )

Apply a world-space impulse to one particle.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_ApplyRadialImpulse()

R3Status r3SoftBody_ApplyRadialImpulse ( struct R3SoftBodyHandle handle,
struct R3Vector center,
R3Real magnitude,
R3Real falloff_radius,
R3Bool wake_up )

Apply an impulse of the given magnitude pointing away from the world-space center to every free particle within falloff_radius, scaled linearly from 1 at the center to 0 at that radius and divided by the particle's mass.

A particle on the center gets nothing; a falloff_radius of zero or less pushes every free particle fully. A negative magnitude pulls toward the center. Pinned particles ignore it. wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_AttachParticle()

R3Status r3SoftBody_AttachParticle ( struct R3SoftBodyHandle handle,
size_t index,
struct R3RigidBodyHandle rigid_body )

Attach a particle to a rigid body by a two-way point-to-point constraint (unlike pinning).

The anchor is the particle's current position, expressed in the rigid body's local frame; a particle attached twice keeps both attachments. Undo it with r3SoftBody_DetachParticle.

◆ r3SoftBody_Boundary()

size_t r3SoftBody_Boundary ( struct R3SoftBodyHandle handle,
uint32_t * buffer,
size_t capacity )

Copy flattened boundary element indices.

See also
Arrays and output buffers

◆ r3SoftBody_Cells()

size_t r3SoftBody_Cells ( struct R3SoftBodyHandle handle,
uint32_t * buffer,
size_t capacity )

Copy flattened cell vertex indices.

See also
Arrays and output buffers

◆ r3SoftBody_CenterOfMass()

struct R3Vector r3SoftBody_CenterOfMass ( struct R3SoftBodyHandle handle)

Return the soft body world-space center of mass.

◆ r3SoftBody_ClusterParticles()

size_t r3SoftBody_ClusterParticles ( struct R3SoftBodyHandle handle,
uint32_t cluster,
uint32_t * buffer,
size_t capacity )

Copy particle indices for a cluster.

See also
Arrays and output buffers

◆ r3SoftBody_ClusterProxy()

struct R3RigidBodyHandle r3SoftBody_ClusterProxy ( struct R3SoftBodyHandle handle,
uint32_t cluster )

Return the rigid proxy for the selected cluster.

◆ r3SoftBody_Clusters()

size_t r3SoftBody_Clusters ( struct R3SoftBodyHandle handle,
uint32_t * buffer,
size_t capacity )

Copy cluster indices.

See also
Arrays and output buffers

◆ r3SoftBody_Contains()

R3Bool r3SoftBody_Contains ( struct R3SoftBodyHandle handle)

Test whether the live world contains this soft body handle.

A removed/stale handle returns false.

◆ r3SoftBody_DetachParticle()

R3Bool r3SoftBody_DetachParticle ( struct R3SoftBodyHandle handle,
size_t index )

Detach a particle from every rigid body it was attached to with r3SoftBody_AttachParticle.

Returns whether it was attached at all.

◆ r3SoftBody_Edges()

size_t r3SoftBody_Edges ( struct R3SoftBodyHandle handle,
uint32_t * buffer,
size_t capacity )

Copy flattened edge vertex indices.

See also
Arrays and output buffers

◆ r3SoftBody_IsEnabled()

R3Bool r3SoftBody_IsEnabled ( struct R3SoftBodyHandle handle)

Return whether the soft body is enabled.

◆ r3SoftBody_IsSleeping()

R3Bool r3SoftBody_IsSleeping ( struct R3SoftBodyHandle handle)

Return whether the soft body is sleeping.

◆ r3SoftBody_Mass()

R3Real r3SoftBody_Mass ( struct R3SoftBodyHandle handle)

Return the soft body mass.

◆ r3SoftBody_Material()

struct R3SoftBodyMaterial r3SoftBody_Material ( struct R3SoftBodyHandle handle)

Return a copy of the soft body material parameters.

◆ r3SoftBody_MeshArity()

size_t r3SoftBody_MeshArity ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle collider )

Return indices per collision-mesh element (2 for segments, 3 for triangles).

◆ r3SoftBody_MeshColliders()

size_t r3SoftBody_MeshColliders ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy collision mesh collider handles.

See also
Arrays and output buffers

◆ r3SoftBody_Meshes()

size_t r3SoftBody_Meshes ( struct R3SoftBodyHandle handle,
struct R3SoftMeshInfo * buffer,
size_t capacity )

Copy collision mesh metadata.

See also
Arrays and output buffers

◆ r3SoftBody_MeshIndices()

size_t r3SoftBody_MeshIndices ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle collider,
uint32_t * buffer,
size_t capacity )

Copy flattened collision mesh indices.

See also
Arrays and output buffers

◆ r3SoftBody_MeshIndicesById()

size_t r3SoftBody_MeshIndicesById ( struct R3SoftBodyHandle handle,
struct R3SoftMeshId id,
uint32_t * buffer,
size_t capacity )

Copy flattened indices for a mesh ID.

See also
Arrays and output buffers

◆ r3SoftBody_MeshIsClosed()

R3Bool r3SoftBody_MeshIsClosed ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle collider )

Return whether the selected collision mesh is closed.

◆ r3SoftBody_MeshTopologyVersion()

uint32_t r3SoftBody_MeshTopologyVersion ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle collider )

Return the selected collision mesh topology revision for cache invalidation.

◆ r3SoftBody_MeshVertices()

size_t r3SoftBody_MeshVertices ( struct R3SoftBodyHandle handle,
struct R3ColliderHandle collider,
struct R3Vector * buffer,
size_t capacity )

Copy world-space collision mesh vertices.

See also
Arrays and output buffers

◆ r3SoftBody_MeshVerticesById()

size_t r3SoftBody_MeshVerticesById ( struct R3SoftBodyHandle handle,
struct R3SoftMeshId id,
struct R3Vector * buffer,
size_t capacity )

Copy world-space vertices for a mesh ID.

See also
Arrays and output buffers

◆ r3SoftBody_NumParticles()

size_t r3SoftBody_NumParticles ( struct R3SoftBodyHandle handle)

Return the soft body particle count.

◆ r3SoftBody_ParticlePosition()

struct R3Vector r3SoftBody_ParticlePosition ( struct R3SoftBodyHandle handle,
size_t index )

Return the world-space position of the indexed particle.

◆ r3SoftBody_ParticlePositions()

size_t r3SoftBody_ParticlePositions ( struct R3SoftBodyHandle handle,
struct R3Vector * buffer,
size_t capacity )

Copy world-space particle positions.

See also
Arrays and output buffers

◆ r3SoftBody_ParticleVelocities()

size_t r3SoftBody_ParticleVelocities ( struct R3SoftBodyHandle handle,
struct R3Vector * buffer,
size_t capacity )

Copy world-space particle velocities.

See also
Arrays and output buffers

◆ r3SoftBody_ParticleVelocity()

struct R3Vector r3SoftBody_ParticleVelocity ( struct R3SoftBodyHandle handle,
size_t index )

Return the world-space velocity of the indexed particle.

◆ r3SoftBody_Pieces()

size_t r3SoftBody_Pieces ( struct R3SoftBodyHandle handle,
struct R3SoftBodyHandle * buffer,
size_t capacity )

Copy piece identifiers.

See also
Arrays and output buffers

◆ r3SoftBody_RemoveCluster()

R3Status r3SoftBody_RemoveCluster ( struct R3SoftBodyHandle handle,
uint32_t cluster )

Remove the selected cluster and its rigid proxy.

◆ r3SoftBody_ResetForces()

R3Status r3SoftBody_ResetForces ( struct R3SoftBodyHandle handle,
R3Bool wake_up )

Clear accumulated user forces.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3SoftBody_ResetPlasticity()

R3Status r3SoftBody_ResetPlasticity ( struct R3SoftBodyHandle handle)

Undo every permanent (plastic) deformation: edge rest lengths, dihedral rest angles, cell rest shapes and particle rest positions return to their creation state.

The particles stay put and spring back elastically.

◆ r3SoftBody_RestVolume()

R3Real r3SoftBody_RestVolume ( struct R3SoftBodyHandle handle)

Return the soft body undeformed volume.

◆ r3SoftBody_RootBody()

struct R3RigidBodyHandle r3SoftBody_RootBody ( struct R3SoftBodyHandle handle)

Return the soft body root rigid-proxy handle.

◆ r3SoftBody_SetClusterEdgeSoftness()

R3Status r3SoftBody_SetClusterEdgeSoftness ( struct R3SoftBodyHandle handle,
uint32_t cluster,
const struct R3SpringCoefficients * softness )

Override the softness of every structural or bending edge fully contained in a live cluster: regional stiffness for cloth and ropes.

A NULL softness restores the body material's.

◆ r3SoftBody_SetClusterKinematicTarget()

R3Status r3SoftBody_SetClusterKinematicTarget ( struct R3SoftBodyHandle handle,
uint32_t cluster,
struct R3Pose value )

Set the next world-space target pose of a pinned cluster.

◆ r3SoftBody_SetClusterPinned()

R3Status r3SoftBody_SetClusterPinned ( struct R3SoftBodyHandle handle,
uint32_t cluster,
R3Bool value )

Enable or disable pinning the cluster for the soft body.

◆ r3SoftBody_SetClusterShapeMatchingEnabled()

R3Status r3SoftBody_SetClusterShapeMatchingEnabled ( struct R3SoftBodyHandle handle,
uint32_t cluster,
R3Bool value )

Enable or disable using cluster shape matching for the soft body.

◆ r3SoftBody_SetClusterShapeMatchingTarget()

R3Status r3SoftBody_SetClusterShapeMatchingTarget ( struct R3SoftBodyHandle handle,
uint32_t cluster,
const struct R3Pose * target )

Set the soft body cluster shape-matching target pose.

◆ r3SoftBody_SetClusterStiffnessScale()

R3Status r3SoftBody_SetClusterStiffnessScale ( struct R3SoftBodyHandle handle,
uint32_t cluster,
R3Real value )

Scale the material stiffness (Young modulus) of every cell fully contained in a live cluster: regional materials without a separate body.

Cells straddling the cluster's boundary keep their stiffness; use r3SoftBody_SetClusterEdgeSoftness for edges.

◆ r3SoftBody_SetClusterTearResistance()

R3Status r3SoftBody_SetClusterTearResistance ( struct R3SoftBodyHandle handle,
uint32_t cluster,
R3Real value )

Set the soft body cluster tear-resistance multiplier.

◆ r3SoftBody_SetEdgeTearResistance()

R3Status r3SoftBody_SetEdgeTearResistance ( struct R3SoftBodyHandle handle,
size_t index,
R3Real resistance )

Set the soft body edge tear-resistance multiplier.

◆ r3SoftBody_SetEnabled()

R3Status r3SoftBody_SetEnabled ( struct R3SoftBodyHandle handle,
R3Bool value )

Enable or disable the soft body.

◆ r3SoftBody_SetMaterial()

R3Status r3SoftBody_SetMaterial ( struct R3SoftBodyHandle handle,
const struct R3SoftBodyMaterial * data )

Copy material parameters into the soft body.

◆ r3SoftBody_SetParticleKinematicTarget()

R3Status r3SoftBody_SetParticleKinematicTarget ( struct R3SoftBodyHandle handle,
size_t index,
struct R3Vector value )

Set the next world-space target position of a pinned particle.

◆ r3SoftBody_SetParticlePinned()

R3Status r3SoftBody_SetParticlePinned ( struct R3SoftBodyHandle handle,
size_t index,
R3Bool value )

Enable or disable pinning the particle for the soft body.

◆ r3SoftBody_SetParticlePosition()

R3Status r3SoftBody_SetParticlePosition ( struct R3SoftBodyHandle handle,
size_t index,
struct R3Vector value )

Set the world-space position of the indexed particle.

◆ r3SoftBody_SetParticleVelocity()

R3Status r3SoftBody_SetParticleVelocity ( struct R3SoftBodyHandle handle,
size_t index,
struct R3Vector value )

Set the soft body particle world-space velocity.

◆ r3SoftBody_SetSolver()

R3Status r3SoftBody_SetSolver ( struct R3SoftBodyHandle handle,
uint32_t solver )

Set the soft body soft solver kind (R3_SOFT_SOLVER_*).

◆ r3SoftBody_SetVolumeFactor()

R3Status r3SoftBody_SetVolumeFactor ( struct R3SoftBodyHandle handle,
R3Real value )

Set the soft body target volume multiplier.

◆ r3SoftBody_Solver()

uint32_t r3SoftBody_Solver ( struct R3SoftBodyHandle handle)

Return the solver simulating the soft body's elasticity (R3_SOFT_SOLVER_*).

Always R3_SOFT_SOLVER_CONSTRAINTS in a library built without FEM.

◆ r3SoftBody_Tear()

struct R3SoftBodyTearEvent * r3SoftBody_Tear ( struct R3SoftBodyHandle handle,
const uint32_t * edges,
size_t edge_count,
const uint32_t * cells,
size_t cell_count )

Tear the selected edges and return an owned remapping event.

Release it with r3FreeSoftBodyTearEvent.

◆ r3SoftBody_TearCell()

R3Status r3SoftBody_TearCell ( struct R3SoftBodyHandle handle,
size_t index )

Mark the indexed cell as torn.

The tear is applied at the end of the next step and reported by a tear event: no cell is removed, one of its particles splits along the plane perpendicular to the cell's principal rest stretch.

◆ r3SoftBody_TearEdge()

R3Status r3SoftBody_TearEdge ( struct R3SoftBodyHandle handle,
size_t index )

Mark the indexed edge as torn.

The tear is applied at the end of the next step and reported by a tear event; use r3SoftBody_Tear to tear immediately.

◆ r3SoftBody_TopologyVersion()

uint32_t r3SoftBody_TopologyVersion ( struct R3SoftBodyHandle handle)

Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches.

◆ r3SoftBody_ValidateHandle()

R3Status r3SoftBody_ValidateHandle ( struct R3SoftBodyHandle handle)

Validate the index and generation in the live owning world.

Cannot detect a world pointer that has already been freed.

◆ r3SoftBody_Volume()

R3Real r3SoftBody_Volume ( struct R3SoftBodyHandle handle)

Return the soft body current volume.

◆ r3SoftBody_VolumeFactor()

R3Real r3SoftBody_VolumeFactor ( struct R3SoftBodyHandle handle)

Return the soft body target volume multiplier.

◆ r3SoftBody_WakeUp()

R3Status r3SoftBody_WakeUp ( struct R3SoftBodyHandle handle)

Wake the soft body and its rigid proxies.

◆ r3SoftBodyCount()

size_t r3SoftBodyCount ( const struct R3World * world)

Return the number of soft body objects in the world.

◆ r3SoftBodyDesc_CellIndices()

size_t r3SoftBodyDesc_CellIndices ( const struct R3SoftBodyDesc * desc,
uint32_t * buffer,
size_t capacity )

Copies generated cell indices into caller-owned storage.

Counts scalar indices.

See also
Arrays and output buffers

◆ r3SoftBodyDesc_ParticlePositions()

size_t r3SoftBodyDesc_ParticlePositions ( const struct R3SoftBodyDesc * desc,
struct R3Vector * buffer,
size_t capacity )

Copies generated particle positions into caller-owned storage; no persistent builder.

See also
Arrays and output buffers

◆ r3SoftBodyDesc_SetAddedEdges()

R3Status r3SoftBodyDesc_SetAddedEdges ( struct R3SoftBodyDesc * desc,
struct R3EdgeView view )

Borrow structural edges added after appending (see R3SoftBodyDesc::addedEdges); preserve all other fields.

No allocation or element reads. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetAppended()

R3Status r3SoftBodyDesc_SetAppended ( struct R3SoftBodyDesc * desc,
struct R3SoftBodyDescView view )

Borrow descriptions to merge into this body (see R3SoftBodyDesc::appended); preserve all other fields.

No allocation or element reads. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetBendEdges()

R3Status r3SoftBodyDesc_SetBendEdges ( struct R3SoftBodyDesc * desc,
struct R3EdgeView view )

Borrow bend edges; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetCells()

R3Status r3SoftBodyDesc_SetCells ( struct R3SoftBodyDesc * desc,
R3CellView view )

Borrow cells; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetDihedrals()

R3Status r3SoftBodyDesc_SetDihedrals ( struct R3SoftBodyDesc * desc,
struct R3DihedralView view )

Borrow dihedrals; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetEdges()

R3Status r3SoftBodyDesc_SetEdges ( struct R3SoftBodyDesc * desc,
struct R3EdgeView view )

Borrow edges; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetMasses()

R3Status r3SoftBodyDesc_SetMasses ( struct R3SoftBodyDesc * desc,
struct R3RealView view )

Borrow masses; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetParticles()

R3Status r3SoftBodyDesc_SetParticles ( struct R3SoftBodyDesc * desc,
struct R3VectorView positions )

Select an explicit particle recipe and borrow its positions.

Other fields are preserved.

◆ r3SoftBodyDesc_SetPinnedParticles()

R3Status r3SoftBodyDesc_SetPinnedParticles ( struct R3SoftBodyDesc * desc,
struct R3IndexView view )

Borrow pinned particles; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetSkin()

R3Status r3SoftBodyDesc_SetSkin ( struct R3SoftBodyDesc * desc,
struct R3VectorView vertices,
R3SurfaceElementView elements )

Borrow skin geometry.

Other fields, including skinCollision, are preserved.

◆ r3SoftBodyDesc_SetSurface()

R3Status r3SoftBodyDesc_SetSurface ( struct R3SoftBodyDesc * desc,
R3SurfaceElementView view )

Borrow surface; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetSurfaceMesh()

R3Status r3SoftBodyDesc_SetSurfaceMesh ( struct R3SoftBodyDesc * desc,
struct R3VectorView vertices,
R3SurfaceElementView elements )

Select a surface recipe and borrow its vertices and elements.

Other fields are preserved.

◆ r3SoftBodyDesc_SetTensionOnlyEdges()

R3Status r3SoftBodyDesc_SetTensionOnlyEdges ( struct R3SoftBodyDesc * desc,
struct R3IndexView view )

Borrow tension only edges; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyDesc_SetWire()

R3Status r3SoftBodyDesc_SetWire ( struct R3SoftBodyDesc * desc,
struct R3EdgeView view )

Borrow wire; preserve all other fields.

No allocation or element reads. Zero counts retain the recipe's generated defaults at insertion, as with directly assigned views. Invalid view metadata leaves the description unchanged.

◆ r3SoftBodyHandles()

size_t r3SoftBodyHandles ( const struct R3World * world,
struct R3SoftBodyHandle * buffer,
size_t capacity )

Copy entity handles.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_Bodies()

size_t r3SoftBodyTearEvent_Bodies ( const struct R3SoftBodyTearEvent * event,
struct R3SoftBodyHandle * buffer,
size_t capacity )

Copy the soft bodies the torn body is in after the tear, the one keeping the handle first: the torn body alone when nothing was split off.

Entry i holds the particles given by r3SoftBodyTearEvent_PieceParticles(event, i, ...).

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_Clusters()

size_t r3SoftBodyTearEvent_Clusters ( const struct R3SoftBodyTearEvent * event,
struct R3SoftClusterSplit * buffer,
size_t capacity )

Copy cluster-to-piece and rigid-proxy remapping records.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_InsertedParticles()

size_t r3SoftBodyTearEvent_InsertedParticles ( const struct R3SoftBodyTearEvent * event,
uint32_t * buffer,
size_t capacity )

Flat indices; element arity follows the corresponding Rust event field.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_MovedJoints()

size_t r3SoftBodyTearEvent_MovedJoints ( const struct R3SoftBodyTearEvent * event,
struct R3SoftJointMove * buffer,
size_t capacity )

Copy impulse-joint remapping records produced by the tear.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_ParticleDestination()

struct R3ParticleDestination r3SoftBodyTearEvent_ParticleDestination ( const struct R3SoftBodyTearEvent * event,
uint32_t particle )

Return the destination body and particle index for an original particle.

◆ r3SoftBodyTearEvent_PieceCount()

size_t r3SoftBodyTearEvent_PieceCount ( const struct R3SoftBodyTearEvent * event)

Return the number of soft bodies the torn body is in after the tear: the length of r3SoftBodyTearEvent_Bodies, and the exclusive bound of the piece_index of r3SoftBodyTearEvent_PieceParticles.

It is 1 when nothing was split off.

◆ r3SoftBodyTearEvent_PieceParticles()

size_t r3SoftBodyTearEvent_PieceParticles ( const struct R3SoftBodyTearEvent * event,
size_t piece_index,
uint32_t * buffer,
size_t capacity )

Copy the particles of the piece_index-th body of r3SoftBodyTearEvent_Bodies, as indices in the torn body after the tear (the indices the other event fields use); entry i is the piece's particle i.

piece_index must be less than r3SoftBodyTearEvent_PieceCount.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_RemovedEdges()

size_t r3SoftBodyTearEvent_RemovedEdges ( const struct R3SoftBodyTearEvent * event,
uint32_t * buffer,
size_t capacity )

Flat indices; element arity follows the corresponding Rust event field.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_SoftBody()

struct R3SoftBodyHandle r3SoftBodyTearEvent_SoftBody ( const struct R3SoftBodyTearEvent * event)

Return the source soft-body handle for this tear event.

◆ r3SoftBodyTearEvent_SplitParticles()

size_t r3SoftBodyTearEvent_SplitParticles ( const struct R3SoftBodyTearEvent * event,
uint32_t * buffer,
size_t capacity )

Flat indices; element arity follows the corresponding Rust event field.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_TornCells()

size_t r3SoftBodyTearEvent_TornCells ( const struct R3SoftBodyTearEvent * event,
uint32_t * buffer,
size_t capacity )

Flat indices; element arity follows the corresponding Rust event field.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_TornEdges()

size_t r3SoftBodyTearEvent_TornEdges ( const struct R3SoftBodyTearEvent * event,
uint32_t * buffer,
size_t capacity )

Flat indices; element arity follows the corresponding Rust event field.

See also
Arrays and output buffers

◆ r3SoftBodyTearEvent_TryParticleDestination()

struct R3OptionalParticleDestination r3SoftBodyTearEvent_TryParticleDestination ( const struct R3SoftBodyTearEvent * event,
uint32_t particle )

Optional particle destination after a tear.

Missing destinations are normal and set found to false; body/index are only written when a destination exists.

◆ r3SphereSoftBodyDesc()

struct R3SoftBodyDesc r3SphereSoftBodyDesc ( struct R3Vector center,
R3Real radius,
uint32_t subdivisions )

Return a hollow icosphere recipe with the specified refinement levels and volume preservation.

Initializes a recipe without allocating. Geometry is validated during preview/insertion.

◆ r3UniformSoftBodyMaterial()

struct R3SoftBodyMaterial r3UniformSoftBodyMaterial ( struct R3SpringCoefficients value)

Returns a material with the same softness for each constraint family.

◆ r3VolumetricSoftBodyDesc()

struct R3SoftBodyDesc r3VolumetricSoftBodyDesc ( struct R3VectorView vertices,
R3SurfaceElementView surface,
struct R3VolumeMeshParameters parameters )

Initializes a borrowed meshing recipe.

Mesh generation happens on preview/insertion.