GithubHelp home page GithubHelp logo

sillyendless / lazy-theta-with-optimization-any-angle-pathfinding Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lapinozz/lazy-theta-with-optimization-any-angle-pathfinding

0.0 0.0 0.0 9 KB

C++ 100.00%

lazy-theta-with-optimization-any-angle-pathfinding's Introduction

Lazy Theta* with optimization pathfinding

Files:

  • pathfinding.hpp
    • The main file, the only one you need
    • Contain the algoritm
  • tileadaptor.hpp
    • To use the pathfinding class you'll need an adaptor, this is an exemple adaptor for tile grid
  • utility.hpp
    • Dummy vector class and distance function used by tileadaptor
  • main.cpp
    • Console based demo
######################################################################
#S   #              #                                                #
#    #              #                                                #
#    #              #                                                #
#    #              #                            2                  3#
#    #              #                             ################## #
#    #              #                                           #    #
#    #              #                                           #4   #
#    #              #                                           # ####
#    #              #                                           #    #
#    #              #                                           #    #
#    #              #                                           #    #
#    #              #                                           #    #
#    #              #                                           #    #
#   0               #                                           #    #
#                   #                                           #    #
#                                 1                             #5   #
#                                                               #    #
#                                                               #   E#
######################################################################
#  = walls
S  = start
E  = end
number = path nodes

Implementation of the algorithm described here: http://aigamedev.com/open/tutorial/lazy-theta-star/

At first I could find any code a part from this and honestly I had no idea of what line 37-38 means pseudo cat

After some amount of research I found this page http://idm-lab.org/project-o.html which provided me with some code. I rewrote most of it because the code style dind't suite me and to take advantage of C++14.

I also made it more modular so that it can be used for grid, hexagonTile, polygon map, anything where you need to find a path between to point.

Also added the possibility to use weighted h-value as described in the first link, it make the search faster but may give slitghly longer path.

lazy-theta-with-optimization-any-angle-pathfinding's People

Contributors

lapinozz 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.