Skip to content

expose dtQueryFilter #485

@lukasvdelft

Description

@lukasvdelft

Hi,
I would like to be able to create custom logic for the QueryFilter, especially passFilter/getCost, is it possible that this class gets fully exposed? Rough example below.. If I do this now, passFilter does not get called.
On https://recastnav.com/classdtQueryFilter.html is mentioned "DT_VIRTUAL_QUERYFILTER must be defined in order to extend this class."

class CustomFilter extends QueryFilter {

constructor() {
    super();
}

passFilter(polyRef: number, tile: any, poly: any): boolean {
    console.log(polyRef, tile, poly)
    
    if (poly.get_area() === 63) {
        return false;
    }
    return poly.get_flags() !== 0;
    //return (poly->flags & m_includeFlags) != 0 && (poly->flags & m_excludeFlags) == 0;
    //return super.passFilter(polyRef, tile, poly);
}

}

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