Socket
Socket
Sign inDemoInstall

babylon-navigation-mesh

Package Overview
Dependencies
3
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

babylon-navigation-mesh


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Babylon-navigation-mesh

NPM version

Demo

A toolkit to navigate on a mesh with BABYLON.js. Largely inspired by PatrolJS for ThreeJS.

Babylon-navigation-mesh is a path finder for AI agents. It use the A star and Funnel algorithms to calculate a path on a navigation mesh.

Usage

Add the npm package babylon-navigation-mesh to your project:

npm install babylon-navigation-mesh --save

or clone:

git clone git@github.com:wanadev/babylon-navigation-mesh.git

then

var Navigation = require("babylon-navigation-mesh");

And create your object and the associated graph:

var navigation = new Navigation();
var scene = engine.scene;

var navmesh = scene.getMeshByName("Navmesh");
var zoneNodes = navigation.buildNodes(navmesh);
navigation.setZoneData('scene', zoneNodes);

To calculate the path :

var zone = navigation.getGroup('scene', agentPosition);
var path = navigation.findPath(agentPosition, dest, 'scene', zone);

And to project a position on the navmesh:

var newPosition = navigation.projectOnNavmesh(this.position, 'scene', navigation.getGroup('level', this.position));

Article in progress

Demo

FAQs

Last updated on 01 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc