The Zone constructor — use to create zones manually.
The underlying event emitter. Emits:
built (type: string) — after buildSolo() or buildTiled() completes.update (agents: CrowdAgent[]) — after each crowdUpdate() call.OptionalglThe current WebGL context set via RecastModule.setGLContext.
OptionalnavmeshThe navmesh type last built: solo or tiled.
Set after the built event fires.
ReadonlyCROWD_Crowd update flag: enable anticipation of turns.
ReadonlyCROWD_Crowd update flag: enable obstacle avoidance.
ReadonlyCROWD_Crowd update flag: enable separation between agents.
ReadonlyCROWD_Crowd update flag: enable path visibility optimisation.
ReadonlyCROWD_Crowd update flag: enable path topology optimisation.
ReadonlyFLAG_Poly flag: walkable surface.
ReadonlyFLAG_Poly flag: swimmable surface.
ReadonlyFLAG_Poly flag: door (can be opened/closed).
ReadonlyFLAG_Poly flag: jumpable surface.
ReadonlyFLAG_Poly flag: disabled (agents cannot traverse).
ReadonlyFLAG_Poly flag: all flags set.
Voxel width/depth of a cell. Smaller = higher resolution.
Voxel height.
Minimum floor-to-ceiling clearance for a walkable area.
Agent clearance radius from walls.
Maximum step height an agent can climb.
Maximum walkable slope in degrees.
Load geometry from an OBJ file at path.
In Node.js reads from disk; in the browser fetches via HTTP.
Load geometry from an OBJ string or buffer already in memory.
Async version of RecastModule.OBJDataLoader.
Build a single-tile (solo) navmesh from the loaded geometry.
Emits built on RecastModule.events when done.
Async version of RecastModule.buildSolo. Resolves with the navmesh type string.
Build a tiled navmesh from the loaded geometry.
Emits built on RecastModule.events when done.
Async version of RecastModule.buildTiled. Resolves with the navmesh type string.
Get a random walkable point on the navmesh. Resolves with the point.
Find all polygons within a bounding-box centred at the given position.
Resolves with an array of polygon objects, or null on failure.
OptionalmaxPolys: numberMaximum number of polygons to return (default: 1000).
Set traversal flags on all polygons within an bounding-box.
Use the FLAG_* constants for the flags bitmask.
Set traversal flags on a specific polygon by its reference.
Save the current tiled navmesh to path on disk (Node.js / Emscripten FS).
Load a previously saved navmesh from path.
Save the tile cache (dynamic obstacles + navmesh) to path.
Load a previously saved tile cache from path.
Initialise the crowd system. Must be called once before adding agents.
Maximum number of simultaneous agents.
Maximum agent radius (used to size internal buffers).
Add a crowd agent. Returns the agent index used to identify it in subsequent calls.
Update behavioral parameters of an existing crowd agent.
All fields are required — unspecified fields are reset to 0.
Use RecastModule.mergeCrowdAgentParameters to perform a partial update.
Position is managed by the crowd simulation and cannot be set directly.
Read the current behavioral parameters of a crowd agent as a JSON string.
Returns "null" if the agent index is invalid or the agent is inactive.
Update a subset of crowd agent parameters. Reads the agent's current parameters first and merges with the provided options, so unspecified fields retain their current values.
Remove a crowd agent by its index.
Request an agent to move toward a target position.
Request an agent to move with a specific velocity vector.
Advance the crowd simulation by dt seconds.
Triggers an update event on RecastModule.events with the active agent list.
Retrieve all currently active agents via callback.
Optionalcallback_id: numberAdd a cylindrical obstacle to the tile cache.
Returns the obstacle reference ID, or -1 on failure.
Remove a temporary obstacle by its reference.
Remove all temporary obstacles.
Async: resolves with all active obstacles.
Add a custom off-mesh connection (e.g. a jump or ladder link).
true for bidirectional, false for one-way.
Create named zones with initial polygon references and flags.
Shorthand for recast.events.on(type, listener).
Shorthand for recast.events.off(type, listener).
Shorthand for recast.events.emit(type, ...args).
Provide a WebGL rendering context for debug drawing.
Draw a named GL object using the current RecastModule.glContext.
Named zones keyed by zone name. Populated by RecastModule.setZones.