Coder Social home page Coder Social logo

talentyao / nevmesh.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lear315/nevmesh.js

0.0 0.0 0.0 91 KB

NevMesh.Js是一个开源的JavaScript库,能够使用Unity导出的NavMesh文件进行AI寻路。是在ThreeJs的PatrolJS基础上,针对Laya引擎做了改造。

License: MIT License

Python 56.61% C# 1.90% TypeScript 41.49%

nevmesh.js's Introduction

基于开源库PatrolJS修改 使用了开源库Astar http://github.com/bgrins/javascript-astar

编译方法: 命令:tsc 编译后文件:build/NevMesh.js build/NevMesh.d.ts Unity的NevMesh导出插件:unity/NavMeshExport.cs Python转换Json工具:python/convert_obj_three.py

使用方法: 1.在Unity中bake navmesh
2.将NavMeshExport.cs脚本放到Unity项目中,点击状态栏的LayaAir3D-NavMesh->Export,然后会在工程目录生成一个ExportNavMesh文件夹,里面的文件就是导出的NavMesh模型obj文件 3.这时候需要将导出的obj文件利用转换工具转换成json格式的文件,让Laya读取
4.转换工具是python文件,需要安装python,python环境下载地址:python
5.在转换工具命令 python convert_obj_three.py -i xx.obj -o xx.json 回车。详细请看转换工具代码。
6.项目使用的脚本,将NevMesh.js放到项目bin/libs文件夹中,将NevMesh.d.ts放到项目libs文件夹中,在bin/index.js中增加loadLib("libs/NevMesh.js"),注意需在loadLib("js/bundle.js");前面。

demo地址: https://github.com/lear315/NevMeshJSDemo

在线试用: https://womenzhai.cn/articleDetail?article_id=5fc9fa72029db26f911a8041

nevmesh.js's People

Contributors

lear315 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.