Rapier C — 2D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
Arrays and output buffers

Input views pair a pointer with an element count.

NULL is allowed with count zero. Counts for typed views are elements: TriangleView counts triangles, not scalar indices. Description setters borrow the view; they need not validate geometry until a later build/insert call.

Functions accepting buffer and capacity and returning a size use this protocol:

  1. Pass NULL and capacity zero to get the required element count (OK).
  2. Allocate that many elements and call again to copy them.
  3. If too small, the function returns the required count, reports BUFFER_TOO_SMALL, and writes no elements. Resize and retry.

Check LastStatus after both calls. Arrays may grow between calls if the application mutates the source. Returned counts use the declared element type; some geometry outputs are flattened scalar indices, explicitly documented by that function. String-copy functions count bytes including the terminating NUL. ByteView is an exception: it borrows snapshot storage directly until FreeBytes, with no copy.