uniformly sample volume of a sphere using dart throwing
| 385 | |
| 386 | // uniformly sample volume of a sphere using dart throwing |
| 387 | inline Vec3 UniformSampleSphereVolume() |
| 388 | { |
| 389 | for(;;) |
| 390 | { |
| 391 | Vec3 v = RandVec3(); |
| 392 | if (Dot(v, v) < 1.0f) |
| 393 | return v; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | inline Vec3 UniformSampleSphere() |
| 398 | { |
no test coverage detected