MCPcopy Create free account
hub / github.com/RenderKit/embree / createLazyObject

Function createLazyObject

tutorials/lazy_geometry/lazy_geometry_device.cpp:208–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208LazyGeometry* createLazyObject (RTCScene scene, int userID, const Vec3fa& center, const float radius)
209{
210 LazyGeometry* instance = (LazyGeometry*) alignedUSMMalloc(sizeof(LazyGeometry),16);
211 instance->state = LAZY_INVALID;
212 instance->object = nullptr;
213 instance->userID = userID;
214 instance->center = center;
215 instance->radius = radius;
216 instance->geometry = rtcNewGeometry(g_device, RTC_GEOMETRY_TYPE_USER);
217 rtcSetGeometryUserPrimitiveCount(instance->geometry,1);
218 rtcSetGeometryUserData(instance->geometry,instance);
219 rtcSetGeometryBoundsFunction(instance->geometry,instanceBoundsFunc,nullptr);
220 rtcSetGeometryIntersectFunction(instance->geometry,instanceIntersectFuncN);
221 rtcSetGeometryOccludedFunction (instance->geometry,instanceOccludedFuncN);
222 rtcCommitGeometry(instance->geometry);
223 rtcAttachGeometry(scene,instance->geometry);
224 rtcReleaseGeometry(instance->geometry);
225
226 /* if we do not support the join mode then Embree also does not
227 * support lazy build */
228 if (!rtcGetDeviceProperty(g_device,RTC_DEVICE_PROPERTY_JOIN_COMMIT_SUPPORTED))
229 eagerCreate(instance);
230
231 return instance;
232}
233
234/* creates a ground plane */
235unsigned int createGroundPlane (RTCScene scene)

Callers 1

device_initFunction · 0.85

Calls 11

alignedUSMMallocFunction · 0.85
rtcSetGeometryUserDataFunction · 0.85
rtcCommitGeometryFunction · 0.85
rtcAttachGeometryFunction · 0.85
rtcReleaseGeometryFunction · 0.85
rtcGetDevicePropertyFunction · 0.85
eagerCreateFunction · 0.85

Tested by

no test coverage detected