rtcAttachGeometryByID.3embree3 1.7 KB

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