157 bool bake(
const std::vector<float> &verts,
158 const std::vector<int> &tris,
160 const std::vector<kNavLink> &links = {});
176 int maxPoints = 256)
const;
184 const kVec3 &extents =
kVec3(2.f, 4.f, 2.f))
const;
188 const kVec3 &extents =
kVec3(2.f, 4.f, 2.f))
const;
void * getTileCache() const
Returns the internal dtTileCache pointer (null for non-tiled builds).
void * getNavMesh() const
Returns the internal dtNavMesh pointer (opaque).
bool isPointOnMesh(const kVec3 &pos, const kVec3 &extents=kVec3(2.f, 4.f, 2.f)) const
Returns true if pos is on (or very near) the navmesh.
~kNavMesh()
Destroys the navmesh and releases all baked Recast/Detour data.
kVec3 findNearestPoint(const kVec3 &pos, const kVec3 &extents=kVec3(2.f, 4.f, 2.f)) const
Finds the nearest point on the navmesh surface to pos.
void getDebugLines(std::vector< kVec3 > &outSegments) const
Extracts the navmesh surface as world-space line segments for debug visualisation (wireframe).
kNavMesh()
Constructs an empty, unbaked navigation mesh.
std::vector< kVec3 > findPath(const kVec3 &start, const kVec3 &end, int maxPoints=256) const
Finds a smoothed path along the navmesh from start to end.
bool isBaked() const
Returns true if the mesh has been successfully baked.
bool bake(const std::vector< float > &verts, const std::vector< int > &tris, const kNavBuildConfig &config={}, const std::vector< kNavLink > &links={})
Builds the navigation mesh from raw triangle geometry.
void * getNavMeshQuery() const
Returns the internal dtNavMeshQuery pointer (opaque).
void clear()
Destroys the baked data and resets to an unbaked state.
Core type aliases, enumerations, structs, and utility functions used throughout the engine.
Symbol visibility / linkage macro for the Kemena3D library.
#define KEMENA3D_API
Definition kexport.h:35
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
glm::vec3 kVec3
3-component float vector.
Definition kdatatype.h:33
kNavPartitionType
Partition algorithm used during Recast region building.
Definition knavmesh.h:27
@ Watershed
Best quality; slower on complex geometry.
Definition knavmesh.h:28
@ Monotone
Fast; lower quality on open areas.
Definition knavmesh.h:29
@ Layers
Best for very flat/layered geometry.
Definition knavmesh.h:30
All parameters that control the Recast bake pipeline.
Definition knavmesh.h:44
float detailSampleDist
Detail mesh sample spacing (cells); 0 disables detail sampling.
Definition knavmesh.h:65
float tileSize
Definition knavmesh.h:74
kNavPartitionType partition
Region partition algorithm.
Definition knavmesh.h:68
float regionMergeSize
Merge regions smaller than this (cells²).
Definition knavmesh.h:57
float cellSize
XZ voxel size (m). Smaller = finer mesh.
Definition knavmesh.h:46
float agentRadius
Agent cylinder radius (m).
Definition knavmesh.h:51
float detailSampleMaxError
Maximum detail mesh deviation from heightfield (cells).
Definition knavmesh.h:66
float edgeMaxError
Maximum edge deviation from original (m).
Definition knavmesh.h:61
float edgeMaxLen
Maximum edge length (m).
Definition knavmesh.h:60
float agentMaxClimb
Maximum step-up height (m).
Definition knavmesh.h:52
float regionMinSize
Discard regions smaller than this (cells²).
Definition knavmesh.h:56
int maxVertsPerPoly
Maximum vertices per navmesh polygon (2–6).
Definition knavmesh.h:62
float agentHeight
Minimum clear headroom (m).
Definition knavmesh.h:50
float agentMaxSlope
Maximum walkable slope (degrees).
Definition knavmesh.h:53
float cellHeight
Y voxel size (m).
Definition knavmesh.h:47
Defines a traversable shortcut between two navmesh points.
Definition knavmesh.h:88
kVec3 start
World-space start point.
Definition knavmesh.h:89
kVec3 end
World-space end point.
Definition knavmesh.h:90
float radius
Connection snap radius.
Definition knavmesh.h:91
bool bidirectional
If false, only start→end is walkable.
Definition knavmesh.h:92
Serialisable settings for a navigation surface attached to an object in the editor.
Definition knavmesh.h:108
kNavBuildConfig config
Recast bake parameters.
Definition knavmesh.h:109
bool useArea
true = restrict to areaSize box.
Definition knavmesh.h:110
kVec3 areaSize
Full extents of the area box.
Definition knavmesh.h:111