| 531 | } |
| 532 | |
| 533 | Sphere* 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 | |
| 554 | Sphere* createAnalyticalSpheres (RTCScene scene, unsigned int N) |
| 555 | { |
no test coverage detected