| 215 | } |
| 216 | |
| 217 | bool NavMeshRuntime::FindRandomPoint(Vector3& result) const |
| 218 | { |
| 219 | ScopeLock lock(Locker); |
| 220 | const auto query = GetNavMeshQuery(); |
| 221 | if (!query || !_navMesh) |
| 222 | return false; |
| 223 | |
| 224 | dtQueryFilter filter; |
| 225 | InitFilter(filter); |
| 226 | |
| 227 | dtPolyRef randomPoly = 0; |
| 228 | Float3 randomPt; |
| 229 | if (!dtStatusSucceed(query->findRandomPoint(&filter, Random::Rand, &randomPoly, &randomPt.X))) |
| 230 | return false; |
| 231 | |
| 232 | Quaternion invRotation; |
| 233 | Quaternion::Invert(Properties.Rotation, invRotation); |
| 234 | Vector3::Transform(randomPt, invRotation, result); |
| 235 | |
| 236 | return true; |
| 237 | } |
| 238 | |
| 239 | bool NavMeshRuntime::FindRandomPointAroundCircle(const Vector3& center, float radius, Vector3& result) const |
| 240 | { |
nothing calls this directly
no test coverage detected