Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
navmeshdocument.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
21
//------------------------------------------------------------------------------
22
#if WITH_NEBULA_EDITOR
23
#include "editorassets/assetdocument.h"
24
#include "
resources/resourceid.h
"
25
#include "
navigationfeature/editor/navmeshsources.h
"
26
27
namespace
NavigationFeature
28
{
29
30
class
NavMeshDocument
final :
public
Editor::AssetDocument
31
{
32
__DeclareClass
(
NavMeshDocument
)
33
public
:
34
NavMeshDocument
();
35
virtual
~NavMeshDocument
();
36
38
void
Draw()
override
;
40
bool
CanSave()
const override
;
41
43
static
void
OpenAsset(
const
IO::Path
& asset);
45
static
bool
CreateAsset(
const
IO::Path
& asset,
const
IO::URI
& workFile,
const
Util::String
& variant,
Util::String
& outError);
47
static
Util::String
OpenAgentKind();
49
Resources::ResourceId GetPreview()
const
;
50
52
void
ApplyDescription(
const
Util::Blob
& description);
55
void
GatherEntities(
const
Util::Array<Game::Entity>
& entities,
bool
replaceAll);
57
bool
Bake();
58
59
protected
:
60
bool
OnOpen()
override
;
61
void
OnClose()
override
;
62
bool
OnSave(
Util::String
& outError)
override
;
63
void
OnRevert()
override
;
64
65
private
:
67
struct
SkippedEntity
68
{
69
Util::String
name;
70
Util::String
reason;
71
};
72
74
bool
LoadDescription(
Util::String
& outError);
76
void
ResetDescription();
78
void
Commit(
const
char
* name);
80
void
GatherAgain();
82
void
GatherAreaVolumes();
84
Game::Entity
FindNavMeshEntity()
const
;
86
void
PlaceInScene();
88
void
UpdatePreview();
89
void
DiscardPreview();
90
void
SetStatus(
bool
error,
const
Util::String
& status);
91
92
void
DrawSettings();
93
void
DrawSources();
94
void
DrawBake();
95
96
Navigation::NavMeshT description;
98
Util::Blob
committed;
99
100
NavMeshGatherOptions options;
101
Util::Array<SkippedEntity>
skipped;
102
Util::String
status;
103
bool
statusIsError;
105
bool
baking;
106
Resources::ResourceId preview;
107
};
108
109
}
// namespace NavigationFeature
110
#endif
// WITH_NEBULA_EDITOR
111
//------------------------------------------------------------------------------
IO::Path
A path is an abstraction around file paths.
Definition
path.h:26
IO::URI
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition
uri.h:67
NavMeshDocument
A navmesh open in the asset editor: the agent it is baked for, the build settings,...
Util::Array
Nebula's dynamic array class.
Definition
array.h:61
Util::Blob
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition
blob.h:22
Util::String
Nebula's universal string class.
Definition
string.h:50
NavigationFeature
Queries on a loaded navmesh.
Definition
agentmanager.cc:30
navmeshsources.h
What a scene gives a navmesh: the geometry of its entities, and its area volumes.
resourceid.h
__DeclareClass
#define __DeclareClass(type)
Game::Entity
An entity is essentially just an Id with some utility functions attached.
Definition
entity.h:35
code
addons
navigationfeature
editor
navmeshdocument.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.