.\" Automatically generated by Pandoc 2.5
.\"
.TH "rtcCollide" "3" "" "" "Embree Ray Tracing Kernels 3"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcCollide \- intersects one BVH with another
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree3/rtcore.h>

struct RTCCollision {
  unsigned int geomID0, primID0;
  unsigned int geomID1, primID1;
};

typedef void (*RTCCollideFunc) (
  void* userPtr,
  RTCCollision* collisions,
  size_t num_collisions);

void rtcCollide (
    RTCScene hscene0, 
    RTCScene hscene1, 
    RTCCollideFunc callback, 
    void* userPtr
);
\f[R]
.fi
.SS DESCRIPTION
.PP
The \f[C]rtcCollide\f[R] function intersects the BVH of
\f[C]hscene0\f[R] with the BVH of scene \f[C]hscene1\f[R] and calls a
user defined callback function (e.g \f[C]callback\f[R] argument) for
each pair of intersecting primitives between the two scenes.
A user defined data pointer (\f[C]userPtr\f[R] argument) can also be
passed in.
.PP
For every pair of primitives that may intersect each other, the callback
function (\f[C]callback\f[R] argument) is called.
The user will be provided with the primID\[cq]s and geomID\[cq]s of
multiple potentially intersecting primitive pairs.
Currently, only scene entirely composed of user geometries are
supported, thus the user is expected to implement a primitive/primitive
intersection to filter out false positives in the callback function.
The \f[C]userPtr\f[R] argument can be used to input geometry data of the
scene or output results of the intersection query.
.SS SUPPORTED PRIMITIVES
.PP
Currently, the only supported type is the user geometry type (see
[RTC_GEOMETRY_TYPE_USER]).
.SS EXIT STATUS
.PP
On failure an error code is set that can be queried using
\f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
