Skip to content

CDDTCast does not always honor max range #11

@droemer7

Description

@droemer7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions