| 140 | } |
| 141 | |
| 142 | Vector3 GeneratePointOnSphere(const BoundingSphere& sphere) |
| 143 | { |
| 144 | float u = GenerateFloat(0.0f, 1.0f); |
| 145 | float v = GenerateFloat(0.0f, 1.0f); |
| 146 | |
| 147 | float theta = u * PI_MUL_2; |
| 148 | float phi = acos((v * 2) - 1.0f); |
| 149 | |
| 150 | auto relPoint = Vector3( |
| 151 | sin(phi) * cos(theta), |
| 152 | sin(phi) * sin(theta), |
| 153 | cos(phi)); |
| 154 | return (sphere.Center + (relPoint * sphere.Radius)); |
| 155 | } |
| 156 | |
| 157 | Vector3 GeneratePointInSpheroid(const Vector3& center, const EulerAngles& orient, const Vector3& semiMajorAxis) |
| 158 | { |
no test coverage detected