Rapier C — 3D / f64 0.36.0+c.0
Loading...
Searching...
No Matches
Shapes and mesh data

Shared immutable geometry and copied rendering data. More...

Data Structures

struct  R3VolumeMeshParameters
 Parameters for the native volumetric mesher. More...
struct  R3CompoundShapeView
 Borrowed elements; count counts elements. More...
struct  R3ShapeDesc
 Non-owning shape description. More...
struct  R3CompoundShapeDesc
 One compound child with a local pose and borrowed geometry description. More...

Macros

#define R3_POLYLINE_DEFORMABLE   2
 Prepare polyline acceleration data for deformation.
#define R3_SHAPE_DESC_BALL   0
 ShapeDesc kind selecting a ball.
#define R3_SHAPE_DESC_CUBOID   1
 ShapeDesc kind selecting a cuboid.
#define R3_SHAPE_DESC_ROUND_CUBOID   2
 ShapeDesc kind selecting a round cuboid.
#define R3_SHAPE_DESC_CAPSULE   3
 ShapeDesc kind selecting a capsule.
#define R3_SHAPE_DESC_SEGMENT   4
 ShapeDesc kind selecting a segment.
#define R3_SHAPE_DESC_TRIANGLE   5
 ShapeDesc kind selecting a triangle.
#define R3_SHAPE_DESC_HALFSPACE   6
 ShapeDesc kind selecting a half-space.
#define R3_SHAPE_DESC_CONVEX_HULL   7
 ShapeDesc kind selecting a convex hull.
#define R3_SHAPE_DESC_TRIMESH   8
 ShapeDesc kind selecting a triangle mesh.
#define R3_SHAPE_DESC_POLYLINE   9
 ShapeDesc kind selecting a polyline.
#define R3_SHAPE_DESC_SHARED   10
 ShapeDesc kind selecting borrowed shared geometry.
#define R3_SHAPE_DESC_HEIGHTFIELD   11
 ShapeDesc kind selecting a heightfield.
#define R3_SHAPE_DESC_CYLINDER   12
 ShapeDesc kind selecting a cylinder.
#define R3_SHAPE_DESC_CONE   13
 ShapeDesc kind selecting a cone.
#define R3_SHAPE_DESC_COMPOUND   14
 ShapeDesc kind selecting compound child shapes.
#define R3_SHAPE_DESC_ROUND_CYLINDER   15
 ShapeDesc kind selecting a round cylinder.
#define R3_SHAPE_DESC_ROUND_CONE   16
 ShapeDesc kind selecting a round cone.
#define R3_TRIMESH_HALF_EDGE_TOPOLOGY   1
 Compute the half-edge topology of the triangle mesh.
#define R3_TRIMESH_CONNECTED_COMPONENTS   2
 Compute the connected components of the triangle mesh.
#define R3_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES   4
 Delete the triangles breaking the half-edge topology.
#define R3_TRIMESH_ORIENTED   8
 Treat the triangle mesh as oriented (outward normals) and compute its pseudo-normals.
#define R3_TRIMESH_MERGE_DUPLICATE_VERTICES   16
 Merge triangle-mesh vertices with identical positions.
#define R3_TRIMESH_DELETE_DEGENERATE_TRIANGLES   32
 Delete the triangles with a zero area.
#define R3_TRIMESH_DELETE_DUPLICATE_TRIANGLES   64
 Delete the triangles sharing their three vertices with another triangle.
#define R3_TRIMESH_FIX_INTERNAL_EDGES   144
 Correct contact normals at internal mesh edges; includes duplicate-vertex merging.
#define R3_TRIMESH_DEFORMABLE   256
 Prepare triangle-mesh acceleration data for deformation.
#define R3_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED   656
 Correct internal-edge contacts on both sides of the triangle mesh.
#define R3_HEIGHTFIELD_FIX_INTERNAL_EDGES   1
 Correct contact normals at internal heightfield edges.

Typedefs

typedef struct R3ShapeMesh R3ShapeMesh
 Owned tessellated shape: flat triangle vertices and independent line segments, in local space.
typedef struct R3TriMeshData R3TriMeshData
 Owned indexed geometry from Parry's shape tessellation, preserving its vertex order.
typedef struct R3VolumeMeshParameters R3VolumeMeshParameters
 Parameters for the native volumetric mesher.
typedef struct R3SharedShape R3SharedShape
 Opaque SharedShape.
typedef struct R3CompoundShapeView R3CompoundShapeView
 Borrowed elements; count counts elements.
typedef struct R3ShapeDesc R3ShapeDesc
 Non-owning shape description.
typedef struct R3CompoundShapeDesc R3CompoundShapeDesc
 One compound child with a local pose and borrowed geometry description.

Functions

struct R3ShapeCastHit r3CastShape (const struct R3World *world, const struct R3QueryOptions *query_options, struct R3Pose pose, struct R3Vector velocity, const R3SharedShape *shape, struct R3ShapeCastOptions options)
 Sweep shape from pose along velocity and return the first hit; report R3_NOT_FOUND on a miss.
size_t r3IntersectShape (const struct R3World *world, const struct R3QueryOptions *query_options, struct R3Pose pose, const R3SharedShape *shape, struct R3ColliderHandle *buffer, size_t capacity)
 Copy handles of colliders intersecting the shape at its world-space pose.
struct R3ShapeDesc r3DefaultShapeDesc (void)
 Return native default shape desc.
R3SharedShape * r3ShapeDesc_Build (const struct R3ShapeDesc *desc)
 Build an owned shared shape from a description; release it with r3FreeSharedShape.
R3SharedShape * r3BallSharedShape (R3Real radius)
 Create an owned ball shape.
R3SharedShape * r3CuboidSharedShape (struct R3Vector half_extents)
 Create an owned cuboid shape.
R3SharedShape * r3RoundCuboidSharedShape (struct R3Vector half_extents, R3Real border_radius)
 Create an owned round cuboid shape.
R3SharedShape * r3CapsuleSharedShape (struct R3Vector a, struct R3Vector b, R3Real radius)
 Create an owned capsule shape.
R3SharedShape * r3SegmentSharedShape (struct R3Vector a, struct R3Vector b)
 Create an owned segment shape.
R3SharedShape * r3TriangleSharedShape (struct R3Vector a, struct R3Vector b, struct R3Vector c)
 Create an owned triangle shape.
R3SharedShape * r3HalfspaceSharedShape (struct R3Vector normal)
 Create an owned halfspace shape.
R3SharedShape * r3CylinderSharedShape (R3Real half_height, R3Real radius)
 Create an owned cylinder shape.
R3SharedShape * r3ConeSharedShape (R3Real half_height, R3Real radius)
 Create an owned cone shape.
R3SharedShape * r3CompoundSharedShape (struct R3CompoundShapeView children)
 Create an owned compound shape; each child pose is relative to the compound.
R3Status r3FreeSharedShape (R3SharedShape *object)
 Frees an owned object; NULL is allowed.
R3SharedShape * r3SharedShape_Clone (const R3SharedShape *object)
 Create an owned wrapper sharing the same immutable geometry.
R3SharedShape * r3HeightfieldSharedShape (struct R3RealView heights, size_t rows, size_t columns, struct R3Vector scale)
 Create an owned heightfield shape from copied samples.
struct R3Aabb r3SharedShape_ComputeAabb (const R3SharedShape *shape, struct R3Pose pose)
 Compute the shape axis-aligned bounds at the supplied world-space pose.
struct R3MassProperties r3SharedShape_MassProperties (const R3SharedShape *shape, R3Real density)
 Compute local mass properties for the supplied nonnegative density.
R3Bool r3SharedShape_ContainsPoint (const R3SharedShape *shape, struct R3Pose pose, struct R3Vector point)
 Test whether the world-space point lies inside the shape at pose.
struct R3ShapeMesh * r3SharedShape_Tessellate (const R3SharedShape *shape, uint32_t subdivisions)
 Return owned local-space rendering geometry; release it with r3FreeShapeMesh.
size_t r3ShapeMesh_Triangles (const struct R3ShapeMesh *mesh, struct R3Vector *buffer, size_t capacity)
 Flat groups of three vertices.
size_t r3ShapeMesh_Lines (const struct R3ShapeMesh *mesh, struct R3Vector *buffer, size_t capacity)
 Flat groups of two vertices.
R3Status r3FreeShapeMesh (struct R3ShapeMesh *mesh)
 Release an owned shape mesh.
R3SharedShape * r3RoundCylinderSharedShape (R3Real half_height, R3Real radius, R3Real border_radius)
 Create an owned round cylinder shape.
R3SharedShape * r3RoundConeSharedShape (R3Real half_height, R3Real radius, R3Real border_radius)
 Create an owned round cone shape.
struct R3TriMeshData * r3SharedShape_ToTrimesh (const R3SharedShape *shape, uint32_t ntheta, uint32_t nphi)
 Tessellate a ball or capsule with independent longitude/latitude subdivision counts.
size_t r3TriMeshData_Vertices (const struct R3TriMeshData *mesh, struct R3Vector *buffer, size_t capacity)
 Copy vertices.
size_t r3TriMeshData_Indices (const struct R3TriMeshData *mesh, uint32_t *buffer, size_t capacity)
 Flat triangle indices; count and capacity are numbers of u32 entries.
R3Status r3FreeTriMeshData (struct R3TriMeshData *mesh)
 Release an owned tri mesh data.
R3Status r3ShapeDesc_SetTrimesh (struct R3ShapeDesc *desc, struct R3VectorView vertices, struct R3TriangleView indices, uint32_t flags)
 Replace the shape geometry with a borrowed tri mesh.
R3Status r3ShapeDesc_SetPolyline (struct R3ShapeDesc *desc, struct R3VectorView vertices, struct R3EdgeView indices, uint32_t flags)
 Replace the shape geometry with a borrowed polyline.
R3Status r3ShapeDesc_SetConvexHull (struct R3ShapeDesc *desc, struct R3VectorView vertices)
 Replace the shape geometry with a borrowed convex hull point cloud.
size_t r3Collider_ShapeIdentity (struct R3ColliderHandle handle)
 Return a process-local geometry identity for caching, not a serializable ID.
R3SharedShape * r3Collider_CloneShape (struct R3ColliderHandle handle)
 Return an owned wrapper sharing the collider geometry.
R3Status r3Collider_SetShape (struct R3ColliderHandle handle, const R3SharedShape *shape)
 Replace collider geometry by sharing shape; the supplied wrapper is not consumed.
R3SharedShape * r3ConvexDecompositionSharedShape (struct R3VectorView vertices, R3SurfaceElementView indices)
 Create an owned compound shape by convex decomposition of the input surface.
R3SharedShape * r3VoxelsSharedShapeFromPoints (struct R3Vector voxel_size, struct R3VectorView points)
 Create an owned voxel shape by quantizing points with the supplied per-axis voxel size.
R3SharedShape * r3VoxelizedMeshSharedShape (struct R3VectorView vertices, R3SurfaceElementView indices, R3Real voxel_size)
 Create an owned voxel shape from a surface mesh with the supplied uniform voxel size.
R3SharedShape * r3ConvexHullSharedShape (struct R3VectorView vertices)
 Create an owned convex hull of the supplied vertices.
R3SharedShape * r3ConvexMeshSharedShape (struct R3VectorView vertices, struct R3TriangleView indices)
 Create an owned convex polyhedron from vertices and triangle indices assumed to form a convex mesh (no convex hull is computed); fails on degenerate input.
R3SharedShape * r3TrimeshSharedShape (struct R3VectorView vertices, struct R3TriangleView indices)
 Create an owned triangle mesh from vertices and triangle indices.
R3SharedShape * r3PolylineSharedShape (struct R3VectorView vertices, struct R3EdgeView indices)
 Create an owned polyline from vertices and edge indices.
R3SharedShape * r3RoundConvexHullSharedShape (struct R3VectorView vertices, R3Real border_radius)
 Create an owned round convex hull shape.
R3SharedShape * r3TrimeshSharedShapeWithFlags (struct R3VectorView vertices, struct R3TriangleView indices, uint32_t flags)
 Create an owned triangle mesh with the supplied TRIMESH_* processing flags.

Detailed Description

Shared immutable geometry and copied rendering data.

Owned pointers require their matching Free functions; description views remain borrowed until build/insert.

Macro Definition Documentation

◆ R3_HEIGHTFIELD_FIX_INTERNAL_EDGES

#define R3_HEIGHTFIELD_FIX_INTERNAL_EDGES   1

Correct contact normals at internal heightfield edges.

◆ R3_POLYLINE_DEFORMABLE

#define R3_POLYLINE_DEFORMABLE   2

Prepare polyline acceleration data for deformation.

◆ R3_SHAPE_DESC_BALL

#define R3_SHAPE_DESC_BALL   0

ShapeDesc kind selecting a ball.

◆ R3_SHAPE_DESC_CAPSULE

#define R3_SHAPE_DESC_CAPSULE   3

ShapeDesc kind selecting a capsule.

◆ R3_SHAPE_DESC_COMPOUND

#define R3_SHAPE_DESC_COMPOUND   14

ShapeDesc kind selecting compound child shapes.

◆ R3_SHAPE_DESC_CONE

#define R3_SHAPE_DESC_CONE   13

ShapeDesc kind selecting a cone.

◆ R3_SHAPE_DESC_CONVEX_HULL

#define R3_SHAPE_DESC_CONVEX_HULL   7

ShapeDesc kind selecting a convex hull.

◆ R3_SHAPE_DESC_CUBOID

#define R3_SHAPE_DESC_CUBOID   1

ShapeDesc kind selecting a cuboid.

◆ R3_SHAPE_DESC_CYLINDER

#define R3_SHAPE_DESC_CYLINDER   12

ShapeDesc kind selecting a cylinder.

◆ R3_SHAPE_DESC_HALFSPACE

#define R3_SHAPE_DESC_HALFSPACE   6

ShapeDesc kind selecting a half-space.

◆ R3_SHAPE_DESC_HEIGHTFIELD

#define R3_SHAPE_DESC_HEIGHTFIELD   11

ShapeDesc kind selecting a heightfield.

◆ R3_SHAPE_DESC_POLYLINE

#define R3_SHAPE_DESC_POLYLINE   9

ShapeDesc kind selecting a polyline.

◆ R3_SHAPE_DESC_ROUND_CONE

#define R3_SHAPE_DESC_ROUND_CONE   16

ShapeDesc kind selecting a round cone.

◆ R3_SHAPE_DESC_ROUND_CUBOID

#define R3_SHAPE_DESC_ROUND_CUBOID   2

ShapeDesc kind selecting a round cuboid.

◆ R3_SHAPE_DESC_ROUND_CYLINDER

#define R3_SHAPE_DESC_ROUND_CYLINDER   15

ShapeDesc kind selecting a round cylinder.

◆ R3_SHAPE_DESC_SEGMENT

#define R3_SHAPE_DESC_SEGMENT   4

ShapeDesc kind selecting a segment.

◆ R3_SHAPE_DESC_SHARED

#define R3_SHAPE_DESC_SHARED   10

ShapeDesc kind selecting borrowed shared geometry.

◆ R3_SHAPE_DESC_TRIANGLE

#define R3_SHAPE_DESC_TRIANGLE   5

ShapeDesc kind selecting a triangle.

◆ R3_SHAPE_DESC_TRIMESH

#define R3_SHAPE_DESC_TRIMESH   8

ShapeDesc kind selecting a triangle mesh.

◆ R3_TRIMESH_CONNECTED_COMPONENTS

#define R3_TRIMESH_CONNECTED_COMPONENTS   2

Compute the connected components of the triangle mesh.

◆ R3_TRIMESH_DEFORMABLE

#define R3_TRIMESH_DEFORMABLE   256

Prepare triangle-mesh acceleration data for deformation.

◆ R3_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES

#define R3_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES   4

Delete the triangles breaking the half-edge topology.

◆ R3_TRIMESH_DELETE_DEGENERATE_TRIANGLES

#define R3_TRIMESH_DELETE_DEGENERATE_TRIANGLES   32

Delete the triangles with a zero area.

◆ R3_TRIMESH_DELETE_DUPLICATE_TRIANGLES

#define R3_TRIMESH_DELETE_DUPLICATE_TRIANGLES   64

Delete the triangles sharing their three vertices with another triangle.

◆ R3_TRIMESH_FIX_INTERNAL_EDGES

#define R3_TRIMESH_FIX_INTERNAL_EDGES   144

Correct contact normals at internal mesh edges; includes duplicate-vertex merging.

◆ R3_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED

#define R3_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED   656

Correct internal-edge contacts on both sides of the triangle mesh.

◆ R3_TRIMESH_HALF_EDGE_TOPOLOGY

#define R3_TRIMESH_HALF_EDGE_TOPOLOGY   1

Compute the half-edge topology of the triangle mesh.

◆ R3_TRIMESH_MERGE_DUPLICATE_VERTICES

#define R3_TRIMESH_MERGE_DUPLICATE_VERTICES   16

Merge triangle-mesh vertices with identical positions.

◆ R3_TRIMESH_ORIENTED

#define R3_TRIMESH_ORIENTED   8

Treat the triangle mesh as oriented (outward normals) and compute its pseudo-normals.

Typedef Documentation

◆ R3CompoundShapeDesc

typedef struct R3CompoundShapeDesc R3CompoundShapeDesc

One compound child with a local pose and borrowed geometry description.

◆ R3CompoundShapeView

typedef struct R3CompoundShapeView R3CompoundShapeView

Borrowed elements; count counts elements.

Data must remain live through insertion.

◆ R3ShapeDesc

typedef struct R3ShapeDesc R3ShapeDesc

Non-owning shape description.

Only fields selected by kind are read. a = cuboid half extents, capsule/segment endpoint, triangle vertex, or halfspace normal. b/c = remaining endpoints/vertices. radius is also the rounded-cuboid border radius. Mesh views count edges or triangles; heightfields are column-major. Arrays, compound children, and sharedShape remain borrowed until build/insert returns.

◆ R3ShapeMesh

typedef struct R3ShapeMesh R3ShapeMesh

Owned tessellated shape: flat triangle vertices and independent line segments, in local space.

Rounded 3D shapes use their inner surface (as in the Rust testbed). Halfspaces use a finite patch.

◆ R3SharedShape

typedef struct R3SharedShape R3SharedShape

Opaque SharedShape.

See the ownership and borrowing contract in README.md.

◆ R3TriMeshData

typedef struct R3TriMeshData R3TriMeshData

Owned indexed geometry from Parry's shape tessellation, preserving its vertex order.

◆ R3VolumeMeshParameters

typedef struct R3VolumeMeshParameters R3VolumeMeshParameters

Parameters for the native volumetric mesher.

Enclosure: 0 cover, 1 crust (3D).

Function Documentation

◆ r3BallSharedShape()

R3SharedShape * r3BallSharedShape ( R3Real radius)

Create an owned ball shape.

Release it with r3FreeSharedShape.

◆ r3CapsuleSharedShape()

R3SharedShape * r3CapsuleSharedShape ( struct R3Vector a,
struct R3Vector b,
R3Real radius )

Create an owned capsule shape.

Release it with r3FreeSharedShape.

◆ r3CastShape()

struct R3ShapeCastHit r3CastShape ( const struct R3World * world,
const struct R3QueryOptions * query_options,
struct R3Pose pose,
struct R3Vector velocity,
const R3SharedShape * shape,
struct R3ShapeCastOptions options )

Sweep shape from pose along velocity and return the first hit; report R3_NOT_FOUND on a miss.

Time is bounded by options.max_time_of_impact. NULL query options use the default filter. Query state reflects the latest Step or DetectCollisions call.

◆ r3Collider_CloneShape()

R3SharedShape * r3Collider_CloneShape ( struct R3ColliderHandle handle)

Return an owned wrapper sharing the collider geometry.

Release it with r3FreeSharedShape.

◆ r3Collider_SetShape()

R3Status r3Collider_SetShape ( struct R3ColliderHandle handle,
const R3SharedShape * shape )

Replace collider geometry by sharing shape; the supplied wrapper is not consumed.

◆ r3Collider_ShapeIdentity()

size_t r3Collider_ShapeIdentity ( struct R3ColliderHandle handle)

Return a process-local geometry identity for caching, not a serializable ID.

Keep a shared-shape clone alive while using it as a cache key.

◆ r3CompoundSharedShape()

R3SharedShape * r3CompoundSharedShape ( struct R3CompoundShapeView children)

Create an owned compound shape; each child pose is relative to the compound.

Child shapes are shared, not consumed. Release with r3FreeSharedShape.

◆ r3ConeSharedShape()

R3SharedShape * r3ConeSharedShape ( R3Real half_height,
R3Real radius )

Create an owned cone shape.

Release it with r3FreeSharedShape.

◆ r3ConvexDecompositionSharedShape()

R3SharedShape * r3ConvexDecompositionSharedShape ( struct R3VectorView vertices,
R3SurfaceElementView indices )

Create an owned compound shape by convex decomposition of the input surface.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3ConvexHullSharedShape()

R3SharedShape * r3ConvexHullSharedShape ( struct R3VectorView vertices)

Create an owned convex hull of the supplied vertices.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3ConvexMeshSharedShape()

R3SharedShape * r3ConvexMeshSharedShape ( struct R3VectorView vertices,
struct R3TriangleView indices )

Create an owned convex polyhedron from vertices and triangle indices assumed to form a convex mesh (no convex hull is computed); fails on degenerate input.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3CuboidSharedShape()

R3SharedShape * r3CuboidSharedShape ( struct R3Vector half_extents)

Create an owned cuboid shape.

Release it with r3FreeSharedShape.

◆ r3CylinderSharedShape()

R3SharedShape * r3CylinderSharedShape ( R3Real half_height,
R3Real radius )

Create an owned cylinder shape.

Release it with r3FreeSharedShape.

◆ r3DefaultShapeDesc()

struct R3ShapeDesc r3DefaultShapeDesc ( void )

Return native default shape desc.

This POD value owns no resources.

◆ r3FreeShapeMesh()

R3Status r3FreeShapeMesh ( struct R3ShapeMesh * mesh)

Release an owned shape mesh.

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

◆ r3FreeSharedShape()

R3Status r3FreeSharedShape ( R3SharedShape * object)

Frees an owned object; NULL is allowed.

Never free a borrowed pointer.

◆ r3FreeTriMeshData()

R3Status r3FreeTriMeshData ( struct R3TriMeshData * mesh)

Release an owned tri mesh data.

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

◆ r3HalfspaceSharedShape()

R3SharedShape * r3HalfspaceSharedShape ( struct R3Vector normal)

Create an owned halfspace shape.

Release it with r3FreeSharedShape.

◆ r3HeightfieldSharedShape()

R3SharedShape * r3HeightfieldSharedShape ( struct R3RealView heights,
size_t rows,
size_t columns,
struct R3Vector scale )

Create an owned heightfield shape from copied samples.

3D samples are column-major, with rows * columns entries. Release with r3FreeSharedShape.

◆ r3IntersectShape()

size_t r3IntersectShape ( const struct R3World * world,
const struct R3QueryOptions * query_options,
struct R3Pose pose,
const R3SharedShape * shape,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy handles of colliders intersecting the shape at its world-space pose.

The shape is borrowed for this call.

See also
Arrays and output buffers NULL query options use the default filter. Query state reflects the latest Step or DetectCollisions call.

◆ r3PolylineSharedShape()

R3SharedShape * r3PolylineSharedShape ( struct R3VectorView vertices,
struct R3EdgeView indices )

Create an owned polyline from vertices and edge indices.

Release it with r3FreeSharedShape. Empty indices connect the vertices in order (a line strip). Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3RoundConeSharedShape()

R3SharedShape * r3RoundConeSharedShape ( R3Real half_height,
R3Real radius,
R3Real border_radius )

Create an owned round cone shape.

Release it with r3FreeSharedShape.

◆ r3RoundConvexHullSharedShape()

R3SharedShape * r3RoundConvexHullSharedShape ( struct R3VectorView vertices,
R3Real border_radius )

Create an owned round convex hull shape.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3RoundCuboidSharedShape()

R3SharedShape * r3RoundCuboidSharedShape ( struct R3Vector half_extents,
R3Real border_radius )

Create an owned round cuboid shape.

Release it with r3FreeSharedShape.

◆ r3RoundCylinderSharedShape()

R3SharedShape * r3RoundCylinderSharedShape ( R3Real half_height,
R3Real radius,
R3Real border_radius )

Create an owned round cylinder shape.

Release it with r3FreeSharedShape.

◆ r3SegmentSharedShape()

R3SharedShape * r3SegmentSharedShape ( struct R3Vector a,
struct R3Vector b )

Create an owned segment shape.

Release it with r3FreeSharedShape.

◆ r3ShapeDesc_Build()

R3SharedShape * r3ShapeDesc_Build ( const struct R3ShapeDesc * desc)

Build an owned shared shape from a description; release it with r3FreeSharedShape.

Borrowed inputs may be released after this call.

◆ r3ShapeDesc_SetConvexHull()

R3Status r3ShapeDesc_SetConvexHull ( struct R3ShapeDesc * desc,
struct R3VectorView vertices )

Replace the shape geometry with a borrowed convex hull point cloud.

◆ r3ShapeDesc_SetPolyline()

R3Status r3ShapeDesc_SetPolyline ( struct R3ShapeDesc * desc,
struct R3VectorView vertices,
struct R3EdgeView indices,
uint32_t flags )

Replace the shape geometry with a borrowed polyline.

Counts are elements. Copies no arrays. Invalid view metadata leaves the description unchanged. Geometry and flags are validated when the description is built or inserted.

◆ r3ShapeDesc_SetTrimesh()

R3Status r3ShapeDesc_SetTrimesh ( struct R3ShapeDesc * desc,
struct R3VectorView vertices,
struct R3TriangleView indices,
uint32_t flags )

Replace the shape geometry with a borrowed tri mesh.

Counts are elements. Copies no arrays. Invalid view metadata leaves the description unchanged. Geometry and flags are validated when the description is built or inserted.

◆ r3ShapeMesh_Lines()

size_t r3ShapeMesh_Lines ( const struct R3ShapeMesh * mesh,
struct R3Vector * buffer,
size_t capacity )

Flat groups of two vertices.

Standard output-buffer convention.

See also
Arrays and output buffers

◆ r3ShapeMesh_Triangles()

size_t r3ShapeMesh_Triangles ( const struct R3ShapeMesh * mesh,
struct R3Vector * buffer,
size_t capacity )

Flat groups of three vertices.

Standard output-buffer convention.

See also
Arrays and output buffers

◆ r3SharedShape_Clone()

R3SharedShape * r3SharedShape_Clone ( const R3SharedShape * object)

Create an owned wrapper sharing the same immutable geometry.

Release it with r3FreeSharedShape.

◆ r3SharedShape_ComputeAabb()

struct R3Aabb r3SharedShape_ComputeAabb ( const R3SharedShape * shape,
struct R3Pose pose )

Compute the shape axis-aligned bounds at the supplied world-space pose.

◆ r3SharedShape_ContainsPoint()

R3Bool r3SharedShape_ContainsPoint ( const R3SharedShape * shape,
struct R3Pose pose,
struct R3Vector point )

Test whether the world-space point lies inside the shape at pose.

◆ r3SharedShape_MassProperties()

struct R3MassProperties r3SharedShape_MassProperties ( const R3SharedShape * shape,
R3Real density )

Compute local mass properties for the supplied nonnegative density.

◆ r3SharedShape_Tessellate()

struct R3ShapeMesh * r3SharedShape_Tessellate ( const R3SharedShape * shape,
uint32_t subdivisions )

Return owned local-space rendering geometry; release it with r3FreeShapeMesh.

subdivisions controls curved-shape resolution.

◆ r3SharedShape_ToTrimesh()

struct R3TriMeshData * r3SharedShape_ToTrimesh ( const R3SharedShape * shape,
uint32_t ntheta,
uint32_t nphi )

Tessellate a ball or capsule with independent longitude/latitude subdivision counts.

Cuboids, cones, cylinders, convex polyhedra, trimeshes, and heightfields are also supported. ntheta (3 to 4096) is read by balls, capsules, cones and cylinders; nphi (2 to 4096) by balls and capsules. Other shapes ignore them.

◆ r3TriangleSharedShape()

R3SharedShape * r3TriangleSharedShape ( struct R3Vector a,
struct R3Vector b,
struct R3Vector c )

Create an owned triangle shape.

Release it with r3FreeSharedShape.

◆ r3TriMeshData_Indices()

size_t r3TriMeshData_Indices ( const struct R3TriMeshData * mesh,
uint32_t * buffer,
size_t capacity )

Flat triangle indices; count and capacity are numbers of u32 entries.

See also
Arrays and output buffers

◆ r3TriMeshData_Vertices()

size_t r3TriMeshData_Vertices ( const struct R3TriMeshData * mesh,
struct R3Vector * buffer,
size_t capacity )

Copy vertices.

See also
Arrays and output buffers

◆ r3TrimeshSharedShape()

R3SharedShape * r3TrimeshSharedShape ( struct R3VectorView vertices,
struct R3TriangleView indices )

Create an owned triangle mesh from vertices and triangle indices.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3TrimeshSharedShapeWithFlags()

R3SharedShape * r3TrimeshSharedShapeWithFlags ( struct R3VectorView vertices,
struct R3TriangleView indices,
uint32_t flags )

Create an owned triangle mesh with the supplied TRIMESH_* processing flags.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3VoxelizedMeshSharedShape()

R3SharedShape * r3VoxelizedMeshSharedShape ( struct R3VectorView vertices,
R3SurfaceElementView indices,
R3Real voxel_size )

Create an owned voxel shape from a surface mesh with the supplied uniform voxel size.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.

◆ r3VoxelsSharedShapeFromPoints()

R3SharedShape * r3VoxelsSharedShapeFromPoints ( struct R3Vector voxel_size,
struct R3VectorView points )

Create an owned voxel shape by quantizing points with the supplied per-axis voxel size.

Release it with r3FreeSharedShape. Copies typed input geometry into an owned shared shape; arrays may be released on return.