Nebula
Loading...
Searching...
No Matches
navmeshasset.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
19//------------------------------------------------------------------------------
21#include "navbuild/navareas.h"
22#include "io/uri.h"
23// declares the packing of the math types, which the generated headers use
25#include "flat/navigation/navmesh.h"
26#include "flat/navigation/bakednavmesh.h"
27
28namespace Navigation
29{
30namespace Build
31{
32
34static constexpr uint32_t BuilderVersion = 1;
35
42
45
48bool SetupBuildInput(const NavMeshT& description, const AreaTable& areas, BuildInput& out);
50uint64_t InputHash(const void* workData, SizeT workSize, const AreaTable& areas, const BuildInput& input);
52bool ReadInputHash(const IO::URI& exportFile, uint64_t& hash);
55BakeResult BakeNavMesh(const IO::URI& workFile, const IO::URI& exportFile, bool force);
56
58bool IsBakedNavMesh(const void* data, SizeT size);
60dtNavMesh* CreateDetourNavMesh(const BakedNavMesh* baked);
61
62} // namespace Build
63} // namespace Navigation
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Definition geometrysources.cc:15
BakeResult BakeNavMesh(const IO::URI &workFile, const IO::URI &exportFile, bool force)
bake a work file to an export file, registers the default geometry loader if none is registered.
Definition navmeshasset.cc:317
bool IsBakedNavMesh(const void *data, SizeT size)
check that a buffer holds a baked navmesh
Definition navmeshasset.cc:199
uint64_t InputHash(const void *workData, SizeT workSize, const AreaTable &areas, const BuildInput &input)
The description is part of the work data, only the geometry it points at has to be added.
Definition navmeshasset.cc:163
void RegisterPathMappings()
register the work and export extensions of the nav URN type
Definition navmeshasset.cc:68
dtNavMesh * CreateDetourNavMesh(const BakedNavMesh *baked)
create a Detour navmesh from baked data, the tile data is copied. Free with dtFreeNavMesh
Definition navmeshasset.cc:372
BakeResult
Definition navmeshasset.h:37
@ Baked
Definition navmeshasset.h:38
@ UpToDate
Definition navmeshasset.h:39
@ Failed
Definition navmeshasset.h:40
static constexpr uint32_t BuilderVersion
part of every input hash, bump it when the builder output changes for the same input
Definition navmeshasset.h:34
bool SetupBuildInput(const NavMeshT &description, const AreaTable &areas, BuildInput &out)
fill a build input from a description, loading every source through the geometry loader and resolving...
Definition navmeshasset.cc:78
bool ReadInputHash(const IO::URI &exportFile, uint64_t &hash)
read the input hash stored in a baked navmesh, returns false if the file is missing or not a baked na...
Definition navmeshasset.cc:213
Navigation::Build geometry sources.
Definition geometrysources.cc:13
int SizeT
Definition types.h:50