Skip to content

raycaster termination condition #20

@Dizzerzz

Description

@Dizzerzz
if(expand_dir_x_ != 0 && t_to_bound_x_ >= t_max_|| expand_dir_y_ != 0 && t_to_bound_y_ >= t_max_ ||
               expand_dir_z_ != 0 && t_to_bound_z_ >= t_max_) {
                return false;
            }

i used the isLineFree function to get the line of sight points and sometimes the raycaster got stuck in the while(raycaster.step(pt)) loop as the stepped point went into the wrong direction on the "last" step and shot off into infinity.
Changing (or adding) this condition fixed it.

in the header added:
double t_max_{0.0};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions