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.
Optional logger instance for diagnostic output.
Assign any object with debug, info, and/or error methods.
When null or undefined, all internal logging is silenced (default).
OptionalnavmeshThe navmesh type last built: solo or tiled.
Set after the built event fires.
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.
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.
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.
Rebuild all tiles in the tiled navmesh (e.g. after adding off-mesh connections or obstacles).
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 a bounding-box.
Use the FLAG_* constants for the flags bitmask.
Set traversal flags on a specific polygon by its reference.
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.
Add 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.
Named zones keyed by zone name. Populated by RecastModule.setZones.
Create named zones with initial polygon references and flags.
The Zone constructor — use to create zones manually.
Add a custom off-mesh connection (e.g. a jump or ladder link).
true for bidirectional, false for one-way.
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: numberReadonlyCROWD_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.
Install a steering behavior plugin on this recast instance.
The plugin class must implement a static install(recastInstance) method.
Returns the recast instance for chaining.
OptionalFlockThe FlockGroup constructor, available after recast.withPlugin(FlockGroup).
OptionalcreateCreate a new flock group.
Available after recast.withPlugin(FlockGroup).
Optionaloptions: FlockGroupOptionsOptionalFormationThe Formation constructor, available after recast.withPlugin(Formation).
OptionalcreateCreate a new formation.
Available after recast.withPlugin(Formation).
Optionaloptions: FormationOptionsThe underlying event emitter. Emits:
built (type: string) — after buildSolo() or buildTiled() completes.update (agents: CrowdAgent[]) — after each crowdUpdate() call.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.
OptionalglThe current WebGL context set via RecastModule.setGLContext.
Draw a named GL object using the current RecastModule.glContext.
Set all navmesh build parameters at once.