Nebula
Loading...
Searching...
No Matches
navmeshsources.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
18//------------------------------------------------------------------------------
19#if WITH_NEBULA_EDITOR
20#include "game/entity.h"
21#include "math/bbox.h"
22#include "math/mat4.h"
23#include "util/array.h"
24#include "util/guid.h"
25#include "util/string.h"
26#include "util/stringatom.h"
29#include "flat/navigation/navmesh.h"
30#include <memory>
31#include <vector>
32
33namespace Editor
34{
35class Scene;
36}
37
38namespace NavigationFeature
39{
40
41struct NavMeshGatherOptions
42{
44 bool onlyStatic = true;
46 bool models = true;
48 bool colliders = true;
49};
50
52bool GatherNavMeshSources(
53 Editor::Scene* scene,
54 Game::Entity entity,
55 const NavMeshGatherOptions& options,
56 std::vector<std::unique_ptr<Navigation::GeometryEntryT>>& out,
57 Util::String& outReason);
58
60Game::Entity FindEntityByGuid(Editor::Scene* scene, const Util::Guid& guid);
62Util::String EntityName(Editor::Scene* scene, Game::Entity entity);
63
65struct NavAreaVolume
66{
67 Game::Entity entity; // authored entity
68 Util::StringAtom area;
69 int priority = 0;
70 Math::mat4 transform; // entity position, orientation and scale
71 Math::bbox localBox; // the box in the space of the entity, centered with the half extents
72 Math::mat4 pointTransform; // entity position and orientation, the points are not scaled
73 Util::Array<Math::vec3> points; // points which replace the footprint of the box, relative to pointTransform
74};
75
77Util::Array<NavAreaVolume> GetNavAreaVolumes(Editor::Scene* scene);
79Navigation::Build::AreaPrism NavAreaPrism(const NavAreaVolume& volume);
81void DrawAreaPrism(const Navigation::Build::AreaPrism& prism, const Math::vec4& color);
83std::unique_ptr<Navigation::NavAreaModifierT> MakeAreaModifier(Editor::Scene* scene, const NavAreaVolume& volume);
84
85} // namespace NavigationFeature
86#endif // WITH_NEBULA_EDITOR
87//------------------------------------------------------------------------------
Queries on a loaded navmesh.
Definition agentmanager.cc:30