rtcSetGeo...sFunction(3)
π rtcSetGeometryBoundsFunction π
okay bestie, welcome to the Embree Ray Tracing Kernels 3 manual page for rtcSetGeometryBoundsFunction (that's the rtcSetGeo...sFunction(3) one, iykyk β¨). grab a boba, sit down, we're learning about bounds callbacks π§
β¨ NAME β¨
rtcSetGeometryBoundsFunction β sets a callback to query the bounding box of user-defined primitives π«Ά
πΈ SYNOPSIS πΈ
#include <embree3/rtcore.h>
struct RTCBoundsFunctionArguments
{
void* geometryUserPtr;
unsigned int primID;
unsigned int timeStep;
struct RTCBounds* bounds_o;
};
typedef void (*RTCBoundsFunction)(
const struct RTCBoundsFunctionArguments* args
);
void rtcSetGeometryBoundsFunction(
RTCGeometry geometry,
RTCBoundsFunction bounds,
void* userPtr
);
π¦ DESCRIPTION π¦
so rtcSetGeometryBoundsFunction registers a bounding box callback function (that's the bounds argument) with payload (that's the userPtr argument) for the specified user geometry (the geometry argument). it's giving matchmaking, but for callbacks π
only a single callback function can be registered per geometry, bestie. and further invocations overwrite the previously set callback function β no stacking, no polygamy, one callback at a time π
passing NULL as function pointer disables the registered callback function. poof, gone, nothing left π
the registered bounding box callback function gets invoked to calculate axis-aligned bounding boxes of the primitives of the user-defined geometry during spatial acceleration structure construction. very main character energy honestly. the bounding box callback β which is of type RTCBoundsFunction β is invoked with a pointer to a structure of type RTCBoundsFunctionArguments, and that struct contains various arguments, such as:
- the user data of the geometry (the
geometryUserPtrmember) π - the ID of the primitive to calculate the bounds for (the
primIDmember) π₯ - the time step at which to calculate the bounds (the
timeStepmember) β - and a memory location to write the calculated bound to (the
bounds_omember) π
in a typical usage scenario one would store a pointer to the internal representation of the user geometry object using rtcSetGeometryUserData. then the callback function can read that pointer from the geometryUserPtr field, calculate the proper bounding box for the requested primitive and time, and store that bounding box to the destination structure (the bounds_o member). it's literally a lil relay race of pointers and we're obsessed π
π EXIT STATUS π
on failure an error code is set that can be queried using rtcGetDeviceError. not the vibe, but at least you can check π
π SEE ALSO π
- [
RTC_GEOMETRY_TYPE_USER]
<div style="text-align:right">okay that's the whole page bestie!! this was rtcSetGeometryBoundsFunction from Embree Ray Tracing Kernels 3 (yes, the rtcSetGeo...sFunction(3) one) π go forth and calculate ur bounds, no cap β¨ππ¦</div>
π¦ where this page comes from
- epel 9: embree 3.13.5-4.el9 Β· Apache-2.0
- fedora 43: embree3 3.13.5-9.fc41 Β· Apache-2.0
- fedora 44: embree3 3.13.5-16.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms