MCPcopy Create free account
hub / github.com/RenderKit/ospray / addGeometryInstance

Function addGeometryInstance

modules/cpu/common/World.cpp:16–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14// Embree helper functions ///////////////////////////////////////////////////
15
16static void addGeometryInstance(RTCScene &scene,
17 RTCScene instScene,
18 Instance *inst,
19 RTCDevice embreeDevice,
20 unsigned int id)
21{
22 if (!embreeDevice)
23 throw std::runtime_error("invalid Embree device");
24
25 // Create parent scene if not yet created
26 if (!scene)
27 scene = rtcNewScene(embreeDevice);
28
29 // Create geometry instance
30 auto eInst = rtcNewGeometry(embreeDevice, RTC_GEOMETRY_TYPE_INSTANCE);
31 rtcSetGeometryInstancedScene(eInst, instScene);
32 rtcAttachGeometryByID(scene, eInst, id);
33 inst->setEmbreeGeom(scene, id);
34 rtcReleaseGeometry(eInst);
35}
36
37static void freeAndNullifyEmbreeScene(RTCScene &scene)
38{

Callers 1

commitMethod · 0.85

Calls 1

setEmbreeGeomMethod · 0.80

Tested by

no test coverage detected