Add support for multiple navmeshes on a scene

This commit is contained in:
Wojtek Figat
2021-01-13 14:28:46 +01:00
parent dba43c4e9f
commit 27ed23c1b9
15 changed files with 1012 additions and 626 deletions

View File

@@ -12,8 +12,9 @@
class MeshCollider;
class Level;
class NavigationScene;
class ReloadScriptsAction;
class NavMeshBoundsVolume;
class NavMesh;
/// <summary>
/// The scene root object that contains a hierarchy of actors.
@@ -69,11 +70,6 @@ public:
/// </summary>
CSG::SceneCSGData CSGData;
/// <summary>
/// The navigation scene (always valid).
/// </summary>
NavigationScene* Navigation;
/// <summary>
/// Gets the lightmap settings (per scene).
/// </summary>
@@ -85,6 +81,31 @@ public:
/// </summary>
API_PROPERTY() void SetLightmapSettings(const LightmapSettings& value);
public:
/// <summary>
/// The list of registered navigation bounds volumes (in the scene).
/// </summary>
Array<NavMeshBoundsVolume*> NavigationVolumes;
/// <summary>
/// The list of registered navigation meshes (in the scene).
/// </summary>
Array<NavMesh*> NavigationMeshes;
/// <summary>
/// Gets the total navigation volumes bounds.
/// </summary>
/// <returns>The navmesh bounds.</returns>
BoundingBox GetNavigationBounds();
/// <summary>
/// Finds the navigation volume bounds that have intersection with the given world-space bounding box.
/// </summary>
/// <param name="bounds">The bounds.</param>
/// <returns>The intersecting volume or null if none found.</returns>
NavMeshBoundsVolume* FindNavigationBoundsOverlap(const BoundingBox& bounds);
public:
/// <summary>
@@ -148,12 +169,10 @@ public:
protected:
// [Scene]
// [Actor]
void PostLoad() override;
void PostSpawn() override;
void BeginPlay(SceneBeginData* data) override;
void OnEnable() override;
void OnDisable() override;
void OnTransformChanged() override;
};