|
Rapier C — 2D / f32 0.36.0+c.0
|
Particle recipes, materials, clusters, deformable meshes, and tearing. More...
Data Structures | |
| struct | R2SoftBodyMaterial |
| Plain configuration data; initialize defaults, edit, then apply. More... | |
| struct | R2SoftRecoverySettings |
| Plain configuration data; initialize defaults, edit, then apply. More... | |
| struct | R2SoftFemParameters |
| Plain configuration data; initialize defaults, edit, then apply. More... | |
| struct | R2SoftBodiesSettings |
| Plain configuration data; initialize defaults, edit, then apply. More... | |
| struct | R2SoftEdgeSoftness |
| Spring-coefficient override for one soft-body edge. More... | |
| struct | R2SoftEdgeSoftnessView |
| Borrowed elements; count counts elements. More... | |
| struct | R2SoftEdgeTear |
| Tear-resistance override for one soft-body edge. More... | |
| struct | R2SoftEdgeTearView |
| Borrowed elements; count counts elements. More... | |
| struct | R2SoftBodyDescView |
| Borrowed array of soft-body descriptions. More... | |
| struct | R2SoftBodyDesc |
| Copyable recipe, not an owned procedural builder. More... | |
| struct | R2SoftBodyHandle |
| Copyable non-owning handle: world pointer plus entity index and generation. More... | |
| struct | R2SoftMeshBindingDesc |
| Non-owning deformable binding description. More... | |
| struct | R2SoftClusterSplit |
| Cluster and proxy remapping after a soft-body split. More... | |
| struct | R2SoftJointMove |
| Impulse-joint movement between rigid proxies after tearing. More... | |
| struct | R2SoftMeshId |
| Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId. More... | |
| struct | R2SoftMeshInfo |
| Mesh identity and rendering metadata. More... | |
Macros | |
| #define | R2_SOFT_DESC_PARTICLES 0 |
| Soft-body selector: desc particles. | |
| #define | R2_SOFT_DESC_ROPE 1 |
| Soft-body selector: desc rope. | |
| #define | R2_SOFT_DESC_GRID 2 |
| Soft-body selector: desc grid. | |
| #define | R2_SOFT_DESC_CLOTH 3 |
| Soft-body selector: desc cloth. | |
| #define | R2_SOFT_DESC_CUBOID 4 |
| Soft-body selector: desc cuboid. | |
| #define | R2_SOFT_DESC_SURFACE 5 |
| Soft-body selector: desc surface. | |
| #define | R2_SOFT_DESC_DISK 6 |
| Soft-body selector: desc disk. | |
| #define | R2_SOFT_DESC_SPHERE 7 |
| Soft-body selector: desc sphere. | |
| #define | R2_SOFT_DESC_CLOTH_TUBE 8 |
| Soft-body selector: desc cloth tube. | |
| #define | R2_SOFT_DESC_VOLUMETRIC 9 |
| Soft-body selector: desc volumetric. | |
| #define | R2_SOFT_DESC_POLYGON 10 |
| Soft-body selector: closed counter-clockwise polygon of particles preserving its area (2D). | |
| #define | R2_SOFT_DESC_TRIMESH 11 |
| Soft-body selector: triangle mesh without cells, held by shape matching (2D). | |
| #define | R2_SOFT_BINDING_SKINNED 0 |
| Soft-body selector: binding skinned. | |
| #define | R2_SOFT_BINDING_DIRECT 1 |
| Soft-body selector: binding direct. | |
| #define | R2_SOFT_BINDING_DIRECT_BY_POSITION 2 |
| Soft-body selector: binding direct by position. | |
| #define | R2_SOFT_CELL_VOLUME 0 |
| Cell model that constrains volume without elastic shear response. | |
| #define | R2_SOFT_CELL_COROTATIONAL 1 |
| Corotational elastic cell model. | |
| #define | R2_SOFT_CELL_NEO_HOOKEAN 2 |
| Neo-Hookean elastic cell model. | |
| #define | R2_SOFT_SOLVER_CONSTRAINTS 0 |
| Use the constraint-based soft-body solver. | |
| #define | R2_SOFT_SOLVER_FEM 1 |
| Use the finite-element solver; requires RAPIER_FEM. | |
| #define | R2_SOFT_EDGE_PLASTIC_FLOW_BOTH 0 |
| Edge plastic flow (R2SoftBodyMaterial::edgePlasticFlow): both a squeeze and a stretch set. | |
| #define | R2_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1 |
| Edge plastic flow: only a squeeze sets; a stretched edge springs back. | |
| #define | R2_SOFT_EDGE_PLASTIC_FLOW_TENSION 2 |
| Edge plastic flow: only a stretch sets; a squeezed edge springs back. | |
| #define | R2_SOFT_PATCH_CONSTRAINTS_KEEP 0 |
| Overlap patch constraints (R2SoftRecoverySettings::overlapPatchConstraints): keep them. | |
| #define | R2_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1 |
| Overlap patch constraints: stand them down inside the patch. | |
| #define | R2_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2 |
| Overlap patch constraints: align them with the overlap normal. | |
| #define | R2_SOFT_FRAME 4 |
| Read-only body type of soft-body cluster proxies; cannot be used to construct a rigid body. | |
Typedefs | |
| typedef struct R2SoftBodyMaterial | R2SoftBodyMaterial |
| Plain configuration data; initialize defaults, edit, then apply. | |
| typedef struct R2SoftRecoverySettings | R2SoftRecoverySettings |
| Plain configuration data; initialize defaults, edit, then apply. | |
| typedef struct R2SoftFemParameters | R2SoftFemParameters |
| Plain configuration data; initialize defaults, edit, then apply. | |
| typedef struct R2SoftBodiesSettings | R2SoftBodiesSettings |
| Plain configuration data; initialize defaults, edit, then apply. | |
| typedef struct R2SoftEdgeSoftness | R2SoftEdgeSoftness |
| Spring-coefficient override for one soft-body edge. | |
| typedef struct R2SoftEdgeSoftnessView | R2SoftEdgeSoftnessView |
| Borrowed elements; count counts elements. | |
| typedef struct R2SoftEdgeTear | R2SoftEdgeTear |
| Tear-resistance override for one soft-body edge. | |
| typedef struct R2SoftEdgeTearView | R2SoftEdgeTearView |
| Borrowed elements; count counts elements. | |
| typedef struct R2SoftBodyDescView | R2SoftBodyDescView |
| Borrowed array of soft-body descriptions. | |
| typedef struct R2SoftBodyDesc | R2SoftBodyDesc |
| Copyable recipe, not an owned procedural builder. | |
| typedef struct R2SoftBodyHandle | R2SoftBodyHandle |
| Copyable non-owning handle: world pointer plus entity index and generation. | |
| typedef struct R2SoftMeshBindingDesc | R2SoftMeshBindingDesc |
| Non-owning deformable binding description. | |
| typedef struct R2SoftClusterSplit | R2SoftClusterSplit |
| Cluster and proxy remapping after a soft-body split. | |
| typedef struct R2SoftJointMove | R2SoftJointMove |
| Impulse-joint movement between rigid proxies after tearing. | |
| typedef struct R2SoftMeshId | R2SoftMeshId |
| Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId. | |
| typedef struct R2SoftMeshInfo | R2SoftMeshInfo |
| Mesh identity and rendering metadata. | |
Functions | |
| struct R2SoftBodyMaterial | r2DefaultSoftBodyMaterial (void) |
| Return native default soft body material. | |
| struct R2SoftRecoverySettings | r2DefaultSoftRecoverySettings (void) |
| Return native default soft recovery settings. | |
| struct R2SoftFemParameters | r2DefaultSoftFemParameters (void) |
| Return native default soft fem parameters. | |
| struct R2SoftBodiesSettings | r2DefaultSoftBodiesSettings (void) |
| Return native default soft bodies settings. | |
| struct R2SoftBodyDesc | r2DefaultSoftBodyDesc (void) |
| Return native default soft body desc. | |
| struct R2SoftBodyHandle | r2InsertSoftBody (struct R2World *world, const struct R2SoftBodyDesc *desc) |
| Consumes no caller-owned resources. | |
| struct R2SoftMeshBindingDesc | r2DefaultSoftMeshBindingDesc (void) |
| Return native default soft mesh binding desc. | |
| size_t | r2SoftBodyCount (const struct R2World *world) |
| Return the number of soft body objects in the world. | |
| size_t | r2SoftBodyHandles (const struct R2World *world, struct R2SoftBodyHandle *buffer, size_t capacity) |
| Copy entity handles. | |
| R2Bool | r2SoftBody_Contains (struct R2SoftBodyHandle handle) |
| Test whether the live world contains this soft body handle. | |
| R2Status | r2SoftBodiesSetResweepStrain (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftBodiesSettings::resweepStrain. | |
| R2Real | r2SoftBodiesResweepStrain (const struct R2World *world) |
| Return the world setting documented by R2SoftBodiesSettings::resweepStrain. | |
| R2Status | r2SoftBodiesSetContactStiffening (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftBodiesSettings::contactStiffening. | |
| R2Real | r2SoftBodiesContactStiffening (const struct R2World *world) |
| Return the world setting documented by R2SoftBodiesSettings::contactStiffening. | |
| R2Status | r2SoftBodiesSetMaxExtraSubsteps (struct R2World *world, size_t value) |
| Set the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps. | |
| size_t | r2SoftBodiesMaxExtraSubsteps (const struct R2World *world) |
| Return the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps. | |
| R2Status | r2RecoverySetAuthoredVelocityMargin (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin. | |
| R2Status | r2RecoverySetEdgeSpeculation (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::edgeSpeculation. | |
| R2Status | r2RecoverySetInvertedCellDetection (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::invertedCellDetection. | |
| R2Status | r2RecoverySetSelfCrossingDetection (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::selfCrossingDetection. | |
| R2Status | r2RecoverySetDetectionMotionGating (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::detectionMotionGating. | |
| R2Status | r2RecoverySetCrossBodyDetection (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::crossBodyDetection. | |
| R2Status | r2RecoverySetSelfStandDown (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::selfStandDown. | |
| R2Status | r2RecoverySetCrossBodyExpelGate (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate. | |
| R2Status | r2RecoverySetEdgeStandDown (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::edgeStandDown. | |
| R2Status | r2RecoverySetCrossingRepulsion (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::crossingRepulsion. | |
| R2Status | r2RecoverySetCrossingRepulsionGuide (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide. | |
| R2Status | r2RecoverySetCrossingRepulsionSelfGuide (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide. | |
| R2Status | r2RecoverySetRecoveryPace (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftRecoverySettings::recoveryPace. | |
| R2Status | r2RecoverySetOverlapConstraints (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapConstraints. | |
| R2Status | r2RecoverySetOverlapRigid (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapRigid. | |
| R2Status | r2RecoverySetOverlapSkipSelfTangled (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled. | |
| R2Status | r2RecoverySetOverlapEdgeStandDown (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown. | |
| R2Status | r2RecoverySetOverlapConstraintPace (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapConstraintPace. | |
| R2Status | r2RecoverySetOverlapSkinVolume (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapSkinVolume. | |
| R2Status | r2RecoverySetOverlapKeptDepth (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapKeptDepth. | |
| R2Status | r2RecoverySetOverlapSelfRegions (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapSelfRegions. | |
| R2Status | r2RecoverySetOverlapNormalPush (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapNormalPush. | |
| R2Status | r2RecoverySetOverlapMultiVolume (struct R2World *world, R2Bool value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapMultiVolume. | |
| R2Status | r2RecoverySetOverlapProgressMargin (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapProgressMargin. | |
| R2Status | r2FemSetLinearTolerance (struct R2World *world, R2Real value) |
| Set the world setting documented by R2SoftFemParameters::linearTolerance. | |
| R2Status | r2FemSetMaxLinearIterations (struct R2World *world, size_t value) |
| Set the world setting documented by R2SoftFemParameters::maxLinearIterations. | |
| R2Status | r2FemSetMaxDenseDofs (struct R2World *world, size_t value) |
| Set the world setting documented by R2SoftFemParameters::maxDenseDofs. | |
| R2Status | r2RemoveSoftBody (struct R2SoftBodyHandle handle) |
| Remove a soft body and its associated simulation objects. | |
| R2Status | r2SoftBody_WakeUp (struct R2SoftBodyHandle handle) |
| Wake the soft body and its rigid proxies. | |
| R2Status | r2FreeSoftBodyTearEvent (struct R2SoftBodyTearEvent *event) |
| Release an owned soft body tear event. | |
| struct R2SoftBodyHandle | r2SoftBodyTearEvent_SoftBody (const struct R2SoftBodyTearEvent *event) |
| Return the source soft-body handle for this tear event. | |
| size_t | r2SoftBodyTearEvent_Bodies (const struct R2SoftBodyTearEvent *event, struct R2SoftBodyHandle *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 R2ParticleDestination | r2SoftBodyTearEvent_ParticleDestination (const struct R2SoftBodyTearEvent *event, uint32_t particle) |
| Return the destination body and particle index for an original particle. | |
| size_t | r2SoftBodyTearEvent_TornEdges (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity) |
| Flat indices; element arity follows the corresponding Rust event field. | |
| size_t | r2SoftBodyTearEvent_TornCells (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity) |
| Flat indices; element arity follows the corresponding Rust event field. | |
| size_t | r2SoftBodyTearEvent_RemovedEdges (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity) |
| Flat indices; element arity follows the corresponding Rust event field. | |
| size_t | r2SoftBodyTearEvent_SplitParticles (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity) |
| Flat indices; element arity follows the corresponding Rust event field. | |
| size_t | r2SoftBodyTearEvent_InsertedParticles (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity) |
| Flat indices; element arity follows the corresponding Rust event field. | |
| size_t | r2SoftBodyTearEvent_PieceParticles (const struct R2SoftBodyTearEvent *event, size_t piece_index, uint32_t *buffer, size_t capacity) |
| Copy the particles of the piece_index-th body of r2SoftBodyTearEvent_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 | r2SoftBodyTearEvent_Clusters (const struct R2SoftBodyTearEvent *event, struct R2SoftClusterSplit *buffer, size_t capacity) |
| Copy cluster-to-piece and rigid-proxy remapping records. | |
| size_t | r2SoftBodyTearEvent_MovedJoints (const struct R2SoftBodyTearEvent *event, struct R2SoftJointMove *buffer, size_t capacity) |
| Copy impulse-joint remapping records produced by the tear. | |
| struct R2SoftBodyTearEvent * | r2SoftBody_Tear (struct R2SoftBodyHandle 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 | r2SoftBody_AddCluster (struct R2SoftBodyHandle handle, const uint32_t *particles, size_t count) |
| Create a rigid proxy cluster from the supplied particle indices and return its cluster index. | |
| R2Status | r2SoftBody_RemoveCluster (struct R2SoftBodyHandle handle, uint32_t cluster) |
| Remove the selected cluster and its rigid proxy. | |
| struct R2OptionalParticleDestination | r2SoftBodyTearEvent_TryParticleDestination (const struct R2SoftBodyTearEvent *event, uint32_t particle) |
| Optional particle destination after a tear. | |
| struct R2SoftBodyTearEvent * | r2CutSoftBody (struct R2SoftBodyHandle handle, const struct R2Vector *blade) |
| Cut using DIM points (a segment in 2D, triangle in 3D). | |
| struct R2Vector | r2SoftBody_ParticlePosition (struct R2SoftBodyHandle handle, size_t index) |
| Return the world-space position of the indexed particle. | |
| size_t | r2SoftBody_ParticlePositions (struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity) |
| Copy world-space particle positions. | |
| struct R2SoftBodyMaterial | r2SoftBody_Material (struct R2SoftBodyHandle handle) |
| Return a copy of the soft body material parameters. | |
| R2Status | r2SoftBody_SetParticlePosition (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value) |
| Set the world-space position of the indexed particle. | |
| R2Status | r2SoftBody_SetMaterial (struct R2SoftBodyHandle handle, const struct R2SoftBodyMaterial *data) |
| Copy material parameters into the soft body. | |
| R2Status | r2SoftBody_AddParticleForce (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value, R2Bool wake_up) |
| Add a world-space force to the indexed particle. | |
| R2Status | r2SoftBodyDesc_SetParticles (struct R2SoftBodyDesc *desc, struct R2VectorView positions) |
| Select an explicit particle recipe and borrow its positions. | |
| R2Status | r2SoftBodyDesc_SetSurfaceMesh (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements) |
| Select a surface recipe and borrow its vertices and elements. | |
| R2Status | r2SoftBodyDesc_SetTrimesh (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, struct R2TriangleView triangles) |
| Select a 2D triangle-mesh recipe and borrow its vertices and triangles (stored in positions and cells). | |
| R2Status | r2SoftBodyDesc_SetAppended (struct R2SoftBodyDesc *desc, struct R2SoftBodyDescView view) |
| Borrow descriptions to merge into this body (see R2SoftBodyDesc::appended); preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetAddedEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view) |
| Borrow structural edges added after appending (see R2SoftBodyDesc::addedEdges); preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetSkin (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements) |
| Borrow skin geometry. | |
| R2Status | r2SoftBodyDesc_SetMasses (struct R2SoftBodyDesc *desc, struct R2RealView view) |
| Borrow masses; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetPinnedParticles (struct R2SoftBodyDesc *desc, struct R2IndexView view) |
| Borrow pinned particles; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view) |
| Borrow edges; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetBendEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view) |
| Borrow bend edges; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetCells (struct R2SoftBodyDesc *desc, R2CellView view) |
| Borrow cells; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetSurface (struct R2SoftBodyDesc *desc, R2SurfaceElementView view) |
| Borrow surface; preserve all other fields. | |
| R2Status | r2SoftBodyDesc_SetTensionOnlyEdges (struct R2SoftBodyDesc *desc, struct R2IndexView view) |
| Borrow tension only edges; preserve all other fields. | |
| struct R2SoftBodyDesc | r2RopeSoftBodyDesc (struct R2Vector a, struct R2Vector b, size_t particles) |
| Return a rope recipe with particles evenly spaced from a to b, including both endpoints. | |
| struct R2SoftBodyDesc | r2GridSoftBodyDesc (struct R2Vector center, struct R2Vector half_extents, size_t nx, size_t ny) |
| Return a solid rectangle recipe on an nx by ny particle grid. | |
| struct R2SoftBodyDesc | r2PolygonSoftBodyDesc (struct R2VectorView points) |
| Return a closed polygon recipe from at least 3 counter-clockwise points: structural edges along the boundary, bending edges between second neighbors, and area preservation. | |
| struct R2SoftBodyDesc | r2DiskSoftBodyDesc (struct R2Vector center, R2Real radius, size_t particles) |
| Return a closed regular polygon recipe with the specified boundary particle count and area preservation. | |
| struct R2SoftBodyDesc | r2VolumetricSoftBodyDesc (struct R2VectorView vertices, R2SurfaceElementView surface, struct R2VolumeMeshParameters parameters) |
| Initializes a borrowed meshing recipe. | |
| struct R2SoftBodyMaterial | r2UniformSoftBodyMaterial (struct R2SpringCoefficients value) |
| Returns a material with the same softness for each constraint family. | |
| size_t | r2SoftBodyDesc_ParticlePositions (const struct R2SoftBodyDesc *desc, struct R2Vector *buffer, size_t capacity) |
| Copies generated particle positions into caller-owned storage; no persistent builder. | |
| size_t | r2SoftBodyDesc_CellIndices (const struct R2SoftBodyDesc *desc, uint32_t *buffer, size_t capacity) |
| Copies generated cell indices into caller-owned storage. | |
| struct R2Vector | r2SoftBody_ParticleVelocity (struct R2SoftBodyHandle handle, size_t index) |
| Return the world-space velocity of the indexed particle. | |
| uint32_t | r2SoftBody_Solver (struct R2SoftBodyHandle handle) |
| Return the solver simulating the soft body's elasticity (R2_SOFT_SOLVER_*). | |
| R2Status | r2SoftBody_SetClusterEdgeSoftness (struct R2SoftBodyHandle handle, uint32_t cluster, const struct R2SpringCoefficients *softness) |
| Override the softness of every structural or bending edge fully contained in a live cluster: regional stiffness for cloth and ropes. | |
| R2Status | r2SoftBody_ApplyImpulseAtPoint (struct R2SoftBodyHandle handle, struct R2Vector impulse, struct R2Vector point, R2Real falloff_radius, R2Bool 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. | |
| R2Status | r2SoftBody_ApplyRadialImpulse (struct R2SoftBodyHandle handle, struct R2Vector center, R2Real magnitude, R2Real falloff_radius, R2Bool 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. | |
| R2Status | r2SoftBody_ResetPlasticity (struct R2SoftBodyHandle handle) |
| Undo every permanent (plastic) deformation: edge rest lengths, dihedral rest angles, cell rest shapes and particle rest positions return to their creation state. | |
| R2Status | r2SoftBody_TearEdge (struct R2SoftBodyHandle handle, size_t index) |
| Mark the indexed edge as torn. | |
| R2Status | r2SoftBody_TearCell (struct R2SoftBodyHandle handle, size_t index) |
| Mark the indexed cell as torn. | |
| size_t | r2SoftBodyTearEvent_PieceCount (const struct R2SoftBodyTearEvent *event) |
| Return the number of soft bodies the torn body is in after the tear: the length of r2SoftBodyTearEvent_Bodies, and the exclusive bound of the piece_index of r2SoftBodyTearEvent_PieceParticles. | |
| R2Bool | r2RecoveryAuthoredVelocityMargin (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin. | |
| R2Bool | r2RecoveryEdgeSpeculation (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::edgeSpeculation. | |
| R2Bool | r2RecoveryInvertedCellDetection (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::invertedCellDetection. | |
| R2Bool | r2RecoverySelfCrossingDetection (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::selfCrossingDetection. | |
| R2Bool | r2RecoveryDetectionMotionGating (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::detectionMotionGating. | |
| R2Bool | r2RecoveryCrossBodyDetection (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::crossBodyDetection. | |
| R2Bool | r2RecoverySelfStandDown (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::selfStandDown. | |
| R2Bool | r2RecoveryCrossBodyExpelGate (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate. | |
| R2Bool | r2RecoveryEdgeStandDown (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::edgeStandDown. | |
| R2Bool | r2RecoveryCrossingRepulsion (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::crossingRepulsion. | |
| R2Bool | r2RecoveryCrossingRepulsionGuide (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide. | |
| R2Bool | r2RecoveryCrossingRepulsionSelfGuide (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide. | |
| R2Real | r2RecoveryRecoveryPace (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::recoveryPace. | |
| R2Bool | r2RecoveryOverlapConstraints (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapConstraints. | |
| R2Bool | r2RecoveryOverlapRigid (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapRigid. | |
| R2Bool | r2RecoveryOverlapSkipSelfTangled (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled. | |
| R2Bool | r2RecoveryOverlapEdgeStandDown (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown. | |
| R2Real | r2RecoveryOverlapConstraintPace (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapConstraintPace. | |
| uint32_t | r2RecoveryOverlapPatchConstraints (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints. | |
| R2Status | r2RecoverySetOverlapPatchConstraints (struct R2World *world, uint32_t value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints. | |
| R2Bool | r2RecoveryOverlapSkinVolume (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapSkinVolume. | |
| R2Real | r2RecoveryOverlapKeptDepth (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapKeptDepth. | |
| R2Bool | r2RecoveryOverlapSelfRegions (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapSelfRegions. | |
| R2Bool | r2RecoveryOverlapNormalPush (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapNormalPush. | |
| R2Bool | r2RecoveryOverlapMultiVolume (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapMultiVolume. | |
| uint32_t | r2RecoveryOverlapSplit (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapSplit. | |
| R2Status | r2RecoverySetOverlapSplit (struct R2World *world, uint32_t value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapSplit. | |
| uint32_t | r2RecoveryOverlapPatience (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapPatience. | |
| R2Status | r2RecoverySetOverlapPatience (struct R2World *world, uint32_t value) |
| Set the world setting documented by R2SoftRecoverySettings::overlapPatience. | |
| R2Real | r2RecoveryOverlapProgressMargin (const struct R2World *world) |
| Return the world setting documented by R2SoftRecoverySettings::overlapProgressMargin. | |
| R2Real | r2FemLinearTolerance (const struct R2World *world) |
| Return the world setting documented by R2SoftFemParameters::linearTolerance. | |
| size_t | r2FemMaxLinearIterations (const struct R2World *world) |
| Return the world setting documented by R2SoftFemParameters::maxLinearIterations. | |
| size_t | r2FemMaxDenseDofs (const struct R2World *world) |
| Return the world setting documented by R2SoftFemParameters::maxDenseDofs. | |
| size_t | r2SoftBody_NumParticles (struct R2SoftBodyHandle handle) |
| Return the soft body particle count. | |
| uint32_t | r2SoftBody_TopologyVersion (struct R2SoftBodyHandle handle) |
| Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches. | |
| R2Real | r2SoftBody_Mass (struct R2SoftBodyHandle handle) |
| Return the soft body mass. | |
| R2Real | r2SoftBody_Volume (struct R2SoftBodyHandle handle) |
| Return the soft body current volume. | |
| R2Real | r2SoftBody_RestVolume (struct R2SoftBodyHandle handle) |
| Return the soft body undeformed volume. | |
| R2Real | r2SoftBody_VolumeFactor (struct R2SoftBodyHandle handle) |
| Return the soft body target volume multiplier. | |
| struct R2Vector | r2SoftBody_CenterOfMass (struct R2SoftBodyHandle handle) |
| Return the soft body world-space center of mass. | |
| struct R2RigidBodyHandle | r2SoftBody_RootBody (struct R2SoftBodyHandle handle) |
| Return the soft body root rigid-proxy handle. | |
| R2Bool | r2SoftBody_IsEnabled (struct R2SoftBodyHandle handle) |
| Return whether the soft body is enabled. | |
| R2Bool | r2SoftBody_IsSleeping (struct R2SoftBodyHandle handle) |
| Return whether the soft body is sleeping. | |
| size_t | r2SoftBody_ParticleVelocities (struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity) |
| Copy world-space particle velocities. | |
| size_t | r2SoftBody_Edges (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity) |
| Copy flattened edge vertex indices. | |
| size_t | r2SoftBody_Cells (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity) |
| Copy flattened cell vertex indices. | |
| size_t | r2SoftBody_Boundary (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity) |
| Copy flattened boundary element indices. | |
| size_t | r2SoftBody_Pieces (struct R2SoftBodyHandle handle, struct R2SoftBodyHandle *buffer, size_t capacity) |
| Copy piece identifiers. | |
| R2Status | r2SoftBody_SetParticleVelocity (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value) |
| Set the soft body particle world-space velocity. | |
| R2Status | r2SoftBody_SetParticleKinematicTarget (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value) |
| Set the next world-space target position of a pinned particle. | |
| R2Status | r2SoftBody_SetParticlePinned (struct R2SoftBodyHandle handle, size_t index, R2Bool value) |
| Enable or disable pinning the particle for the soft body. | |
| R2Status | r2SoftBody_ApplyParticleImpulse (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value, R2Bool wake_up) |
| Apply a world-space impulse to one particle. | |
| R2Status | r2SoftBody_AddForce (struct R2SoftBodyHandle handle, struct R2Vector value, R2Bool wake_up) |
| Accumulate a world-space force; it persists until reset. | |
| R2Status | r2SoftBody_ApplyImpulse (struct R2SoftBodyHandle handle, struct R2Vector value, R2Bool 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). | |
| R2Status | r2SoftBody_ResetForces (struct R2SoftBodyHandle handle, R2Bool wake_up) |
| Clear accumulated user forces. | |
| R2Status | r2SoftBody_SetEnabled (struct R2SoftBodyHandle handle, R2Bool value) |
| Enable or disable the soft body. | |
| R2Status | r2SoftBody_SetVolumeFactor (struct R2SoftBodyHandle handle, R2Real value) |
| Set the soft body target volume multiplier. | |
| R2Status | r2SoftBody_AttachParticle (struct R2SoftBodyHandle handle, size_t index, struct R2RigidBodyHandle rigid_body) |
| Attach a particle to a rigid body by a two-way point-to-point constraint (unlike pinning). | |
| R2Bool | r2SoftBody_DetachParticle (struct R2SoftBodyHandle handle, size_t index) |
| Detach a particle from every rigid body it was attached to with r2SoftBody_AttachParticle. | |
| size_t | r2SoftBody_Clusters (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity) |
| Copy cluster indices. | |
| struct R2RigidBodyHandle | r2SoftBody_ClusterProxy (struct R2SoftBodyHandle handle, uint32_t cluster) |
| Return the rigid proxy for the selected cluster. | |
| size_t | r2SoftBody_ClusterParticles (struct R2SoftBodyHandle handle, uint32_t cluster, uint32_t *buffer, size_t capacity) |
| Copy particle indices for a cluster. | |
| R2Status | r2SoftBody_SetClusterPinned (struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value) |
| Enable or disable pinning the cluster for the soft body. | |
| R2Status | r2SoftBody_SetClusterKinematicTarget (struct R2SoftBodyHandle handle, uint32_t cluster, struct R2Pose value) |
| Set the next world-space target pose of a pinned cluster. | |
| R2Status | r2SoftBody_SetClusterShapeMatchingEnabled (struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value) |
| Enable or disable using cluster shape matching for the soft body. | |
| R2Status | r2SoftBody_SetClusterStiffnessScale (struct R2SoftBodyHandle handle, uint32_t cluster, R2Real value) |
| Scale the material stiffness (Young modulus) of every cell fully contained in a live cluster: regional materials without a separate body. | |
| R2Status | r2SoftBody_SetClusterTearResistance (struct R2SoftBodyHandle handle, uint32_t cluster, R2Real value) |
| Set the soft body cluster tear-resistance multiplier. | |
| size_t | r2SoftBody_Meshes (struct R2SoftBodyHandle handle, struct R2SoftMeshInfo *buffer, size_t capacity) |
| Copy collision mesh metadata. | |
| size_t | r2SoftBody_MeshVerticesById (struct R2SoftBodyHandle handle, struct R2SoftMeshId id, struct R2Vector *buffer, size_t capacity) |
| Copy world-space vertices for a mesh ID. | |
| size_t | r2SoftBody_MeshIndicesById (struct R2SoftBodyHandle handle, struct R2SoftMeshId id, uint32_t *buffer, size_t capacity) |
| Copy flattened indices for a mesh ID. | |
| size_t | r2SoftBody_MeshColliders (struct R2SoftBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity) |
| Copy collision mesh collider handles. | |
| size_t | r2SoftBody_MeshVertices (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, struct R2Vector *buffer, size_t capacity) |
| Copy world-space collision mesh vertices. | |
| size_t | r2SoftBody_MeshIndices (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, uint32_t *buffer, size_t capacity) |
| Copy flattened collision mesh indices. | |
| size_t | r2SoftBody_MeshArity (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider) |
| Return indices per collision-mesh element (2 for segments, 3 for triangles). | |
| uint32_t | r2SoftBody_MeshTopologyVersion (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider) |
| Return the selected collision mesh topology revision for cache invalidation. | |
| R2Status | r2SoftBody_SetSolver (struct R2SoftBodyHandle handle, uint32_t solver) |
| Set the soft body soft solver kind (R2_SOFT_SOLVER_*). | |
| R2Status | r2SoftBody_SetClusterShapeMatchingTarget (struct R2SoftBodyHandle handle, uint32_t cluster, const struct R2Pose *target) |
| Set the soft body cluster shape-matching target pose. | |
| R2Status | r2SoftBody_SetEdgeTearResistance (struct R2SoftBodyHandle handle, size_t index, R2Real resistance) |
| Set the soft body edge tear-resistance multiplier. | |
| R2Bool | r2SoftBody_MeshIsClosed (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider) |
| Return whether the selected collision mesh is closed. | |
| struct R2SoftBodyHandle | r2RigidBody_SoftBody (struct R2RigidBodyHandle handle) |
| Return the associated soft-body handle, or an invalid handle if this is not a soft proxy. | |
| R2Bool | r2RigidBody_IsSoftFrame (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is a soft-body proxy. | |
| R2Status | r2SoftBody_ValidateHandle (struct R2SoftBodyHandle handle) |
| Validate the index and generation in the live owning world. | |
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.
| #define R2_SOFT_BINDING_DIRECT 1 |
Soft-body selector: binding direct.
| #define R2_SOFT_BINDING_DIRECT_BY_POSITION 2 |
Soft-body selector: binding direct by position.
| #define R2_SOFT_BINDING_SKINNED 0 |
Soft-body selector: binding skinned.
| #define R2_SOFT_CELL_COROTATIONAL 1 |
Corotational elastic cell model.
| #define R2_SOFT_CELL_NEO_HOOKEAN 2 |
Neo-Hookean elastic cell model.
| #define R2_SOFT_CELL_VOLUME 0 |
Cell model that constrains volume without elastic shear response.
| #define R2_SOFT_DESC_CLOTH 3 |
Soft-body selector: desc cloth.
| #define R2_SOFT_DESC_CLOTH_TUBE 8 |
Soft-body selector: desc cloth tube.
| #define R2_SOFT_DESC_CUBOID 4 |
Soft-body selector: desc cuboid.
| #define R2_SOFT_DESC_DISK 6 |
Soft-body selector: desc disk.
| #define R2_SOFT_DESC_GRID 2 |
Soft-body selector: desc grid.
| #define R2_SOFT_DESC_PARTICLES 0 |
Soft-body selector: desc particles.
| #define R2_SOFT_DESC_POLYGON 10 |
Soft-body selector: closed counter-clockwise polygon of particles preserving its area (2D).
| #define R2_SOFT_DESC_ROPE 1 |
Soft-body selector: desc rope.
| #define R2_SOFT_DESC_SPHERE 7 |
Soft-body selector: desc sphere.
| #define R2_SOFT_DESC_SURFACE 5 |
Soft-body selector: desc surface.
| #define R2_SOFT_DESC_TRIMESH 11 |
Soft-body selector: triangle mesh without cells, held by shape matching (2D).
| #define R2_SOFT_DESC_VOLUMETRIC 9 |
Soft-body selector: desc volumetric.
| #define R2_SOFT_EDGE_PLASTIC_FLOW_BOTH 0 |
Edge plastic flow (R2SoftBodyMaterial::edgePlasticFlow): both a squeeze and a stretch set.
| #define R2_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1 |
Edge plastic flow: only a squeeze sets; a stretched edge springs back.
| #define R2_SOFT_EDGE_PLASTIC_FLOW_TENSION 2 |
Edge plastic flow: only a stretch sets; a squeezed edge springs back.
| #define R2_SOFT_FRAME 4 |
Read-only body type of soft-body cluster proxies; cannot be used to construct a rigid body.
| #define R2_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2 |
Overlap patch constraints: align them with the overlap normal.
| #define R2_SOFT_PATCH_CONSTRAINTS_KEEP 0 |
Overlap patch constraints (R2SoftRecoverySettings::overlapPatchConstraints): keep them.
| #define R2_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1 |
Overlap patch constraints: stand them down inside the patch.
| #define R2_SOFT_SOLVER_CONSTRAINTS 0 |
Use the constraint-based soft-body solver.
| #define R2_SOFT_SOLVER_FEM 1 |
Use the finite-element solver; requires RAPIER_FEM.
| typedef struct R2SoftBodiesSettings R2SoftBodiesSettings |
Plain configuration data; initialize defaults, edit, then apply.
No destructor.
| typedef struct R2SoftBodyDesc R2SoftBodyDesc |
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. R2_SOFT_DESC_POLYGON reads positions; R2_SOFT_DESC_TRIMESH reads positions and cells (its triangles become edges and a boundary, not cells).
| typedef struct R2SoftBodyDescView R2SoftBodyDescView |
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.
| typedef struct R2SoftBodyHandle R2SoftBodyHandle |
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.
| typedef struct R2SoftBodyMaterial R2SoftBodyMaterial |
Plain configuration data; initialize defaults, edit, then apply.
No destructor.
| typedef struct R2SoftClusterSplit R2SoftClusterSplit |
Cluster and proxy remapping after a soft-body split.
| typedef struct R2SoftEdgeSoftness R2SoftEdgeSoftness |
Spring-coefficient override for one soft-body edge.
| typedef struct R2SoftEdgeSoftnessView R2SoftEdgeSoftnessView |
Borrowed elements; count counts elements.
Data must remain live through insertion.
| typedef struct R2SoftEdgeTear R2SoftEdgeTear |
Tear-resistance override for one soft-body edge.
| typedef struct R2SoftEdgeTearView R2SoftEdgeTearView |
Borrowed elements; count counts elements.
Data must remain live through insertion.
| typedef struct R2SoftFemParameters R2SoftFemParameters |
Plain configuration data; initialize defaults, edit, then apply.
No destructor.
| typedef struct R2SoftJointMove R2SoftJointMove |
Impulse-joint movement between rigid proxies after tearing.
| typedef struct R2SoftMeshBindingDesc R2SoftMeshBindingDesc |
Non-owning deformable binding description.
Direct particle indices are borrowed.
| typedef struct R2SoftMeshId R2SoftMeshId |
Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId.
| typedef struct R2SoftMeshInfo R2SoftMeshInfo |
Mesh identity and rendering metadata.
A render-only mesh has an invalid collider handle.
| typedef struct R2SoftRecoverySettings R2SoftRecoverySettings |
Plain configuration data; initialize defaults, edit, then apply.
No destructor.
| struct R2SoftBodyTearEvent * r2CutSoftBody | ( | struct R2SoftBodyHandle | handle, |
| const struct R2Vector * | 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.
| struct R2SoftBodiesSettings r2DefaultSoftBodiesSettings | ( | void | ) |
Return native default soft bodies settings.
This POD value owns no resources.
| struct R2SoftBodyDesc r2DefaultSoftBodyDesc | ( | void | ) |
Return native default soft body desc.
This POD value owns no resources.
| struct R2SoftBodyMaterial r2DefaultSoftBodyMaterial | ( | void | ) |
Return native default soft body material.
This POD value owns no resources.
| struct R2SoftFemParameters r2DefaultSoftFemParameters | ( | void | ) |
Return native default soft fem parameters.
This POD value owns no resources.
| struct R2SoftMeshBindingDesc r2DefaultSoftMeshBindingDesc | ( | void | ) |
Return native default soft mesh binding desc.
This POD value owns no resources.
| struct R2SoftRecoverySettings r2DefaultSoftRecoverySettings | ( | void | ) |
Return native default soft recovery settings.
This POD value owns no resources.
| struct R2SoftBodyDesc r2DiskSoftBodyDesc | ( | struct R2Vector | center, |
| R2Real | radius, | ||
| size_t | particles ) |
Return a closed regular polygon recipe with the specified boundary particle count and area preservation.
Initializes a recipe without allocating. Geometry is validated during preview/insertion.
Return the world setting documented by R2SoftFemParameters::linearTolerance.
| size_t r2FemMaxDenseDofs | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftFemParameters::maxDenseDofs.
| size_t r2FemMaxLinearIterations | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftFemParameters::maxLinearIterations.
Set the world setting documented by R2SoftFemParameters::linearTolerance.
Set the world setting documented by R2SoftFemParameters::maxDenseDofs.
Set the world setting documented by R2SoftFemParameters::maxLinearIterations.
| R2Status r2FreeSoftBodyTearEvent | ( | struct R2SoftBodyTearEvent * | event | ) |
Release an owned soft body tear event.
NULL is allowed. Do not pass borrowed pointers or free the object twice.
| struct R2SoftBodyDesc r2GridSoftBodyDesc | ( | struct R2Vector | center, |
| struct R2Vector | half_extents, | ||
| size_t | nx, | ||
| size_t | ny ) |
Return a solid rectangle recipe on an nx by ny particle grid.
Initializes a recipe without allocating. Geometry is validated during preview/insertion.
| struct R2SoftBodyHandle r2InsertSoftBody | ( | struct R2World * | world, |
| const struct R2SoftBodyDesc * | desc ) |
Consumes no caller-owned resources.
All borrowed arrays may be released on return.
| struct R2SoftBodyDesc r2PolygonSoftBodyDesc | ( | struct R2VectorView | points | ) |
Return a closed polygon recipe from at least 3 counter-clockwise points: structural edges along the boundary, bending edges between second neighbors, and area preservation.
The points are borrowed until preview/insertion. Initializes a recipe without allocating. Geometry is validated during preview/insertion.
Return the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
Return the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
Return the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
Return the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
Return the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
Return the world setting documented by R2SoftRecoverySettings::edgeStandDown.
Return the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
Return the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
Return the world setting documented by R2SoftRecoverySettings::overlapConstraints.
Return the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
Return the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
Return the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
Return the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
| uint32_t r2RecoveryOverlapPatchConstraints | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
| uint32_t r2RecoveryOverlapPatience | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftRecoverySettings::overlapPatience.
Return the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
Return the world setting documented by R2SoftRecoverySettings::overlapRigid.
Return the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
Return the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
Return the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
| uint32_t r2RecoveryOverlapSplit | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftRecoverySettings::overlapSplit.
Return the world setting documented by R2SoftRecoverySettings::recoveryPace.
Return the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
Return the world setting documented by R2SoftRecoverySettings::selfStandDown.
Set the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
Set the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
Set the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
Set the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
Set the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
Set the world setting documented by R2SoftRecoverySettings::edgeStandDown.
Set the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
Set the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
Set the world setting documented by R2SoftRecoverySettings::overlapConstraints.
Set the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
Set the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
Set the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
Set the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
Set the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
Set the world setting documented by R2SoftRecoverySettings::overlapPatience.
Set the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
Set the world setting documented by R2SoftRecoverySettings::overlapRigid.
Set the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
Set the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
Set the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
Set the world setting documented by R2SoftRecoverySettings::overlapSplit.
Set the world setting documented by R2SoftRecoverySettings::recoveryPace.
Set the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
Set the world setting documented by R2SoftRecoverySettings::selfStandDown.
| R2Status r2RemoveSoftBody | ( | struct R2SoftBodyHandle | handle | ) |
Remove a soft body and its associated simulation objects.
Invalidates its handle.
| R2Bool r2RigidBody_IsSoftFrame | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is a soft-body proxy.
| struct R2SoftBodyHandle r2RigidBody_SoftBody | ( | struct R2RigidBodyHandle | handle | ) |
Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
| struct R2SoftBodyDesc r2RopeSoftBodyDesc | ( | struct R2Vector | a, |
| struct R2Vector | 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.
Return the world setting documented by R2SoftBodiesSettings::contactStiffening.
| size_t r2SoftBodiesMaxExtraSubsteps | ( | const struct R2World * | world | ) |
Return the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
Return the world setting documented by R2SoftBodiesSettings::resweepStrain.
Set the world setting documented by R2SoftBodiesSettings::contactStiffening.
Set the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
Set the world setting documented by R2SoftBodiesSettings::resweepStrain.
| uint32_t r2SoftBody_AddCluster | ( | struct R2SoftBodyHandle | handle, |
| const uint32_t * | particles, | ||
| size_t | count ) |
Create a rigid proxy cluster from the supplied particle indices and return its cluster index.
| R2Status r2SoftBody_AddForce | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Accumulate a world-space force; it persists until reset.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2SoftBody_AddParticleForce | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Add a world-space force to the indexed particle.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2SoftBody_ApplyImpulse | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | 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.
| R2Status r2SoftBody_ApplyImpulseAtPoint | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector | impulse, | ||
| struct R2Vector | point, | ||
| R2Real | falloff_radius, | ||
| R2Bool | 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.
| R2Status r2SoftBody_ApplyParticleImpulse | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Apply a world-space impulse to one particle.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2SoftBody_ApplyRadialImpulse | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector | center, | ||
| R2Real | magnitude, | ||
| R2Real | falloff_radius, | ||
| R2Bool | 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.
| R2Status r2SoftBody_AttachParticle | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2RigidBodyHandle | 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 r2SoftBody_DetachParticle.
| size_t r2SoftBody_Boundary | ( | struct R2SoftBodyHandle | handle, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy flattened boundary element indices.
| size_t r2SoftBody_Cells | ( | struct R2SoftBodyHandle | handle, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy flattened cell vertex indices.
| struct R2Vector r2SoftBody_CenterOfMass | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body world-space center of mass.
| size_t r2SoftBody_ClusterParticles | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy particle indices for a cluster.
| struct R2RigidBodyHandle r2SoftBody_ClusterProxy | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster ) |
Return the rigid proxy for the selected cluster.
| size_t r2SoftBody_Clusters | ( | struct R2SoftBodyHandle | handle, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy cluster indices.
| R2Bool r2SoftBody_Contains | ( | struct R2SoftBodyHandle | handle | ) |
Test whether the live world contains this soft body handle.
A removed/stale handle returns false.
| R2Bool r2SoftBody_DetachParticle | ( | struct R2SoftBodyHandle | handle, |
| size_t | index ) |
Detach a particle from every rigid body it was attached to with r2SoftBody_AttachParticle.
Returns whether it was attached at all.
| size_t r2SoftBody_Edges | ( | struct R2SoftBodyHandle | handle, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy flattened edge vertex indices.
| R2Bool r2SoftBody_IsEnabled | ( | struct R2SoftBodyHandle | handle | ) |
Return whether the soft body is enabled.
| R2Bool r2SoftBody_IsSleeping | ( | struct R2SoftBodyHandle | handle | ) |
Return whether the soft body is sleeping.
| R2Real r2SoftBody_Mass | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body mass.
| struct R2SoftBodyMaterial r2SoftBody_Material | ( | struct R2SoftBodyHandle | handle | ) |
Return a copy of the soft body material parameters.
| size_t r2SoftBody_MeshArity | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle | collider ) |
Return indices per collision-mesh element (2 for segments, 3 for triangles).
| size_t r2SoftBody_MeshColliders | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle * | buffer, | ||
| size_t | capacity ) |
Copy collision mesh collider handles.
| size_t r2SoftBody_Meshes | ( | struct R2SoftBodyHandle | handle, |
| struct R2SoftMeshInfo * | buffer, | ||
| size_t | capacity ) |
Copy collision mesh metadata.
| size_t r2SoftBody_MeshIndices | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle | collider, | ||
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy flattened collision mesh indices.
| size_t r2SoftBody_MeshIndicesById | ( | struct R2SoftBodyHandle | handle, |
| struct R2SoftMeshId | id, | ||
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy flattened indices for a mesh ID.
| R2Bool r2SoftBody_MeshIsClosed | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle | collider ) |
Return whether the selected collision mesh is closed.
| uint32_t r2SoftBody_MeshTopologyVersion | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle | collider ) |
Return the selected collision mesh topology revision for cache invalidation.
| size_t r2SoftBody_MeshVertices | ( | struct R2SoftBodyHandle | handle, |
| struct R2ColliderHandle | collider, | ||
| struct R2Vector * | buffer, | ||
| size_t | capacity ) |
Copy world-space collision mesh vertices.
| size_t r2SoftBody_MeshVerticesById | ( | struct R2SoftBodyHandle | handle, |
| struct R2SoftMeshId | id, | ||
| struct R2Vector * | buffer, | ||
| size_t | capacity ) |
Copy world-space vertices for a mesh ID.
| size_t r2SoftBody_NumParticles | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body particle count.
| struct R2Vector r2SoftBody_ParticlePosition | ( | struct R2SoftBodyHandle | handle, |
| size_t | index ) |
Return the world-space position of the indexed particle.
| size_t r2SoftBody_ParticlePositions | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector * | buffer, | ||
| size_t | capacity ) |
Copy world-space particle positions.
| size_t r2SoftBody_ParticleVelocities | ( | struct R2SoftBodyHandle | handle, |
| struct R2Vector * | buffer, | ||
| size_t | capacity ) |
Copy world-space particle velocities.
| struct R2Vector r2SoftBody_ParticleVelocity | ( | struct R2SoftBodyHandle | handle, |
| size_t | index ) |
Return the world-space velocity of the indexed particle.
| size_t r2SoftBody_Pieces | ( | struct R2SoftBodyHandle | handle, |
| struct R2SoftBodyHandle * | buffer, | ||
| size_t | capacity ) |
Copy piece identifiers.
| R2Status r2SoftBody_RemoveCluster | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster ) |
Remove the selected cluster and its rigid proxy.
| R2Status r2SoftBody_ResetForces | ( | struct R2SoftBodyHandle | handle, |
| R2Bool | wake_up ) |
Clear accumulated user forces.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2SoftBody_ResetPlasticity | ( | struct R2SoftBodyHandle | 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.
| R2Real r2SoftBody_RestVolume | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body undeformed volume.
| struct R2RigidBodyHandle r2SoftBody_RootBody | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body root rigid-proxy handle.
| R2Status r2SoftBody_SetClusterEdgeSoftness | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| const struct R2SpringCoefficients * | 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.
| R2Status r2SoftBody_SetClusterKinematicTarget | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| struct R2Pose | value ) |
Set the next world-space target pose of a pinned cluster.
| R2Status r2SoftBody_SetClusterPinned | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| R2Bool | value ) |
Enable or disable pinning the cluster for the soft body.
| R2Status r2SoftBody_SetClusterShapeMatchingEnabled | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| R2Bool | value ) |
Enable or disable using cluster shape matching for the soft body.
| R2Status r2SoftBody_SetClusterShapeMatchingTarget | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| const struct R2Pose * | target ) |
Set the soft body cluster shape-matching target pose.
| R2Status r2SoftBody_SetClusterStiffnessScale | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| R2Real | 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 r2SoftBody_SetClusterEdgeSoftness for edges.
| R2Status r2SoftBody_SetClusterTearResistance | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | cluster, | ||
| R2Real | value ) |
Set the soft body cluster tear-resistance multiplier.
| R2Status r2SoftBody_SetEdgeTearResistance | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| R2Real | resistance ) |
Set the soft body edge tear-resistance multiplier.
| R2Status r2SoftBody_SetEnabled | ( | struct R2SoftBodyHandle | handle, |
| R2Bool | value ) |
Enable or disable the soft body.
| R2Status r2SoftBody_SetMaterial | ( | struct R2SoftBodyHandle | handle, |
| const struct R2SoftBodyMaterial * | data ) |
Copy material parameters into the soft body.
| R2Status r2SoftBody_SetParticleKinematicTarget | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2Vector | value ) |
Set the next world-space target position of a pinned particle.
| R2Status r2SoftBody_SetParticlePinned | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| R2Bool | value ) |
Enable or disable pinning the particle for the soft body.
| R2Status r2SoftBody_SetParticlePosition | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2Vector | value ) |
Set the world-space position of the indexed particle.
| R2Status r2SoftBody_SetParticleVelocity | ( | struct R2SoftBodyHandle | handle, |
| size_t | index, | ||
| struct R2Vector | value ) |
Set the soft body particle world-space velocity.
| R2Status r2SoftBody_SetSolver | ( | struct R2SoftBodyHandle | handle, |
| uint32_t | solver ) |
Set the soft body soft solver kind (R2_SOFT_SOLVER_*).
| R2Status r2SoftBody_SetVolumeFactor | ( | struct R2SoftBodyHandle | handle, |
| R2Real | value ) |
Set the soft body target volume multiplier.
| uint32_t r2SoftBody_Solver | ( | struct R2SoftBodyHandle | handle | ) |
Return the solver simulating the soft body's elasticity (R2_SOFT_SOLVER_*).
Always R2_SOFT_SOLVER_CONSTRAINTS in a library built without FEM.
| struct R2SoftBodyTearEvent * r2SoftBody_Tear | ( | struct R2SoftBodyHandle | 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 r2FreeSoftBodyTearEvent.
| R2Status r2SoftBody_TearCell | ( | struct R2SoftBodyHandle | 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.
| R2Status r2SoftBody_TearEdge | ( | struct R2SoftBodyHandle | 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 r2SoftBody_Tear to tear immediately.
| uint32_t r2SoftBody_TopologyVersion | ( | struct R2SoftBodyHandle | handle | ) |
Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches.
| R2Status r2SoftBody_ValidateHandle | ( | struct R2SoftBodyHandle | handle | ) |
Validate the index and generation in the live owning world.
Cannot detect a world pointer that has already been freed.
| R2Real r2SoftBody_Volume | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body current volume.
| R2Real r2SoftBody_VolumeFactor | ( | struct R2SoftBodyHandle | handle | ) |
Return the soft body target volume multiplier.
| R2Status r2SoftBody_WakeUp | ( | struct R2SoftBodyHandle | handle | ) |
Wake the soft body and its rigid proxies.
| size_t r2SoftBodyCount | ( | const struct R2World * | world | ) |
Return the number of soft body objects in the world.
| size_t r2SoftBodyDesc_CellIndices | ( | const struct R2SoftBodyDesc * | desc, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copies generated cell indices into caller-owned storage.
Counts scalar indices.
| size_t r2SoftBodyDesc_ParticlePositions | ( | const struct R2SoftBodyDesc * | desc, |
| struct R2Vector * | buffer, | ||
| size_t | capacity ) |
Copies generated particle positions into caller-owned storage; no persistent builder.
| R2Status r2SoftBodyDesc_SetAddedEdges | ( | struct R2SoftBodyDesc * | desc, |
| struct R2EdgeView | view ) |
Borrow structural edges added after appending (see R2SoftBodyDesc::addedEdges); preserve all other fields.
No allocation or element reads. Invalid view metadata leaves the description unchanged.
| R2Status r2SoftBodyDesc_SetAppended | ( | struct R2SoftBodyDesc * | desc, |
| struct R2SoftBodyDescView | view ) |
Borrow descriptions to merge into this body (see R2SoftBodyDesc::appended); preserve all other fields.
No allocation or element reads. Invalid view metadata leaves the description unchanged.
| R2Status r2SoftBodyDesc_SetBendEdges | ( | struct R2SoftBodyDesc * | desc, |
| struct R2EdgeView | 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.
| R2Status r2SoftBodyDesc_SetCells | ( | struct R2SoftBodyDesc * | desc, |
| R2CellView | 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.
| R2Status r2SoftBodyDesc_SetEdges | ( | struct R2SoftBodyDesc * | desc, |
| struct R2EdgeView | 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.
| R2Status r2SoftBodyDesc_SetMasses | ( | struct R2SoftBodyDesc * | desc, |
| struct R2RealView | 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.
| R2Status r2SoftBodyDesc_SetParticles | ( | struct R2SoftBodyDesc * | desc, |
| struct R2VectorView | positions ) |
Select an explicit particle recipe and borrow its positions.
Other fields are preserved.
| R2Status r2SoftBodyDesc_SetPinnedParticles | ( | struct R2SoftBodyDesc * | desc, |
| struct R2IndexView | 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.
| R2Status r2SoftBodyDesc_SetSkin | ( | struct R2SoftBodyDesc * | desc, |
| struct R2VectorView | vertices, | ||
| R2SurfaceElementView | elements ) |
Borrow skin geometry.
Other fields, including skinCollision, are preserved.
| R2Status r2SoftBodyDesc_SetSurface | ( | struct R2SoftBodyDesc * | desc, |
| R2SurfaceElementView | 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.
| R2Status r2SoftBodyDesc_SetSurfaceMesh | ( | struct R2SoftBodyDesc * | desc, |
| struct R2VectorView | vertices, | ||
| R2SurfaceElementView | elements ) |
Select a surface recipe and borrow its vertices and elements.
Other fields are preserved.
| R2Status r2SoftBodyDesc_SetTensionOnlyEdges | ( | struct R2SoftBodyDesc * | desc, |
| struct R2IndexView | 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.
| R2Status r2SoftBodyDesc_SetTrimesh | ( | struct R2SoftBodyDesc * | desc, |
| struct R2VectorView | vertices, | ||
| struct R2TriangleView | triangles ) |
Select a 2D triangle-mesh recipe and borrow its vertices and triangles (stored in positions and cells).
The triangles become structural edges and a boundary, not cells, and shape matching holds the shape. Other fields are preserved.
| size_t r2SoftBodyHandles | ( | const struct R2World * | world, |
| struct R2SoftBodyHandle * | buffer, | ||
| size_t | capacity ) |
Copy entity handles.
| size_t r2SoftBodyTearEvent_Bodies | ( | const struct R2SoftBodyTearEvent * | event, |
| struct R2SoftBodyHandle * | 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 r2SoftBodyTearEvent_PieceParticles(event, i, ...).
| size_t r2SoftBodyTearEvent_Clusters | ( | const struct R2SoftBodyTearEvent * | event, |
| struct R2SoftClusterSplit * | buffer, | ||
| size_t | capacity ) |
Copy cluster-to-piece and rigid-proxy remapping records.
| size_t r2SoftBodyTearEvent_InsertedParticles | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Flat indices; element arity follows the corresponding Rust event field.
| size_t r2SoftBodyTearEvent_MovedJoints | ( | const struct R2SoftBodyTearEvent * | event, |
| struct R2SoftJointMove * | buffer, | ||
| size_t | capacity ) |
Copy impulse-joint remapping records produced by the tear.
| struct R2ParticleDestination r2SoftBodyTearEvent_ParticleDestination | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t | particle ) |
Return the destination body and particle index for an original particle.
| size_t r2SoftBodyTearEvent_PieceCount | ( | const struct R2SoftBodyTearEvent * | event | ) |
Return the number of soft bodies the torn body is in after the tear: the length of r2SoftBodyTearEvent_Bodies, and the exclusive bound of the piece_index of r2SoftBodyTearEvent_PieceParticles.
It is 1 when nothing was split off.
| size_t r2SoftBodyTearEvent_PieceParticles | ( | const struct R2SoftBodyTearEvent * | event, |
| size_t | piece_index, | ||
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Copy the particles of the piece_index-th body of r2SoftBodyTearEvent_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 r2SoftBodyTearEvent_PieceCount.
| size_t r2SoftBodyTearEvent_RemovedEdges | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Flat indices; element arity follows the corresponding Rust event field.
| struct R2SoftBodyHandle r2SoftBodyTearEvent_SoftBody | ( | const struct R2SoftBodyTearEvent * | event | ) |
Return the source soft-body handle for this tear event.
| size_t r2SoftBodyTearEvent_SplitParticles | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Flat indices; element arity follows the corresponding Rust event field.
| size_t r2SoftBodyTearEvent_TornCells | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Flat indices; element arity follows the corresponding Rust event field.
| size_t r2SoftBodyTearEvent_TornEdges | ( | const struct R2SoftBodyTearEvent * | event, |
| uint32_t * | buffer, | ||
| size_t | capacity ) |
Flat indices; element arity follows the corresponding Rust event field.
| struct R2OptionalParticleDestination r2SoftBodyTearEvent_TryParticleDestination | ( | const struct R2SoftBodyTearEvent * | 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.
| struct R2SoftBodyMaterial r2UniformSoftBodyMaterial | ( | struct R2SpringCoefficients | value | ) |
Returns a material with the same softness for each constraint family.
| struct R2SoftBodyDesc r2VolumetricSoftBodyDesc | ( | struct R2VectorView | vertices, |
| R2SurfaceElementView | surface, | ||
| struct R2VolumeMeshParameters | parameters ) |
Initializes a borrowed meshing recipe.
Mesh generation happens on preview/insertion.