1rtcSetGeometryBoundsFunctiEomnb(r3e)e Ray Tracing KernretlcsSe3tGeometryBoundsFunction(3)
2
3
4
5 NAME
6 rtcSetGeometryBoundsFunction - sets a callback to query the
7 bounding box of user-defined primitives
8
9 SYNOPSIS
10 #include <embree3/rtcore.h>
11
12 struct RTCBoundsFunctionArguments
13 {
14 void* geometryUserPtr;
15 unsigned int primID;
16 unsigned int timeStep;
17 struct RTCBounds* bounds_o;
18 };
19
20 typedef void (*RTCBoundsFunction)(
21 const struct RTCBoundsFunctionArguments* args
22 );
23
24 void rtcSetGeometryBoundsFunction(
25 RTCGeometry geometry,
26 RTCBoundsFunction bounds,
27 void* userPtr
28 );
29
30 DESCRIPTION
31 The rtcSetGeometryBoundsFunction function registers a bounding box
32 callback function (bounds argument) with payload (userPtr argument) for
33 the specified user geometry (geometry argument).
34
35 Only a single callback function can be registered per geometry, and
36 further invocations overwrite the previously set callback function.
37 Passing NULL as function pointer disables the registered callback func‐
38 tion.
39
40 The registered bounding box callback function is invoked to calculate
41 axis-aligned bounding boxes of the primitives of the user-defined geom‐
42 etry during spatial acceleration structure construction. The bounding
43 box callback of RTCBoundsFunction type is invoked with a pointer to a
44 structure of type RTCBoundsFunctionArguments which contains various ar‐
45 guments, such as: the user data of the geometry (geometryUserPtr mem‐
46 ber), the ID of the primitive to calculate the bounds for (primID mem‐
47 ber), the time step at which to calculate the bounds (timeStep member),
48 and a memory location to write the calculated bound to (bounds_o mem‐
49 ber).
50
51 In a typical usage scenario one would store a pointer to the internal
52 representation of the user geometry object using rtcSetGeometryUserDa‐
53 ta. The callback function can then read that pointer from the geome‐
54 tryUserPtr field and calculate the proper bounding box for the request‐
55 ed primitive and time, and store that bounding box to the destination
56 structure (bounds_o member).
57
58 EXIT STATUS
59 On failure an error code is set that can be queried using rtcGetDe‐
60 viceError.
61
62 SEE ALSO
63 [RTC_GEOMETRY_TYPE_USER]
64
65
66
67 rtcSetGeometryBoundsFunction(3)