| 118 | }; |
| 119 | |
| 120 | inline float updateEdgeLevel(const Vec3fa& cam_pos, Vec3fa* vtx, unsigned int* indices, const unsigned int e0, const unsigned int e1) |
| 121 | { |
| 122 | const Vec3fa v0 = vtx[indices[e0]]; |
| 123 | const Vec3fa v1 = vtx[indices[e1]]; |
| 124 | const Vec3fa edge = v1-v0; |
| 125 | const Vec3fa P = 0.5f*(v1+v0); |
| 126 | const Vec3fa dist = Vec3fa(cam_pos) - P; |
| 127 | const float level = max(min(LEVEL_FACTOR*(0.5f*length(edge)/length(dist)),MAX_EDGE_LEVEL),MIN_EDGE_LEVEL); |
| 128 | return level; |
| 129 | } |
| 130 | |
| 131 | /* adds a subdiv cube to the scene */ |
| 132 | unsigned int addTriangleSubdivCube (RTCScene scene_i, const Vec3fa& pos) |
no test coverage detected