|
Nebula
|
Classes | |
| struct | AreaDefinition |
| struct | AreaPrism |
| the vertical prism an area volume marks More... | |
| class | AreaTable |
| struct | AreaVolume |
| assigns an area to the walkable surface inside it More... | |
| struct | BuildInput |
| everything a build needs More... | |
| struct | BuildOutput |
| the built navmesh More... | |
| struct | BuildStats |
| statistics of a build More... | |
| struct | HeightFieldSource |
| height field placed in the world, laid out like Physics::HeightFieldInput More... | |
| class | InputHasher |
| FNV-1a, 64 bit. More... | |
| class | LogContext |
| Forwards Recast errors to the log. More... | |
| struct | MeshSource |
| triangle geometry placed in the world More... | |
| struct | Tile |
| one tile of Detour data, as dtCreateNavMeshData produced it More... | |
| struct | TileGrid |
| struct | TileScratch |
| Owns the Recast intermediates of one tile. More... | |
| struct | WorldMeshes |
| Triangles of all mesh sources in world space, plus the tiles each triangle touches. More... | |
Enumerations | |
| enum class | BakeResult { Baked , UpToDate , Failed } |
| enum class | TileResult { Built , Empty , Failed } |
| enum | PolyFlags : unsigned short { PolyFlag_Walk = 1 << 0 } |
| polygon flags written into the Detour data More... | |
Functions | |
| Math::mat4 | ColliderTransform (const Math::vec3 &position, const Math::quat &orientation, const Math::vec3 &localPosition, const Math::quat &localOrientation) |
| world transform of a collider shape, placed like physics places it: the entity's world position and orientation composed with the collider offset. | |
| Util::Array< Math::vec3 > | ConvexHullXZ (const Util::Array< Math::vec3 > &input) |
| Monotone chain. | |
| AreaPrism | MakeAreaPrism (const Math::mat4 &boxTransform, const Math::bbox &localBox, const Math::mat4 &pointTransform, const Math::vec3 *points, SizeT pointCount) |
| the prism an area volume marks. | |
| Util::Array< Math::vec3 > | BoxOutlineXZ (const Math::mat4 &boxTransform, const Math::bbox &localBox) |
| the outline of a box seen from above, the hull of its corners, in world space | |
| static float | SegmentDistanceSqXZ (const Math::vec3 &p, const Math::vec3 &a, const Math::vec3 &b) |
| IndexT | OutlineInsertIndex (const Math::vec3 *outline, SizeT count, const Math::vec3 &point) |
| where a point goes into an outline: the index of the edge closest to it seen from above, the point is inserted after that index, between the two outline points of the edge | |
| static bool | SegmentsCrossXZ (const Math::vec3 &a, const Math::vec3 &b, const Math::vec3 &c, const Math::vec3 &d) |
| bool | IsSimpleOutlineXZ (const Math::vec3 *outline, SizeT count) |
| true if no two edges of the outline cross each other seen from above | |
| static bool | RayTriangle (const Math::vec3 &o, const Math::vec3 &d, const float *a, const float *b, const float *c, float &t) |
| static bool | RayBox (const Math::vec3 &o, const Math::vec3 &d, const float *bmin, const float *bmax) |
| bool | RaycastNavMesh (const dtNavMesh &navMesh, const Math::point &start, const Math::vector &dir, float &outT) |
| Walks the detail triangles of every polygon, the same triangles Detour gives heights with. | |
| bool | LoadMeshSource (Util::StringAtom resource, IndexT meshIndex, IndexT primGroup, const Math::mat4 &transform, MeshSource &out) |
| fill a mesh source from a mesh URN, folder:file:msh, like a MeshCollider reads it | |
| bool | LoadHeightFieldSource (Util::StringAtom resource, float heightRange, float sizeX, float sizeZ, const Math::mat4 &transform, HeightFieldSource &out) |
| fill a height field source from a heightmap URN, folder:file:tex, like a HeightFieldCollider reads it | |
| bool | CompileAreaTable () |
| compile the project table to AreaTableFile, returns false if there is no project table or it doesn't compile | |
| bool | WriteAreaTableSource (const Util::Array< AreaDefinition > &areas, const IO::URI &file) |
| The flags are written the way the schema names them, separated by spaces, the color as its fields. | |
| void | RegisterPathMappings () |
| register the work and export extensions of the nav URN type | |
| 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 area names with the area table | |
| 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. | |
| bool | IsBakedNavMesh (const void *data, SizeT size) |
| check that a buffer holds a baked navmesh | |
| 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 navmesh | |
| static bool | ReadWorkFile (const IO::URI &workFile, Util::Blob &data, NavMeshT &description) |
| static bool | WriteBakedNavMesh (const IO::URI &exportFile, const NavMeshT &description, const BuildOutput &output, uint64_t hash) |
| 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. | |
| dtNavMesh * | CreateDetourNavMesh (const BakedNavMesh *baked) |
| create a Detour navmesh from baked data, the tile data is copied. Free with dtFreeNavMesh | |
| static Math::vec3 | TransformPoint (const Math::mat4 &m, float x, float y, float z) |
| static bool | FlipsWinding (const Math::mat4 &m) |
| A mirroring transform turns the triangles over, Recast uses the winding to tell up from down. | |
| static float | HeightFieldSampleHeight (const HeightFieldSource &field, SizeT x, SizeT z) |
| static bool | IsValidHeightField (const HeightFieldSource &field) |
| static Math::bbox | HeightFieldBounds (const HeightFieldSource &field) |
| Math::bbox | SourceBounds (const BuildInput &input) |
| return the world bounds of all sources | |
| static void | SetupWorldMeshes (const BuildInput &input, const TileGrid &grid, WorldMeshes &out) |
| Transforms all meshes into one world space triangle soup and sorts the triangles into tiles. | |
| static void | AppendHeightFieldTriangles (const HeightFieldSource &field, const float *bmin, const float *bmax, Util::Array< float > &verts, Util::Array< int > &tris) |
| Appends the height field triangles which can touch the world space box to verts and tris. | |
| static bool | RasterizeTriangles (rcContext &ctx, const rcConfig &config, const float *verts, int vertCount, const int *tris, int triCount, Util::Array< unsigned char > &areas, rcHeightfield &solid) |
| Marks walkable triangles and rasterizes them into the heightfield. | |
| static TileResult | BuildTile (rcContext &ctx, const BuildInput &input, const Util::Array< IndexT > &areaOrder, const rcConfig &baseConfig, const TileGrid &grid, const WorldMeshes &meshes, int tx, int tz, Tile &tile, BuildStats &stats) |
| static void | SetupConfig (const BuildInput &input, int tileSize, rcConfig &config) |
| bool | BuildNavMesh (const BuildInput &input, BuildOutput &output, BuildStats *stats=nullptr) |
| build the navmesh, returns false if nothing walkable was found or a tile failed | |
| dtNavMesh * | CreateDetourNavMesh (const BuildOutput &output) |
| create a Detour navmesh from built data, the tile data is copied. Free with dtFreeNavMesh | |
Variables | |
| static constexpr const char * | AreaTableFile = "nav:navareas.navareas" |
| the compiled table | |
| static constexpr const char * | AreaTableSource = "proj:work/data/tables/navareas.json" |
| the table a project edits | |
| static constexpr unsigned char | NoArea = 0 |
| static constexpr unsigned char | MaxAreas = 64 |
| static constexpr uint32_t | BuilderVersion = 1 |
| part of every input hash, bump it when the builder output changes for the same input | |
| static constexpr int | MaxVertsPerPoly = 6 |
| static constexpr int | MinTileSize = 8 |
| static constexpr int | MaxTileBits = 14 |
| static constexpr float | MaxStoredHeight = 32767.0f |
| physics stores height field samples as signed 16 bit, see Physics::CookHeightField | |
| static constexpr unsigned char | DefaultWalkableArea = 63 |
| the area of walkable surface which no area volume covers, Recast's RC_WALKABLE_AREA | |
|
strong |
| enum Navigation::Build::PolyFlags : unsigned short |
|
strong |
|
static |
Appends the height field triangles which can touch the world space box to verts and tris.
| BakeResult Navigation::Build::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.
Areas are resolved with the compiled area table, AreaTableFile, or the built in areas if there is none
| Util::Array< Math::vec3 > Navigation::Build::BoxOutlineXZ | ( | const Math::mat4 & | boxTransform, |
| const Math::bbox & | localBox ) |
the outline of a box seen from above, the hull of its corners, in world space
| bool Navigation::Build::BuildNavMesh | ( | const BuildInput & | input, |
| BuildOutput & | output, | ||
| BuildStats * | outStats ) |
build the navmesh, returns false if nothing walkable was found or a tile failed
|
static |
| Math::mat4 Navigation::Build::ColliderTransform | ( | const Math::vec3 & | position, |
| const Math::quat & | orientation, | ||
| const Math::vec3 & | localPosition, | ||
| const Math::quat & | localOrientation ) |
world transform of a collider shape, placed like physics places it: the entity's world position and orientation composed with the collider offset.
Scale is ignored, physics doesn't scale collider shapes
| bool Navigation::Build::CompileAreaTable | ( | ) |
compile the project table to AreaTableFile, returns false if there is no project table or it doesn't compile
| Util::Array< Math::vec3 > Navigation::Build::ConvexHullXZ | ( | const Util::Array< Math::vec3 > & | input | ) |
Monotone chain.
convex hull of points seen from above, in x and z, counter clockwise. The y of the points is kept
| dtNavMesh * Navigation::Build::CreateDetourNavMesh | ( | const BakedNavMesh * | baked | ) |
create a Detour navmesh from baked data, the tile data is copied. Free with dtFreeNavMesh
| dtNavMesh * Navigation::Build::CreateDetourNavMesh | ( | const BuildOutput & | output | ) |
create a Detour navmesh from built data, the tile data is copied. Free with dtFreeNavMesh
|
inlinestatic |
A mirroring transform turns the triangles over, Recast uses the winding to tell up from down.
|
static |
|
inlinestatic |
| uint64_t Navigation::Build::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.
hash of the work file data, the area table and the loaded source geometry
| bool Navigation::Build::IsBakedNavMesh | ( | const void * | data, |
| SizeT | size ) |
check that a buffer holds a baked navmesh
| bool Navigation::Build::IsSimpleOutlineXZ | ( | const Math::vec3 * | outline, |
| SizeT | count ) |
true if no two edges of the outline cross each other seen from above
|
static |
| bool Navigation::Build::LoadHeightFieldSource | ( | Util::StringAtom | resource, |
| float | heightRange, | ||
| float | sizeX, | ||
| float | sizeZ, | ||
| const Math::mat4 & | transform, | ||
| HeightFieldSource & | out ) |
fill a height field source from a heightmap URN, folder:file:tex, like a HeightFieldCollider reads it
| bool Navigation::Build::LoadMeshSource | ( | Util::StringAtom | resource, |
| IndexT | meshIndex, | ||
| IndexT | primGroup, | ||
| const Math::mat4 & | transform, | ||
| MeshSource & | out ) |
fill a mesh source from a mesh URN, folder:file:msh, like a MeshCollider reads it
| AreaPrism Navigation::Build::MakeAreaPrism | ( | const Math::mat4 & | boxTransform, |
| const Math::bbox & | localBox, | ||
| const Math::mat4 & | pointTransform, | ||
| const Math::vec3 * | points, | ||
| SizeT | pointCount ) |
the prism an area volume marks.
With fewer than 3 points it is the prism around the box. Otherwise the points are the outline, in order, and the height span covers every point give or take half the height of the box, so the surface a point was placed on is inside. The outline may be concave. Points are transformed by pointTransform, box corners by boxTransform
| IndexT Navigation::Build::OutlineInsertIndex | ( | const Math::vec3 * | outline, |
| SizeT | count, | ||
| const Math::vec3 & | point ) |
where a point goes into an outline: the index of the edge closest to it seen from above, the point is inserted after that index, between the two outline points of the edge
|
static |
Marks walkable triangles and rasterizes them into the heightfield.
|
static |
| bool Navigation::Build::RaycastNavMesh | ( | const dtNavMesh & | navMesh, |
| const Math::point & | start, | ||
| const Math::vector & | dir, | ||
| float & | outT ) |
Walks the detail triangles of every polygon, the same triangles Detour gives heights with.
intersect a ray with the detail surface of a navmesh, t is in units of dir. Returns false if it misses
|
static |
| bool Navigation::Build::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 navmesh
|
static |
| void Navigation::Build::RegisterPathMappings | ( | ) |
register the work and export extensions of the nav URN type
|
static |
|
static |
| bool Navigation::Build::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 area names with the area table
|
static |
|
static |
Transforms all meshes into one world space triangle soup and sorts the triangles into tiles.
| Math::bbox Navigation::Build::SourceBounds | ( | const BuildInput & | input | ) |
return the world bounds of all sources
|
inlinestatic |
| bool Navigation::Build::WriteAreaTableSource | ( | const Util::Array< AreaDefinition > & | areas, |
| const IO::URI & | file ) |
The flags are written the way the schema names them, separated by spaces, the color as its fields.
write areas as a table to compile, like the project table. The built in areas are left out, they always exist
|
static |
|
staticconstexpr |
the compiled table
|
staticconstexpr |
the table a project edits
|
staticconstexpr |
part of every input hash, bump it when the builder output changes for the same input
|
staticconstexpr |
the area of walkable surface which no area volume covers, Recast's RC_WALKABLE_AREA
|
staticconstexpr |
|
staticconstexpr |
physics stores height field samples as signed 16 bit, see Physics::CookHeightField
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |