Rapier C — 3D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
R3SoftBodyDesc Struct Reference

Copyable recipe, not an owned procedural builder. More...

#include <rapier.h>

Data Fields

uint32_t kind
 Discriminant selecting which description fields are read.
struct R3Vector a
 Recipe origin/center or first rope endpoint; use a recipe constructor.
struct R3Vector b
 Recipe half extents, second rope endpoint, or tube axis; use a recipe constructor.
struct R3Vector du
 Cloth basis step along its first parameter axis.
struct R3Vector dv
 Cloth basis step along its second parameter axis.
struct R3SpringCoefficients warpSoftness
 Softness of the anisotropic cloth edges along du (warp).
struct R3SpringCoefficients weftSoftness
 Softness of the anisotropic cloth edges along dv (weft).
struct R3SpringCoefficients shearSoftness
 Softness of the anisotropic cloth diagonal edges (shear).
size_t nx
 First recipe resolution; interpretation depends on kind.
size_t ny
 Second recipe resolution; interpretation depends on kind.
size_t nz
 Third recipe resolution; interpretation depends on kind.
R3Real radius
 Radius for the selected primitive or recipe.
R3Real radiusEnd
 Radius at the second end of a tapered cloth tube.
struct R3Vector translation
 Translation vector.
struct R3OptionalReal totalMass
 Optional total mass override for generated particles.
struct R3VolumeMeshParameters meshing
 Volume-meshing parameters for a volumetric recipe.
struct R3VectorView positions
 Borrowed initial particle positions.
struct R3RealView masses
 Borrowed per-particle masses; when empty, particleMass is used.
struct R3IndexView pinned
 Borrowed indices of pinned particles.
struct R3EdgeView edges
 Borrowed edge topology; count is edges.
struct R3EdgeView bendEdges
 Borrowed bending edge constraints.
struct R3IndexView tensionOnlyEdges
 Borrowed indices of edges that resist tension only.
struct R3SoftEdgeSoftnessView edgeSoftness
 Borrowed per-edge softness overrides.
struct R3SoftEdgeTearView edgeTearResistance
 Borrowed per-edge tear-resistance overrides.
R3CellView cells
 Borrowed triangles in 2D or tetrahedra in 3D.
R3SurfaceElementView surface
 Borrowed boundary edges in 2D or triangles in 3D.
struct R3DihedralView dihedrals
 Borrowed four-vertex bending constraints.
struct R3EdgeView wire
 Borrowed wire edges for a surface recipe.
struct R3VectorView skinVertices
 Borrowed skin vertex positions.
R3SurfaceElementView skinIndices
 Borrowed skin topology.
struct R3SoftBodyDescView appended
 Borrowed descriptions merged into this body, their particles numbered after this one's in order.
struct R3EdgeView addedEdges
 Borrowed structural edges added after appending (seams); indices count this body's particles then the appended ones.
struct R3SoftBodyMaterial material
 Soft-body material coefficients.
uint32_t cellModel
 R3_SOFT_CELL_VOLUME, R3_SOFT_CELL_COROTATIONAL, or R3_SOFT_CELL_NEO_HOOKEAN.
uint32_t solver
 0 = constraints, 1 = FEM (requires a library built with FEM).
R3Real particleMass
 Default nonnegative particle mass.
struct R3OptionalReal particleRadius
 Disabled by default: retain the radius computed by the generator.
R3Bool volumePreservation
 Whether to preserve volume.
R3Real volumeFactor
 Target volume multiplier.
struct R3OptionalBool shapeMatching
 Optional shape-matching override; disabled retains recipe defaults.
struct R3OptionalBool oriented
 Optional override of the ORIENTED flag of the generated collision surface (when disabled, a closed surface is oriented).
R3Bool selfContacts
 Whether self-collision is enabled.
R3Bool skinCollision
 Whether skin elements participate in collision detection.
R3Bool collisionEnabled
 Whether the generated collision geometry is enabled.
struct R3ColliderDesc collider
 Collider configuration used by the recipe; shape comes from the generated geometry.
R3Real linearDamping
 Nonnegative linear damping coefficient.
R3Real gravityScale
 Multiplier applied to world gravity.
size_t additionalSolverIterations
 Extra solver iterations for this body and connected bodies.
size_t additionalPgsIterations
 Extra PGS iterations for this body.
R3Bool canSleep
 Whether automatic sleeping is allowed.
int8_t dominanceGroup
 Signed dominance group; larger groups dominate smaller groups.
struct R3UserData userData
 Application data; Rapier does not own pointers encoded in it.

Detailed Description

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

Field Documentation

◆ a

struct R3Vector R3SoftBodyDesc::a

Recipe origin/center or first rope endpoint; use a recipe constructor.

◆ addedEdges

struct R3EdgeView R3SoftBodyDesc::addedEdges

Borrowed structural edges added after appending (seams); indices count this body's particles then the appended ones.

Their rest length is the current distance of their particles.

◆ additionalPgsIterations

size_t R3SoftBodyDesc::additionalPgsIterations

Extra PGS iterations for this body.

◆ additionalSolverIterations

size_t R3SoftBodyDesc::additionalSolverIterations

Extra solver iterations for this body and connected bodies.

◆ appended

struct R3SoftBodyDescView R3SoftBodyDesc::appended

Borrowed descriptions merged into this body, their particles numbered after this one's in order.

Each contributes its particles, masses, pinned particles and elements (after its own translation and total mass); every other setting comes from this description. Appended descriptions cannot append others nor have a skin.

◆ b

struct R3Vector R3SoftBodyDesc::b

Recipe half extents, second rope endpoint, or tube axis; use a recipe constructor.

◆ bendEdges

struct R3EdgeView R3SoftBodyDesc::bendEdges

Borrowed bending edge constraints.

◆ canSleep

R3Bool R3SoftBodyDesc::canSleep

Whether automatic sleeping is allowed.

◆ cellModel

uint32_t R3SoftBodyDesc::cellModel

R3_SOFT_CELL_VOLUME, R3_SOFT_CELL_COROTATIONAL, or R3_SOFT_CELL_NEO_HOOKEAN.

◆ cells

R3CellView R3SoftBodyDesc::cells

Borrowed triangles in 2D or tetrahedra in 3D.

◆ collider

struct R3ColliderDesc R3SoftBodyDesc::collider

Collider configuration used by the recipe; shape comes from the generated geometry.

◆ collisionEnabled

R3Bool R3SoftBodyDesc::collisionEnabled

Whether the generated collision geometry is enabled.

◆ dihedrals

struct R3DihedralView R3SoftBodyDesc::dihedrals

Borrowed four-vertex bending constraints.

◆ dominanceGroup

int8_t R3SoftBodyDesc::dominanceGroup

Signed dominance group; larger groups dominate smaller groups.

◆ du

struct R3Vector R3SoftBodyDesc::du

Cloth basis step along its first parameter axis.

◆ dv

struct R3Vector R3SoftBodyDesc::dv

Cloth basis step along its second parameter axis.

◆ edges

struct R3EdgeView R3SoftBodyDesc::edges

Borrowed edge topology; count is edges.

◆ edgeSoftness

struct R3SoftEdgeSoftnessView R3SoftBodyDesc::edgeSoftness

Borrowed per-edge softness overrides.

◆ edgeTearResistance

struct R3SoftEdgeTearView R3SoftBodyDesc::edgeTearResistance

Borrowed per-edge tear-resistance overrides.

◆ gravityScale

R3Real R3SoftBodyDesc::gravityScale

Multiplier applied to world gravity.

◆ kind

uint32_t R3SoftBodyDesc::kind

Discriminant selecting which description fields are read.

◆ linearDamping

R3Real R3SoftBodyDesc::linearDamping

Nonnegative linear damping coefficient.

◆ masses

struct R3RealView R3SoftBodyDesc::masses

Borrowed per-particle masses; when empty, particleMass is used.

◆ material

struct R3SoftBodyMaterial R3SoftBodyDesc::material

Soft-body material coefficients.

◆ meshing

struct R3VolumeMeshParameters R3SoftBodyDesc::meshing

Volume-meshing parameters for a volumetric recipe.

◆ nx

size_t R3SoftBodyDesc::nx

First recipe resolution; interpretation depends on kind.

◆ ny

size_t R3SoftBodyDesc::ny

Second recipe resolution; interpretation depends on kind.

◆ nz

size_t R3SoftBodyDesc::nz

Third recipe resolution; interpretation depends on kind.

◆ oriented

struct R3OptionalBool R3SoftBodyDesc::oriented

Optional override of the ORIENTED flag of the generated collision surface (when disabled, a closed surface is oriented).

Set it to false for a shell whose inner side holds bodies.

◆ particleMass

R3Real R3SoftBodyDesc::particleMass

Default nonnegative particle mass.

◆ particleRadius

struct R3OptionalReal R3SoftBodyDesc::particleRadius

Disabled by default: retain the radius computed by the generator.

◆ pinned

struct R3IndexView R3SoftBodyDesc::pinned

Borrowed indices of pinned particles.

◆ positions

struct R3VectorView R3SoftBodyDesc::positions

Borrowed initial particle positions.

◆ radius

R3Real R3SoftBodyDesc::radius

Radius for the selected primitive or recipe.

◆ radiusEnd

R3Real R3SoftBodyDesc::radiusEnd

Radius at the second end of a tapered cloth tube.

◆ selfContacts

R3Bool R3SoftBodyDesc::selfContacts

Whether self-collision is enabled.

◆ shapeMatching

struct R3OptionalBool R3SoftBodyDesc::shapeMatching

Optional shape-matching override; disabled retains recipe defaults.

◆ shearSoftness

struct R3SpringCoefficients R3SoftBodyDesc::shearSoftness

Softness of the anisotropic cloth diagonal edges (shear).

◆ skinCollision

R3Bool R3SoftBodyDesc::skinCollision

Whether skin elements participate in collision detection.

◆ skinIndices

R3SurfaceElementView R3SoftBodyDesc::skinIndices

Borrowed skin topology.

◆ skinVertices

struct R3VectorView R3SoftBodyDesc::skinVertices

Borrowed skin vertex positions.

◆ solver

uint32_t R3SoftBodyDesc::solver

0 = constraints, 1 = FEM (requires a library built with FEM).

◆ surface

R3SurfaceElementView R3SoftBodyDesc::surface

Borrowed boundary edges in 2D or triangles in 3D.

◆ tensionOnlyEdges

struct R3IndexView R3SoftBodyDesc::tensionOnlyEdges

Borrowed indices of edges that resist tension only.

◆ totalMass

struct R3OptionalReal R3SoftBodyDesc::totalMass

Optional total mass override for generated particles.

◆ translation

struct R3Vector R3SoftBodyDesc::translation

Translation vector.

◆ userData

struct R3UserData R3SoftBodyDesc::userData

Application data; Rapier does not own pointers encoded in it.

◆ volumeFactor

R3Real R3SoftBodyDesc::volumeFactor

Target volume multiplier.

◆ volumePreservation

R3Bool R3SoftBodyDesc::volumePreservation

Whether to preserve volume.

◆ warpSoftness

struct R3SpringCoefficients R3SoftBodyDesc::warpSoftness

Softness of the anisotropic cloth edges along du (warp).

◆ weftSoftness

struct R3SpringCoefficients R3SoftBodyDesc::weftSoftness

Softness of the anisotropic cloth edges along dv (weft).

◆ wire

struct R3EdgeView R3SoftBodyDesc::wire

Borrowed wire edges for a surface recipe.


The documentation for this struct was generated from the following file: