rtcore_scene.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. // Copyright 2009-2021 Intel Corporation
  2. // SPDX-License-Identifier: Apache-2.0
  3. #pragma once
  4. #include "rtcore_device.h"
  5. RTC_NAMESPACE_BEGIN
  6. /* Opaque traversable type */
  7. typedef struct RTCTraversableTy* RTCTraversable;
  8. /* Forward declarations for ray structures */
  9. struct RTCRayHit;
  10. struct RTCRayHit4;
  11. struct RTCRayHit8;
  12. struct RTCRayHit16;
  13. /* Scene flags */
  14. enum RTCSceneFlags
  15. {
  16. RTC_SCENE_FLAG_NONE = 0,
  17. RTC_SCENE_FLAG_DYNAMIC = (1 << 0),
  18. RTC_SCENE_FLAG_COMPACT = (1 << 1),
  19. RTC_SCENE_FLAG_ROBUST = (1 << 2),
  20. RTC_SCENE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS = (1 << 3),
  21. RTC_SCENE_FLAG_PREFETCH_USM_SHARED_ON_GPU = (1 << 4),
  22. };
  23. /* Additional arguments for rtcIntersect1/4/8/16 calls */
  24. struct RTCIntersectArguments
  25. {
  26. enum RTCRayQueryFlags flags; // intersection flags
  27. enum RTCFeatureFlags feature_mask; // selectively enable features for traversal
  28. struct RTCRayQueryContext* context; // optional pointer to ray query context
  29. RTCFilterFunctionN filter; // filter function to execute
  30. RTCIntersectFunctionN intersect; // user geometry intersection callback to execute
  31. #if RTC_MIN_WIDTH
  32. float minWidthDistanceFactor; // curve radius is set to this factor times distance to ray origin
  33. #endif
  34. };
  35. /* Initializes intersection arguments. */
  36. RTC_FORCEINLINE void rtcInitIntersectArguments(struct RTCIntersectArguments* args)
  37. {
  38. args->flags = RTC_RAY_QUERY_FLAG_INCOHERENT;
  39. args->feature_mask = RTC_FEATURE_FLAG_ALL;
  40. args->context = NULL;
  41. args->filter = NULL;
  42. args->intersect = NULL;
  43. #if RTC_MIN_WIDTH
  44. args->minWidthDistanceFactor = 0.0f;
  45. #endif
  46. }
  47. /* Additional arguments for rtcOccluded1/4/8/16 calls */
  48. struct RTCOccludedArguments
  49. {
  50. enum RTCRayQueryFlags flags; // intersection flags
  51. enum RTCFeatureFlags feature_mask; // selectively enable features for traversal
  52. struct RTCRayQueryContext* context; // optional pointer to ray query context
  53. RTCFilterFunctionN filter; // filter function to execute
  54. RTCOccludedFunctionN occluded; // user geometry occlusion callback to execute
  55. #if RTC_MIN_WIDTH
  56. float minWidthDistanceFactor; // curve radius is set to this factor times distance to ray origin
  57. #endif
  58. };
  59. /* Initializes an intersection arguments. */
  60. RTC_FORCEINLINE void rtcInitOccludedArguments(struct RTCOccludedArguments* args)
  61. {
  62. args->flags = RTC_RAY_QUERY_FLAG_INCOHERENT;
  63. args->feature_mask = RTC_FEATURE_FLAG_ALL;
  64. args->context = NULL;
  65. args->filter = NULL;
  66. args->occluded = NULL;
  67. #if RTC_MIN_WIDTH
  68. args->minWidthDistanceFactor = 0.0f;
  69. #endif
  70. }
  71. /* Creates a new scene. */
  72. RTC_API RTCScene rtcNewScene(RTCDevice device);
  73. /* Returns the device the scene got created in. The reference count of
  74. * the device is incremented by this function. */
  75. RTC_API RTCDevice rtcGetSceneDevice(RTCScene hscene);
  76. /* Retains the scene (increments the reference count). */
  77. RTC_API void rtcRetainScene(RTCScene scene);
  78. /* Releases the scene (decrements the reference count). */
  79. RTC_API void rtcReleaseScene(RTCScene scene);
  80. /* Returns the traversable object of the scene which can be passed to ray queries. */
  81. RTC_API RTCTraversable rtcGetSceneTraversable(RTCScene scene);
  82. /* Attaches the geometry to a scene. */
  83. RTC_API unsigned int rtcAttachGeometry(RTCScene scene, RTCGeometry geometry);
  84. /* Attaches the geometry to a scene using the specified geometry ID. */
  85. RTC_API void rtcAttachGeometryByID(RTCScene scene, RTCGeometry geometry, unsigned int geomID);
  86. /* Detaches the geometry from the scene. */
  87. RTC_API void rtcDetachGeometry(RTCScene scene, unsigned int geomID);
  88. /* Gets a geometry handle from the scene. This function is not thread safe and should get used during rendering. */
  89. RTC_API RTCGeometry rtcGetGeometry(RTCScene scene, unsigned int geomID);
  90. /* Gets a geometry handle from the scene. This function is thread safe and should NOT get used during rendering. */
  91. RTC_API RTCGeometry rtcGetGeometryThreadSafe(RTCScene scene, unsigned int geomID);
  92. /* Commits the scene. */
  93. RTC_API void rtcCommitScene(RTCScene scene);
  94. /* Commits the scene from multiple threads. */
  95. RTC_API void rtcJoinCommitScene(RTCScene scene);
  96. /* Progress monitor callback function */
  97. typedef bool (*RTCProgressMonitorFunction)(void* ptr, double n);
  98. /* Sets the progress monitor callback function of the scene. */
  99. RTC_API void rtcSetSceneProgressMonitorFunction(RTCScene scene, RTCProgressMonitorFunction progress, void* ptr);
  100. /* Sets the build quality of the scene. */
  101. RTC_API void rtcSetSceneBuildQuality(RTCScene scene, enum RTCBuildQuality quality);
  102. /* Sets the scene flags. */
  103. RTC_API void rtcSetSceneFlags(RTCScene scene, enum RTCSceneFlags flags);
  104. /* Returns the scene flags. */
  105. RTC_API enum RTCSceneFlags rtcGetSceneFlags(RTCScene scene);
  106. /* Returns the axis-aligned bounds of the scene. */
  107. RTC_API void rtcGetSceneBounds(RTCScene scene, struct RTCBounds* bounds_o);
  108. /* Returns the linear axis-aligned bounds of the scene. */
  109. RTC_API void rtcGetSceneLinearBounds(RTCScene scene, struct RTCLinearBounds* bounds_o);
  110. #if !defined(__SYCL_DEVICE_ONLY__)
  111. /* Gets the user-defined data pointer of the geometry. This function is not thread safe and should get used during rendering. */
  112. RTC_SYCL_API void* rtcGetGeometryUserDataFromScene(RTCScene scene, unsigned int geomID);
  113. /* Returns the interpolated transformation of an instance for the specified time. */
  114. RTC_SYCL_API void rtcGetGeometryTransformFromScene(RTCScene scene, unsigned int geomID, float time, enum RTCFormat format, void* xfm);
  115. /* Perform a closest point query of the scene. */
  116. RTC_API bool rtcPointQuery(RTCScene scene, struct RTCPointQuery* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void* userPtr);
  117. /* Perform a closest point query with a packet of 4 points with the scene. */
  118. RTC_API bool rtcPointQuery4(const int* valid, RTCScene scene, struct RTCPointQuery4* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  119. /* Perform a closest point query with a packet of 4 points with the scene. */
  120. RTC_API bool rtcPointQuery8(const int* valid, RTCScene scene, struct RTCPointQuery8* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  121. /* Perform a closest point query with a packet of 4 points with the scene. */
  122. RTC_API bool rtcPointQuery16(const int* valid, RTCScene scene, struct RTCPointQuery16* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  123. /* Intersects a single ray with the scene. */
  124. RTC_SYCL_API void rtcIntersect1(RTCScene scene, struct RTCRayHit* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  125. /* Intersects a packet of 4 rays with the scene. */
  126. RTC_API void rtcIntersect4(const int* valid, RTCScene scene, struct RTCRayHit4* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  127. /* Intersects a packet of 8 rays with the scene. */
  128. RTC_API void rtcIntersect8(const int* valid, RTCScene scene, struct RTCRayHit8* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  129. /* Intersects a packet of 16 rays with the scene. */
  130. RTC_API void rtcIntersect16(const int* valid, RTCScene scene, struct RTCRayHit16* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  131. /* Forwards ray inside user geometry callback. */
  132. RTC_SYCL_API void rtcForwardIntersect1(const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay* ray, unsigned int instID);
  133. /* Forwards ray inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  134. RTC_SYCL_API void rtcForwardIntersect1Ex(const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay* ray, unsigned int instID, unsigned int instPrimID);
  135. /* Forwards ray packet of size 4 inside user geometry callback. */
  136. RTC_API void rtcForwardIntersect4(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay4* ray, unsigned int instID);
  137. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  138. RTC_API void rtcForwardIntersect4Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay4* ray, unsigned int instID, unsigned int primInstID);
  139. /* Forwards ray packet of size 8 inside user geometry callback. */
  140. RTC_API void rtcForwardIntersect8(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay8* ray, unsigned int instID);
  141. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  142. RTC_API void rtcForwardIntersect8Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay8* ray, unsigned int instID, unsigned int primInstID);
  143. /* Forwards ray packet of size 16 inside user geometry callback. */
  144. RTC_API void rtcForwardIntersect16(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay16* ray, unsigned int instID);
  145. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  146. RTC_API void rtcForwardIntersect16Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCScene scene, struct RTCRay16* ray, unsigned int instID, unsigned int primInstID);
  147. /* Tests a single ray for occlusion with the scene. */
  148. RTC_SYCL_API void rtcOccluded1(RTCScene scene, struct RTCRay* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  149. /* Tests a packet of 4 rays for occlusion occluded with the scene. */
  150. RTC_API void rtcOccluded4(const int* valid, RTCScene scene, struct RTCRay4* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  151. /* Tests a packet of 8 rays for occlusion with the scene. */
  152. RTC_API void rtcOccluded8(const int* valid, RTCScene scene, struct RTCRay8* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  153. /* Tests a packet of 16 rays for occlusion with the scene. */
  154. RTC_API void rtcOccluded16(const int* valid, RTCScene scene, struct RTCRay16* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  155. /* Forwards single occlusion ray inside user geometry callback. */
  156. RTC_SYCL_API void rtcForwardOccluded1(const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay* ray, unsigned int instID);
  157. /* Forwards single occlusion ray inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  158. RTC_SYCL_API void rtcForwardOccluded1Ex(const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay* ray, unsigned int instID, unsigned int instPrimID);
  159. /* Forwards occlusion ray packet of size 4 inside user geometry callback. */
  160. RTC_API void rtcForwardOccluded4(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay4* ray, unsigned int instID);
  161. /* Forwards occlusion ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  162. RTC_API void rtcForwardOccluded4Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay4* ray, unsigned int instID, unsigned int instPrimID);
  163. /* Forwards occlusion ray packet of size 8 inside user geometry callback. */
  164. RTC_API void rtcForwardOccluded8(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay8* ray, unsigned int instID);
  165. /* Forwards occlusion ray packet of size 8 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  166. RTC_API void rtcForwardOccluded8Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay8* ray, unsigned int instID, unsigned int instPrimID);
  167. /* Forwards occlusion ray packet of size 16 inside user geometry callback. */
  168. RTC_API void rtcForwardOccluded16(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay16* ray, unsigned int instID);
  169. /* Forwards occlusion ray packet of size 16 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  170. RTC_API void rtcForwardOccluded16Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCScene scene, struct RTCRay16* ray, unsigned int instID, unsigned int instPrimID);
  171. #endif
  172. /* Gets the user-defined data pointer of the geometry. This function is not thread safe and should get used during rendering. */
  173. RTC_SYCL_API void* rtcGetGeometryUserDataFromTraversable(RTCTraversable traversable, unsigned int geomID);
  174. /* Returns the interpolated transformation of an instance for the specified time. */
  175. RTC_SYCL_API void rtcGetGeometryTransformFromTraversable(RTCTraversable traversable, unsigned int geomID, float time, enum RTCFormat format, void* xfm);
  176. /* Perform a closest point query of the scene. */
  177. RTC_API bool rtcTraversablePointQuery(RTCTraversable traversable, struct RTCPointQuery* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void* userPtr);
  178. /* Perform a closest point query with a packet of 4 points with the scene. */
  179. RTC_API bool rtcTraversablePointQuery4(const int* valid, RTCTraversable traversable, struct RTCPointQuery4* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  180. /* Perform a closest point query with a packet of 4 points with the scene. */
  181. RTC_API bool rtcTraversablePointQuery8(const int* valid, RTCTraversable traversable, struct RTCPointQuery8* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  182. /* Perform a closest point query with a packet of 4 points with the scene. */
  183. RTC_API bool rtcTraversablePointQuery16(const int* valid, RTCTraversable traversable, struct RTCPointQuery16* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
  184. /* Intersects a single ray with the scene. */
  185. RTC_SYCL_API void rtcTraversableIntersect1(RTCTraversable traversable, struct RTCRayHit* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  186. /* Intersects a packet of 4 rays with the scene. */
  187. RTC_API void rtcTraversableIntersect4(const int* valid, RTCTraversable traversable, struct RTCRayHit4* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  188. /* Intersects a packet of 8 rays with the scene. */
  189. RTC_API void rtcTraversableIntersect8(const int* valid, RTCTraversable traversable, struct RTCRayHit8* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  190. /* Intersects a packet of 16 rays with the scene. */
  191. RTC_API void rtcTraversableIntersect16(const int* valid, RTCTraversable traversable, struct RTCRayHit16* rayhit, struct RTCIntersectArguments* args RTC_OPTIONAL_ARGUMENT);
  192. /* Forwards ray inside user geometry callback. */
  193. RTC_SYCL_API void rtcTraversableForwardIntersect1(const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay* ray, unsigned int instID);
  194. /* Forwards ray inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  195. RTC_SYCL_API void rtcTraversableForwardIntersect1Ex(const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay* ray, unsigned int instID, unsigned int instPrimID);
  196. /* Forwards ray packet of size 4 inside user geometry callback. */
  197. RTC_API void rtcTraversableForwardIntersect4(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay4* ray, unsigned int instID);
  198. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  199. RTC_API void rtcTraversableForwardIntersect4Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay4* ray, unsigned int instID, unsigned int primInstID);
  200. /* Forwards ray packet of size 8 inside user geometry callback. */
  201. RTC_API void rtcTraversableForwardIntersect8(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay8* ray, unsigned int instID);
  202. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  203. RTC_API void rtcTraversableForwardIntersect8Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay8* ray, unsigned int instID, unsigned int primInstID);
  204. /* Forwards ray packet of size 16 inside user geometry callback. */
  205. RTC_API void rtcTraversableForwardIntersect16(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay16* ray, unsigned int instID);
  206. /* Forwards ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  207. RTC_API void rtcTraversableForwardIntersect16Ex(const int* valid, const struct RTCIntersectFunctionNArguments* args, RTCTraversable traversable, struct RTCRay16* ray, unsigned int instID, unsigned int primInstID);
  208. /* Tests a single ray for occlusion with the scene. */
  209. RTC_SYCL_API void rtcTraversableOccluded1(RTCTraversable traversable, struct RTCRay* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  210. /* Tests a packet of 4 rays for occlusion occluded with the scene. */
  211. RTC_API void rtcTraversableOccluded4(const int* valid, RTCTraversable traversable, struct RTCRay4* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  212. /* Tests a packet of 8 rays for occlusion with the scene. */
  213. RTC_API void rtcTraversableOccluded8(const int* valid, RTCTraversable traversable, struct RTCRay8* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  214. /* Tests a packet of 16 rays for occlusion with the scene. */
  215. RTC_API void rtcTraversableOccluded16(const int* valid, RTCTraversable traversable, struct RTCRay16* ray, struct RTCOccludedArguments* args RTC_OPTIONAL_ARGUMENT);
  216. /* Forwards single occlusion ray inside user geometry callback. */
  217. RTC_SYCL_API void rtcTraversableForwardOccluded1(const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay* ray, unsigned int instID);
  218. /* Forwards single occlusion ray inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  219. RTC_SYCL_API void rtcTraversableForwardOccluded1Ex(const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay* ray, unsigned int instID, unsigned int instPrimID);
  220. /* Forwards occlusion ray packet of size 4 inside user geometry callback. */
  221. RTC_API void rtcTraversableForwardOccluded4(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay4* ray, unsigned int instID);
  222. /* Forwards occlusion ray packet of size 4 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  223. RTC_API void rtcTraversableForwardOccluded4Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay4* ray, unsigned int instID, unsigned int instPrimID);
  224. /* Forwards occlusion ray packet of size 8 inside user geometry callback. */
  225. RTC_API void rtcTraversableForwardOccluded8(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay8* ray, unsigned int instID);
  226. /* Forwards occlusion ray packet of size 8 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  227. RTC_API void rtcTraversableForwardOccluded8Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay8* ray, unsigned int instID, unsigned int instPrimID);
  228. /* Forwards occlusion ray packet of size 16 inside user geometry callback. */
  229. RTC_API void rtcTraversableForwardOccluded16(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay16* ray, unsigned int instID);
  230. /* Forwards occlusion ray packet of size 16 inside user geometry callback. Extended to handle instance arrays using instPrimID parameter. */
  231. RTC_API void rtcTraversableForwardOccluded16Ex(const int* valid, const struct RTCOccludedFunctionNArguments* args, RTCTraversable traversable, struct RTCRay16* ray, unsigned int instID, unsigned int instPrimID);
  232. /*! collision callback */
  233. struct RTCCollision { unsigned int geomID0; unsigned int primID0; unsigned int geomID1; unsigned int primID1; };
  234. typedef void (*RTCCollideFunc) (void* userPtr, struct RTCCollision* collisions, unsigned int num_collisions);
  235. /*! Performs collision detection of two scenes */
  236. RTC_API void rtcCollide (RTCScene scene0, RTCScene scene1, RTCCollideFunc callback, void* userPtr);
  237. #if defined(__cplusplus)
  238. /* Helper for easily combining scene flags */
  239. inline RTCSceneFlags operator|(RTCSceneFlags a, RTCSceneFlags b) {
  240. return (RTCSceneFlags)((size_t)a | (size_t)b);
  241. }
  242. #endif
  243. RTC_NAMESPACE_END