Giter VIP home page Giter VIP logo

adam_fov_rs's Introduction

License: MIT Crates.io docs

An implementation of Adam Millazo's FOV algorithm

To use it you must implement the VisibilityMap trait on your map type, or use the built in VisibilityMap2d. Then you can call fov::compute with your map which will populate visible tiles based on the map's opaque tiles.

Example

use adam_fov_rs::*;

// Create a 50x50 visibility map
let mut map = VisibilityMap2d::default([50,50]);

// Set the tile at (15,15) to opaque
map[[15,15]].opaque = true;
 
// Compute our visible tiles and add them to the map
fov::compute([15,14], 5, &mut map);

// The space directly above our opaque tile is not visible
assert!(map[[15,16]].visible == false);

Taken from the "terminal" example

adam_fov_rs's People

Contributors

sarkahn avatar

Stargazers

Markus Moenig avatar Nikita Zhenev avatar  avatar Josh avatar  avatar

Watchers

 avatar James Cloos avatar

Forkers

jaw-sh rwygand

adam_fov_rs's Issues

Not playing nice with ivec2s in bevy 0.8

Updating my project to use bevy 0.8.
Suddenly, this crate gets mad at me when I use bevy's ivec2s?
Using ivec2s from glam does not seem to placate the crate either.
Not sure if this is simply an issue on my side, or something to do with bevy, or something to do with this crate.

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.