Interface INavigationEnginePlugin
name: string;
addBoxObstacle(
position: Vector3,
extent: Vector3,
angle: number,
): Nullable<IObstacle>;
addCylinderObstacle(
position: Vector3,
radius: number,
height: number,
): Nullable<IObstacle>;
buildFromNavmeshData(data: Uint8Array): void;
computePath(start: Vector3, end: Vector3): Vector3[];
computePathSmooth(start: Vector3, end: Vector3): Vector3[];
createCrowd(
maxAgents: number,
maxAgentRadius: number,
scene: Scene,
): ICrowd;
createDebugNavMesh(scene: Scene): Mesh;
createNavMesh(meshes: Mesh[], parameters: INavMeshParameters): void;
dispose(): void;
getClosestPoint(position: Vector3): Vector3;
getClosestPointToRef(position: Vector3, result: Vector3): void;
getDefaultQueryExtent(): Vector3;
getDefaultQueryExtentToRef(result: Vector3): void;
getMaximumSubStepCount(): number;
getNavmeshData(): Uint8Array;
getRandomPointAround(position: Vector3, maxRadius: number): Vector3;
getRandomPointAroundToRef(
position: Vector3,
maxRadius: number,
result: Vector3,
): void;
getTimeStep(): number;
isSupported(): boolean;
moveAlong(position: Vector3, destination: Vector3): Vector3;
moveAlongToRef(
position: Vector3,
destination: Vector3,
result: Vector3,
): void;
removeObstacle(obstacle: IObstacle): void;
setDefaultQueryExtent(extent: Vector3): void;
setMaximumSubStepCount(newStepCount: number): void;
setTimeStep(newTimeStep: number): void;
}
Implemented by
Index
Properties
Methods
Methods
add Box Obstacle
add Cylinder Obstacle
build From Navmesh Data
-
build the navmesh from a previously saved state using getNavmeshData
Parameters
- data: Uint8Array
the Uint8Array returned by getNavmeshData
Returns void
- data: Uint8Array
compute Path
compute Path Smooth
create Crowd
create Debug Nav Mesh
create Nav Mesh
-
Creates a navigation mesh
Parameters
- meshes: Mesh[]
array of all the geometry used to compute the navigation mesh
- parameters: INavMeshParameters
bunch of parameters used to filter geometry
Returns void
- meshes: Mesh[]
dispose
-
Release all resources
Returns void
get Closest Point
get Closest Point To Ref
get Default Query Extent
get Default Query Extent To Ref
-
Get the Bounding box extent result specified by setDefaultQueryExtent
Parameters
- result: Vector3
output the box extent values
Returns void
- result: Vector3
get Maximum Sub Step Count
-
Get the maximum number of iterations per navigation tick update
Returns number
the maximum number of iterations
get Navmesh Data
-
returns the navmesh data that can be used later. The navmesh must be built before retrieving the data
Returns Uint8Array
data the Uint8Array that can be saved and reused
get Random Point Around
get Random Point Around To Ref
get Time Step
-
Get the time step of the navigation tick update.
Returns number
the current time step
is Supported
-
If this plugin is supported
Returns boolean
true if plugin is supported
move Along
move Along To Ref
remove Obstacle
-
Removes an obstacle created by addCylinderObstacle or addBoxObstacle
Parameters
- obstacle: IObstacle
obstacle to remove from the navigation
Returns void
- obstacle: IObstacle
set Default Query Extent
-
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
- extent: Vector3
set Maximum Sub Step Count
-
If delta time in navigation tick update is greater than the time step a number of sub iterations are done. If more iterations are needed to reach deltatime they will be discarded. A value of 0 will set to no maximum and update will use as many substeps as needed
Parameters
- newStepCount: number
the maximum number of iterations
Returns void
- newStepCount: number
set Time Step
-
Set the time step of the navigation tick update. Default is 1/60. A value of 0 will disable fixed time update
Parameters
- newTimeStep: number
the new timestep to apply to this world.
Returns void
- newTimeStep: number
Navigation plugin interface to add navigation constrained by a navigation mesh