| 101 | } |
| 102 | |
| 103 | Vector3 GenerateDirectionInCone(const Vector3& dir, float semiangleInDeg) |
| 104 | { |
| 105 | float x = GenerateFloat(-semiangleInDeg, semiangleInDeg) * RADIAN; |
| 106 | float y = GenerateFloat(-semiangleInDeg, semiangleInDeg) * RADIAN; |
| 107 | float z = GenerateFloat(-semiangleInDeg, semiangleInDeg) * RADIAN; |
| 108 | auto rotMatrix = Matrix::CreateRotationX(x) * Matrix::CreateRotationY(y) * Matrix::CreateRotationZ(z); |
| 109 | |
| 110 | auto dirInCone = Vector3::TransformNormal(dir, rotMatrix); |
| 111 | dirInCone.Normalize(); |
| 112 | return dirInCone; |
| 113 | } |
| 114 | |
| 115 | Vector3 GeneratePointInBox(const BoundingOrientedBox& box) |
| 116 | { |
no test coverage detected