GithubHelp home page GithubHelp logo

ohchase / divert Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 10.0 2.99 MB

Rust bindings for Recast Navigation.

Home Page: https://crates.io/crates/divert

Rust 100.00%
detour navigation navmesh pathfinding recast

divert's Introduction

Actions Status Crate

Divert

Rust bindings for Recast Navigation.

Purpose

Provide safe bindings to Recast Navigation to allow for 3d navigation in a rust application.

How to Build

git clone --recurse-submodules https://github.com/ohchase/divert.git
cargo build

Use Case

Refer to examples/pathfinding.rs for a demonstration of loading geometry generated with Trinity Core. In the below, Proof of Concept, section the paths generated are projected to in-game space. In this repository the resources for generating paths is provided, but drawing/projecting points in the game is not in scope of this project. No questions or issues should be opened requesting help or information about video game specific applications.

cargo run --example path_finding
   Compiling divert v0.1.0 (...\divert)
    Finished dev [unoptimized + debuginfo] target(s) in 0.99s
     Running `target\debug\examples\path_finding.exe`
 INFO  path_finding > [TrinityNavigator] Generating path from DtVector { y: 4350.97, z: 2.25, x: -2051.9 } to DtVector { y: 4894.67, z: 2.21, x: -1916.12 }
 INFO  path_finding > [NavEngine] Adding tile (35, 23)
 INFO  path_finding > [NavEngine] Adding tile (35, 22)
 INFO  path_finding > [TrinityNavigator] Successfully generated path of len: 256
 INFO  path_finding > DtVector { y: 4350.97, z: 2.6134748, x: -2051.9 }
 INFO  path_finding > DtVector { y: 4352.9404, z: 3.0786226, x: -2051.5564 }
 INFO  path_finding > DtVector { y: 4354.9106, z: 3.0870965, x: -2051.213 }
 INFO  path_finding > DtVector { y: 4356.881, z: 2.9974942, x: -2050.8694 }

divert's People

Contributors

andriydev avatar dependabot[bot] avatar ohchase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

divert's Issues

Examples

The examples are not of good quality.
Create an example not dependent on trinitycore mmaps, and properly demonstrate rayon(?) parallel path finding.
The operations are computationally blocking, so not aware of this library being of any use for tokio / work stealing runtimes where you dont want to block.

Prepare v0.7.0

Check if the public API is stable, try to actually make a future proof plan for moving towards a 1.0.0 stable api.
Everything needs documentation, or at least much more thorough documentation.
All functions with unsafe blocks that are exposed publicly as safe need safety clauses.
Make sure there is no panic spots, and document accordingly as well.
Try to move away from TrinityCore usage, to make it clear this is also available for any general 3d mesh navigation where you are willing to use a non rust code base in favor of linking against the actively maintained c++ recast navigation project and for guaranteed feature parity if you are migrating a project.

Use recastnavigation-sys instead of bespoke compilation of Detour.

divert only supports Detour (and links against the Detour library). recastnavigation-sys supports Recast, Detour, DetourCrowd, and DetourTileCache, all provided as feature flags (so divert will still only link in Detour). This will make divert compatible with all other crates using recastnavigation-sys. Otherwise, using this crate and recastnavigation-sys can cause linking errors.

recastnavigation-sys also handles more complexities of linking, like searching for Detour on the system, and vendoring.

This should probably result in cutting a new crate version for divert since this would be taking on a totally new dependency.

comiple failure

hi, i catch an error like this:

   Compiling regex v1.6.0
   Compiling divert v0.3.0 (E:\wow\divert-master)
error: failed to run custom build command for `divert v0.3.0 (E:\wow\divert-master)`

Caused by:
  process didn't exit successfully: `E:\wow\divert-master\target\debug\build\divert-fda6f2f70278ca2b\build-script-build` (exit code: 1)
  --- stderr


  error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "recastnavigation/Detour/Include" "-W4" "-DDT_POLYREF64=1" "-FoE:\\wow\\divert-master\\target\\debug\\build\\divert-a36680083424e849\\out\\recastnavigation/Detour/Source/DetourAlloc.o" "-c" "recastnavigation/Detour/Source/DetourAlloc.cpp" with args "cl.exe" did not execute successfully (status code exit code: 2).


warning: build failed, waiting for other jobs to finish...

how do i fix this?

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.