Skip to content
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

CDDTCast does not always honor max range #11

Open
droemer7 opened this issue Feb 20, 2021 · 0 comments
Open

CDDTCast does not always honor max range #11

droemer7 opened this issue Feb 20, 2021 · 0 comments

Comments

@droemer7
Copy link

When using CDDTCast, the max_range parameter is not always honored. The behavior seems to be limited to two scenarios.

Let's say max_range is set to 30.0:

  1. An obstacle lies along the ray being cast at a true range of 50.0. CDDTCast::calc_range() will return 50.0 (incorrect, 30.0 expected).
  2. No obstacle lies along the ray being cast (the map is open). CDDTCast::calc_range() will return 30.0 (correct).

It's not immediately obvious where the bug itself is because the algorithm is so complex and has lots of return statements. I'm not sure what a proper fix is but a workaround would be to clamp the max range returned by CDDTCast::calc_range().

The other raycasting methods Bresenham (BL), Ray Marching (RM), and Giant Lookup Table (GLT) are not affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant