Skip to content

Adding pathfinding using SDF example #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bld/
[Oo]bj/
[Ll]og/
[Ll]ogs/
*/Makefile

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
15 changes: 15 additions & 0 deletions pathfinding_sdf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Combining distance fields with path finding

![sdf-sample-05](https://github.com/zet23t/examples-c/assets/1007258/7e71e376-e6a8-4ee1-ae19-767d138a1b8a)

This example demonstrates how to use signed distance fields (SDF) for improving
pathfinding.

* Unit size: A path may have a requirement for a minimum width to allow passage.
By using the SDF values, we can block paths that are too narrow for the unit.
* Path preferences: A unit may prefer to stay close to walls or avoid them. The example
demonstrates how to influence the pathfinding by using the SDF values.
* Varying step distances: Using SDF values to adjust step distances during path finding,
resulting in curved paths.

The example is not optimized for performance, but rather to demonstrate the concept.
Loading