| 406 | return *this; |
| 407 | } |
| 408 | IC SelfRef random_dir(CRandom& R = ::Random) |
| 409 | { |
| 410 | // z = R.randF(-1,1); |
| 411 | z = _cos(R.randF(PI)); |
| 412 | T a = R.randF(PI_MUL_2); |
| 413 | T r = _sqrt(1 - z * z); |
| 414 | T sa = _sin(a); |
| 415 | T ca = _cos(a); |
| 416 | x = r * ca; |
| 417 | y = r * sa; |
| 418 | return *this; |
| 419 | }; |
| 420 | IC SelfRef random_dir(const Self& ConeAxis, float ConeAngle, CRandom& R = ::Random) |
| 421 | { |
| 422 | Self rnd; |
no test coverage detected