.\" Automatically generated by Pandoc 3.1.11.1 .\" .TH "rtcSetGeometryBoundsFunction" "3" "" "" "Embree Ray Tracing Kernels 4" .SS NAME .IP .EX rtcSetGeometryBoundsFunction \- sets a callback to query the bounding box of user\-defined primitives .EE .SS SYNOPSIS .IP .EX #include 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 ); .EE .SS DESCRIPTION The \f[CR]rtcSetGeometryBoundsFunction\f[R] function registers a bounding box callback function (\f[CR]bounds\f[R] argument) with payload (\f[CR]userPtr\f[R] argument) for the specified user geometry (\f[CR]geometry\f[R] argument). .PP Only a single callback function can be registered per geometry, and further invocations overwrite the previously set callback function. Passing \f[CR]NULL\f[R] as function pointer disables the registered callback function. .PP In SYCL mode the BVH construction is done on the host and the passed function pointer must be a host\-side function pointer. .PP The registered bounding box callback function is invoked to calculate axis\-aligned bounding boxes of the primitives of the user\-defined geometry during spatial acceleration structure construction. The bounding box callback of \f[CR]RTCBoundsFunction\f[R] type is invoked with a pointer to a structure of type \f[CR]RTCBoundsFunctionArguments\f[R] which contains various arguments, such as: the user data of the geometry (\f[CR]geometryUserPtr\f[R] member), the ID of the primitive to calculate the bounds for (\f[CR]primID\f[R] member), the time step at which to calculate the bounds (\f[CR]timeStep\f[R] member), and a memory location to write the calculated bound to (\f[CR]bounds_o\f[R] member). .PP In a typical usage scenario one would store a pointer to the internal representation of the user geometry object using \f[CR]rtcSetGeometryUserData\f[R]. The callback function can then read that pointer from the \f[CR]geometryUserPtr\f[R] field and calculate the proper bounding box for the requested primitive and time, and store that bounding box to the destination structure (\f[CR]bounds_o\f[R] member). .SS EXIT STATUS On failure an error code is set that can be queried using \f[CR]rtcGetDeviceError\f[R]. .SS SEE ALSO [RTC_GEOMETRY_TYPE_USER]