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

Function createAnalyticalSphere

tutorials/user_geometry/user_geometry_device.cpp:533–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533Sphere* createAnalyticalSphere (RTCScene scene, const Vec3fa& p, float r)
534{
535 RTCGeometry geom = rtcNewGeometry(g_device, RTC_GEOMETRY_TYPE_USER);
536 Sphere* sphere = (Sphere*) alignedUSMMalloc(sizeof(Sphere),16);
537 sphere->type = USER_GEOMETRY_SPHERE;
538 sphere->p = p;
539 sphere->r = r;
540 sphere->geometry = geom;
541 sphere->geomID = rtcAttachGeometry(scene,geom);
542 rtcSetGeometryUserPrimitiveCount(geom,1);
543 rtcSetGeometryUserData(geom,sphere);
544 rtcSetGeometryBoundsFunction(geom,sphereBoundsFunc,nullptr);
545#if !USE_ARGUMENT_CALLBACKS
546 rtcSetGeometryIntersectFunction(geom,sphereIntersectFuncPtr);
547 rtcSetGeometryOccludedFunction (geom,sphereOccludedFuncPtr);
548#endif
549 rtcCommitGeometry(geom);
550 rtcReleaseGeometry(geom);
551 return sphere;
552}
553
554Sphere* createAnalyticalSpheres (RTCScene scene, unsigned int N)
555{

Callers 1

device_initFunction · 0.85

Calls 9

alignedUSMMallocFunction · 0.85
rtcAttachGeometryFunction · 0.85
rtcSetGeometryUserDataFunction · 0.85
rtcCommitGeometryFunction · 0.85
rtcReleaseGeometryFunction · 0.85

Tested by

no test coverage detected