.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "rtcAttachGeometry" "3" "" "" "Embree Ray Tracing Kernels 4"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcAttachGeometry - attaches a geometry to the scene
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree4/rtcore.h>

unsigned int rtcAttachGeometry(
  RTCScene scene,
  RTCGeometry geometry
);
\f[R]
.fi
.SS DESCRIPTION
.PP
The \f[C]rtcAttachGeometry\f[R] function attaches a geometry
(\f[C]geometry\f[R] argument) to a scene (\f[C]scene\f[R] argument) and
assigns a geometry ID to that geometry.
All geometries attached to a scene are defined to be included inside the
scene.
A geometry can get attached to multiple scenes.
The geometry ID is unique for the scene, and is used to identify the
geometry when hit by a ray during ray queries.
.PP
This function is thread-safe, thus multiple threads can attach
geometries to a scene in parallel.
.PP
The geometry IDs are assigned sequentially, starting from 0, as long as
no geometry got detached.
If geometries got detached, the implementation will reuse IDs in an
implementation dependent way.
Consequently sequential assignment is no longer guaranteed, but a
compact range of IDs.
.PP
These rules allow the application to manage a dynamic array to
efficiently map from geometry IDs to its own geometry representation.
Alternatively, the application can also use per-geometry user data to
map to its geometry representation.
See \f[C]rtcSetGeometryUserData\f[R] and
\f[C]rtcGetGeometryUserData\f[R] for more information.
.SS EXIT STATUS
.PP
On failure an error code is set that can be queried using
\f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
.PP
[rtcSetGeometryUserData], [rtcGetGeometryUserData]
