Rapier C — 2D / f64 0.36.0+c.0
Loading...
Searching...
No Matches
R2ShapeDesc Struct Reference

Non-owning shape description. More...

#include <rapier.h>

Data Fields

uint32_t kind
 Discriminant selecting which description fields are read.
struct R2Vector a
 Half extents, endpoint/vertex, or halfspace normal, selected by kind.
struct R2Vector b
 Second endpoint or triangle vertex, selected by kind.
struct R2Vector c
 Third triangle vertex.
R2Real radius
 Radius for the selected primitive or recipe.
R2Real halfHeight
 Half the height of a cylinder or cone.
R2Real borderRadius
 Rounding radius of a round cylinder or round cone (the round cuboid reads radius instead).
struct R2VectorView vertices
 Borrowed vertex positions.
struct R2TriangleView triangles
 Borrowed triangle topology; count is triangles.
struct R2EdgeView edges
 Borrowed edge topology; count is edges.
uint32_t flags
 TRIMESH_*, POLYLINE_*, or HEIGHTFIELD_* bitmask selected by kind.
struct R2RealView heights
 Borrowed height samples; 3D uses column-major rows * columns samples.
size_t rows
 Number of heightfield rows.
size_t columns
 Number of heightfield columns.
struct R2Vector scale
 Shape scale along each axis.
const R2SharedShape * sharedShape
 Borrowed shared geometry; keep its wrapper alive through build/insert.
struct R2CompoundShapeView children
 Borrowed compound children and their nested geometry views.

Detailed Description

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.

Field Documentation

◆ a

struct R2Vector R2ShapeDesc::a

Half extents, endpoint/vertex, or halfspace normal, selected by kind.

◆ b

struct R2Vector R2ShapeDesc::b

Second endpoint or triangle vertex, selected by kind.

◆ borderRadius

R2Real R2ShapeDesc::borderRadius

Rounding radius of a round cylinder or round cone (the round cuboid reads radius instead).

◆ c

struct R2Vector R2ShapeDesc::c

Third triangle vertex.

◆ children

struct R2CompoundShapeView R2ShapeDesc::children

Borrowed compound children and their nested geometry views.

◆ columns

size_t R2ShapeDesc::columns

Number of heightfield columns.

◆ edges

struct R2EdgeView R2ShapeDesc::edges

Borrowed edge topology; count is edges.

◆ flags

uint32_t R2ShapeDesc::flags

TRIMESH_*, POLYLINE_*, or HEIGHTFIELD_* bitmask selected by kind.

◆ halfHeight

R2Real R2ShapeDesc::halfHeight

Half the height of a cylinder or cone.

◆ heights

struct R2RealView R2ShapeDesc::heights

Borrowed height samples; 3D uses column-major rows * columns samples.

◆ kind

uint32_t R2ShapeDesc::kind

Discriminant selecting which description fields are read.

◆ radius

R2Real R2ShapeDesc::radius

Radius for the selected primitive or recipe.

◆ rows

size_t R2ShapeDesc::rows

Number of heightfield rows.

◆ scale

struct R2Vector R2ShapeDesc::scale

Shape scale along each axis.

◆ sharedShape

const R2SharedShape* R2ShapeDesc::sharedShape

Borrowed shared geometry; keep its wrapper alive through build/insert.

◆ triangles

struct R2TriangleView R2ShapeDesc::triangles

Borrowed triangle topology; count is triangles.

◆ vertices

struct R2VectorView R2ShapeDesc::vertices

Borrowed vertex positions.


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