HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rtcore_scene.h
Go to the documentation of this file.
1 // ======================================================================== //
2 // Copyright 2009-2018 Intel Corporation //
3 // //
4 // Licensed under the Apache License, Version 2.0 (the "License"); //
5 // you may not use this file except in compliance with the License. //
6 // You may obtain a copy of the License at //
7 // //
8 // http://www.apache.org/licenses/LICENSE-2.0 //
9 // //
10 // Unless required by applicable law or agreed to in writing, software //
11 // distributed under the License is distributed on an "AS IS" BASIS, //
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
13 // See the License for the specific language governing permissions and //
14 // limitations under the License. //
15 // ======================================================================== //
16 
17 #pragma once
18 
19 #include "rtcore_device.h"
20 
22 
23 /* Forward declarations for ray structures */
24 struct RTCRayHit;
25 struct RTCRayHit4;
26 struct RTCRayHit8;
27 struct RTCRayHit16;
28 struct RTCRayHitNp;
29 
30 /* Scene flags */
32 {
38 };
39 
40 /* Creates a new scene. */
42 
43 /* Retains the scene (increments the reference count). */
44 RTC_API void rtcRetainScene(RTCScene scene);
45 
46 /* Releases the scene (decrements the reference count). */
47 RTC_API void rtcReleaseScene(RTCScene scene);
48 
49 
50 /* Attaches the geometry to a scene. */
51 RTC_API unsigned int rtcAttachGeometry(RTCScene scene, RTCGeometry geometry);
52 
53 /* Attaches the geometry to a scene using the specified geometry ID. */
54 RTC_API void rtcAttachGeometryByID(RTCScene scene, RTCGeometry geometry, unsigned int geomID);
55 
56 /* Detaches the geometry from the scene. */
57 RTC_API void rtcDetachGeometry(RTCScene scene, unsigned int geomID);
58 
59 /* Gets a geometry handle from the scene. */
60 RTC_API RTCGeometry rtcGetGeometry(RTCScene scene, unsigned int geomID);
61 
62 
63 /* Commits the scene. */
64 RTC_API void rtcCommitScene(RTCScene scene);
65 
66 /* Commits the scene from multiple threads. */
68 
69 
70 /* Progress monitor callback function */
71 typedef bool (*RTCProgressMonitorFunction)(void* ptr, double n);
72 
73 /* Sets the progress monitor callback function of the scene. */
75 
76 /* Sets the build quality of the scene. */
78 
79 /* Sets the scene flags. */
81 
82 /* Returns the scene flags. */
84 
85 /* Returns the axis-aligned bounds of the scene. */
86 RTC_API void rtcGetSceneBounds(RTCScene scene, struct RTCBounds* bounds_o);
87 
88 /* Returns the linear axis-aligned bounds of the scene. */
89 RTC_API void rtcGetSceneLinearBounds(RTCScene scene, struct RTCLinearBounds* bounds_o);
90 
91 /* Perform a closest point query of the scene. */
92 RTC_API bool rtcPointQuery(RTCScene scene, struct RTCPointQuery* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void* userPtr);
93 
94 /* Perform a closest point query with a packet of 4 points with the scene. */
95 RTC_API bool rtcPointQuery4(const int* valid, RTCScene scene, struct RTCPointQuery4* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
96 
97 /* Perform a closest point query with a packet of 4 points with the scene. */
98 RTC_API bool rtcPointQuery8(const int* valid, RTCScene scene, struct RTCPointQuery8* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
99 
100 /* Perform a closest point query with a packet of 4 points with the scene. */
101 RTC_API bool rtcPointQuery16(const int* valid, RTCScene scene, struct RTCPointQuery16* query, struct RTCPointQueryContext* context, RTCPointQueryFunction queryFunc, void** userPtr);
102 
103 /* Intersects a single ray with the scene. */
104 RTC_API void rtcIntersect1(RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit* rayhit);
105 
106 /* Intersects a packet of 4 rays with the scene. */
107 RTC_API void rtcIntersect4(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit4* rayhit);
108 
109 /* Intersects a packet of 8 rays with the scene. */
110 RTC_API void rtcIntersect8(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit8* rayhit);
111 
112 /* Intersects a packet of 16 rays with the scene. */
113 RTC_API void rtcIntersect16(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit16* rayhit);
114 
115 /* Intersects a stream of M rays with the scene. */
116 RTC_API void rtcIntersect1M(RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit* rayhit, unsigned int M, size_t byteStride);
117 
118 /* Intersects a stream of pointers to M rays with the scene. */
119 RTC_API void rtcIntersect1Mp(RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHit** rayhit, unsigned int M);
120 
121 /* Intersects a stream of M ray packets of size N in SOA format with the scene. */
122 RTC_API void rtcIntersectNM(RTCScene scene, struct RTCIntersectContext* context, struct RTCRayHitN* rayhit, unsigned int N, unsigned int M, size_t byteStride);
123 
124 /* Intersects a stream of M ray packets of size N in SOA format with the scene. */
125 RTC_API void rtcIntersectNp(RTCScene scene, struct RTCIntersectContext* context, const struct RTCRayHitNp* rayhit, unsigned int N);
126 
127 /* Tests a single ray for occlusion with the scene. */
128 RTC_API void rtcOccluded1(RTCScene scene, struct RTCIntersectContext* context, struct RTCRay* ray);
129 
130 /* Tests a packet of 4 rays for occlusion occluded with the scene. */
131 RTC_API void rtcOccluded4(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRay4* ray);
132 
133 /* Tests a packet of 8 rays for occlusion with the scene. */
134 RTC_API void rtcOccluded8(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRay8* ray);
135 
136 /* Tests a packet of 16 rays for occlusion with the scene. */
137 RTC_API void rtcOccluded16(const int* valid, RTCScene scene, struct RTCIntersectContext* context, struct RTCRay16* ray);
138 
139 /* Tests a stream of M rays for occlusion with the scene. */
140 RTC_API void rtcOccluded1M(RTCScene scene, struct RTCIntersectContext* context, struct RTCRay* ray, unsigned int M, size_t byteStride);
141 
142 /* Tests a stream of pointers to M rays for occlusion with the scene. */
143 RTC_API void rtcOccluded1Mp(RTCScene scene, struct RTCIntersectContext* context, struct RTCRay** ray, unsigned int M);
144 
145 /* Tests a stream of M ray packets of size N in SOA format for occlusion with the scene. */
146 RTC_API void rtcOccludedNM(RTCScene scene, struct RTCIntersectContext* context, struct RTCRayN* ray, unsigned int N, unsigned int M, size_t byteStride);
147 
148 /* Tests a stream of M ray packets of size N in SOA format for occlusion with the scene. */
149 RTC_API void rtcOccludedNp(RTCScene scene, struct RTCIntersectContext* context, const struct RTCRayNp* ray, unsigned int N);
150 
151 #if defined(__cplusplus)
152 
153 /* Helper for easily combining scene flags */
154 inline RTCSceneFlags operator|(RTCSceneFlags a, RTCSceneFlags b) {
155  return (RTCSceneFlags)((size_t)a | (size_t)b);
156 }
157 
158 #endif
159 
161 
RTC_API void rtcCommitScene(RTCScene scene)
RTC_API void rtcGetSceneLinearBounds(RTCScene scene, struct RTCLinearBounds *bounds_o)
RTC_API bool rtcPointQuery4(const int *valid, RTCScene scene, struct RTCPointQuery4 *query, struct RTCPointQueryContext *context, RTCPointQueryFunction queryFunc, void **userPtr)
RTC_API void rtcOccluded8(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRay8 *ray)
RTC_API unsigned int rtcAttachGeometry(RTCScene scene, RTCGeometry geometry)
RTC_API void rtcOccluded1Mp(RTCScene scene, struct RTCIntersectContext *context, struct RTCRay **ray, unsigned int M)
RTC_API void rtcSetSceneFlags(RTCScene scene, enum RTCSceneFlags flags)
RTC_API void rtcOccludedNp(RTCScene scene, struct RTCIntersectContext *context, const struct RTCRayNp *ray, unsigned int N)
RTC_API void rtcAttachGeometryByID(RTCScene scene, RTCGeometry geometry, unsigned int geomID)
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
RTC_API void rtcIntersect1M(RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit *rayhit, unsigned int M, size_t byteStride)
GLenum query
Definition: glew.h:5704
RTC_API void rtcOccluded1M(RTCScene scene, struct RTCIntersectContext *context, struct RTCRay *ray, unsigned int M, size_t byteStride)
RTC_API void rtcSetSceneProgressMonitorFunction(RTCScene scene, RTCProgressMonitorFunction progress, void *ptr)
#define RTC_API
Definition: rtcore_config.h:65
typedefRTC_NAMESPACE_BEGIN struct RTCDeviceTy * RTCDevice
Definition: rtcore_device.h:24
RTC_API bool rtcPointQuery(RTCScene scene, struct RTCPointQuery *query, struct RTCPointQueryContext *context, RTCPointQueryFunction queryFunc, void *userPtr)
RTCBuildQuality
RTC_API void rtcIntersect1(RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit *rayhit)
RTC_API enum RTCSceneFlags rtcGetSceneFlags(RTCScene scene)
RTC_API void rtcReleaseScene(RTCScene scene)
struct RTCGeometryTy * RTCGeometry
RTC_API void rtcGetSceneBounds(RTCScene scene, struct RTCBounds *bounds_o)
RTC_API RTCScene rtcNewScene(RTCDevice device)
RTC_API void rtcOccludedNM(RTCScene scene, struct RTCIntersectContext *context, struct RTCRayN *ray, unsigned int N, unsigned int M, size_t byteStride)
RTC_API void rtcIntersect16(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit16 *rayhit)
RTC_API bool rtcPointQuery8(const int *valid, RTCScene scene, struct RTCPointQuery8 *query, struct RTCPointQueryContext *context, RTCPointQueryFunction queryFunc, void **userPtr)
GLsizei n
Definition: glew.h:4040
RTC_API void rtcIntersect4(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit4 *rayhit)
RTC_API void rtcIntersectNM(RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHitN *rayhit, unsigned int N, unsigned int M, size_t byteStride)
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
RTC_API void rtcOccluded4(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRay4 *ray)
#define RTC_NAMESPACE_END
Definition: rtcore_config.h:33
struct RTCRayNp ray
Definition: rtcore_ray.h:224
RTC_API void rtcSetSceneBuildQuality(RTCScene scene, enum RTCBuildQuality quality)
const void * ptr(const T *p)
Definition: format.h:3292
RTC_API void rtcOccluded16(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRay16 *ray)
typedefRTC_NAMESPACE_BEGIN struct RTCSceneTy * RTCScene
GA_API const UT_StringHolder N
bool(* RTCProgressMonitorFunction)(void *ptr, double n)
Definition: rtcore_scene.h:71
RTC_API bool rtcPointQuery16(const int *valid, RTCScene scene, struct RTCPointQuery16 *query, struct RTCPointQueryContext *context, RTCPointQueryFunction queryFunc, void **userPtr)
RTC_API void rtcRetainScene(RTCScene scene)
RTC_API void rtcJoinCommitScene(RTCScene scene)
RTC_API void rtcIntersect8(const int *valid, RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit8 *rayhit)
RTC_API void rtcIntersect1Mp(RTCScene scene, struct RTCIntersectContext *context, struct RTCRayHit **rayhit, unsigned int M)
RTC_API void rtcIntersectNp(RTCScene scene, struct RTCIntersectContext *context, const struct RTCRayHitNp *rayhit, unsigned int N)
RTCSceneFlags
Definition: rtcore_scene.h:31
bool(* RTCPointQueryFunction)(struct RTCPointQueryFunctionArguments *args)
RTC_API void rtcDetachGeometry(RTCScene scene, unsigned int geomID)
#define RTC_NAMESPACE_BEGIN
Definition: rtcore_config.h:32
RTC_API void rtcOccluded1(RTCScene scene, struct RTCIntersectContext *context, struct RTCRay *ray)
RTC_API RTCGeometry rtcGetGeometry(RTCScene scene, unsigned int geomID)