| 88 | } |
| 89 | |
| 90 | Vector3 GenerateDirection() |
| 91 | { |
| 92 | float theta = GenerateFloat(0.0f, PI_MUL_2); // Generate angle in full circle. |
| 93 | float phi = GenerateFloat(0.0f, PI); // Generate angle in sphere's upper half. |
| 94 | |
| 95 | auto dir = Vector3( |
| 96 | sin(phi) * cos(theta), |
| 97 | sin(phi) * sin(theta), |
| 98 | cos(phi)); |
| 99 | dir.Normalize(); |
| 100 | return dir; |
| 101 | } |
| 102 | |
| 103 | Vector3 GenerateDirectionInCone(const Vector3& dir, float semiangleInDeg) |
| 104 | { |
no test coverage detected