.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "rtcSetSceneProgressMonitorFunction" "3" "" "" "Embree Ray Tracing Kernels 4"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcSetSceneProgressMonitorFunction - registers a callback
  to track build progress
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree4/rtcore.h>

typedef bool (*RTCProgressMonitorFunction)(
  void* ptr,
  double n
);

void rtcSetSceneProgressMonitorFunction(
  RTCScene scene,
  RTCProgressMonitorFunction progress,
  void* userPtr
);
\f[R]
.fi
.SS DESCRIPTION
.PP
Embree supports a progress monitor callback mechanism that can be used
to report progress of hierarchy build operations and to cancel build
operations.
.PP
The \f[C]rtcSetSceneProgressMonitorFunction\f[R] registers a progress
monitor callback function (\f[C]progress\f[R] argument) with payload
(\f[C]userPtr\f[R] argument) for the specified scene (\f[C]scene\f[R]
argument).
.PP
Only a single callback function can be registered per scene, and further
invocations overwrite the previously set callback function.
Passing \f[C]NULL\f[R] as function pointer disables the registered
callback function.
.PP
Once registered, Embree will invoke the callback function multiple times
during hierarchy build operations of the scene, by passing the payload
as set at registration time (\f[C]userPtr\f[R] argument), and a double
in the range [0,\[u2006]1] which estimates the progress of the operation
(\f[C]n\f[R] argument).
The callback function might be called from multiple threads
concurrently.
.PP
When returning \f[C]true\f[R] from the callback function, Embree will
continue the build operation normally.
When returning \f[C]false\f[R], Embree will cancel the build operation
with the \f[C]RTC_ERROR_CANCELLED\f[R] error code.
Issuing multiple cancel requests for the same build operation is
allowed.
.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
[rtcNewScene]
