RecastJSPlugin

RecastJS navigation plugin

Hierarchy

  • RecastJSPlugin

Implements

Index

Constructors

constructor

Find examples in Playground
  • Initializes the recastJS plugin

    Parameters

    • Optional recastInjection: any

      can be used to inject your own recast reference

    Returns RecastJSPlugin

Properties

bjsRECAST

Find examples in Playground
bjsRECAST: any

Reference to the Recast library

name

Find examples in Playground
name: string

plugin name

navMesh

Find examples in Playground
navMesh: any

the first navmesh created. We might extend this to support multiple navmeshes

Methods

computePath

Find examples in Playground
  • Compute a navigation path from start to end. Returns an empty array if no path can be computed

    Parameters

    Returns Vector3[]

    array containing world position composing the path

createCrowd

Find examples in Playground
  • createCrowd(maxAgents: number, maxAgentRadius: number, scene: Scene): ICrowd
  • Create a new Crowd so you can add agents

    Parameters

    • maxAgents: number

      the maximum agent count in the crowd

    • maxAgentRadius: number

      the maximum radius an agent can have

    • scene: Scene

      to attach the crowd to

    Returns ICrowd

    the crowd you can add agents to

createDebugNavMesh

Find examples in Playground

createMavMesh

Find examples in Playground

dispose

Find examples in Playground
  • dispose(): void

getClosestPoint

Find examples in Playground
  • Get a navigation mesh constrained position, closest to the parameter position

    Parameters

    Returns Vector3

    the closest point to position constrained by the navigation mesh

getDefaultQueryExtent

Find examples in Playground

getRandomPointAround

Find examples in Playground
  • Get a navigation mesh constrained position, within a particular radius

    Parameters

    • position: Vector3

      world position

    • maxRadius: number

      the maximum distance to the constrained world position

    Returns Vector3

    the closest point to position constrained by the navigation mesh

isSupported

Find examples in Playground
  • isSupported(): boolean

moveAlong

Find examples in Playground

setDefaultQueryExtent

Find examples in Playground
  • setDefaultQueryExtent(extent: Vector3): void
  • Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...) The queries will try to find a solution within those bounds default is (1,1,1)

    Parameters

    • extent: Vector3

      x,y,z value that define the extent around the queries point of reference

    Returns void

Generated using TypeDoc