1% rtcAttachGeometryByID(3) | Embree Ray Tracing Kernels 3
2
3#### NAME
4
5    rtcAttachGeometryByID - attaches a geometry to the scene
6      using a specified geometry ID
7
8#### SYNOPSIS
9
10    #include <embree3/rtcore.h>
11
12    void rtcAttachGeometryByID(
13      RTCScene scene,
14      RTCGeometry geometry,
15      unsigned int geomID
16    );
17
18#### DESCRIPTION
19
20The `rtcAttachGeometryByID` function attaches a geometry (`geometry`
21argument) to a scene (`scene` argument) and assigns a user provided
22geometry ID (`geomID` argument) to that geometry. All geometries
23attached to a scene are defined to be included inside the scene. A
24geometry can get attached to multiple scenes. The passed user-defined
25geometry ID is used to identify the geometry when hit by a ray during
26ray queries. Using this function, it is possible to share the same IDs
27to refer to geometries inside the application and Embree.
28
29This function is thread-safe, thus multiple threads can attach
30geometries to a scene in parallel.
31
32The user-provided geometry ID must be unused in the scene, otherwise
33the creation of the geometry will fail. Further, the user-provided
34geometry IDs should be compact, as Embree internally creates a vector
35which size is equal to the largest geometry ID used. Creating very
36large geometry IDs for small scenes would thus cause a memory
37consumption and performance overhead.
38
39#### EXIT STATUS
40
41On failure an error code is set that can be queried using
42`rtcGetDeviceError`.
43
44#### SEE ALSO
45
46[rtcAttachGeometry]
47