Skip to content

Recast and Detour constants all zero #476

@repulsio

Description

@repulsio

Isaac, when you have time, could you please check if the Recast and Detour constants are all zero when called in JS? They seem to all be zero for me

Recast constants: https://github.com/isaac-mason/recast-navigation-js/blob/main/packages/recast-navigation-wasm/src/Recast.h#L88-L96

unsigned short BORDER_REG = RC_BORDER_REG;
unsigned short MULTIPLE_REGS = RC_MULTIPLE_REGS;
int BORDER_VERTEX = RC_BORDER_VERTEX;
// ...

Detour constants: https://github.com/isaac-mason/recast-navigation-js/blob/main/packages/recast-navigation-wasm/src/Detour.h#L13-L40

int FAILURE = DT_FAILURE;
int SUCCESS = DT_SUCCESS;
int IN_PROGRESS = DT_IN_PROGRESS;
// ...

I've been exploring this in a branch: main...regnaio:regnaio/idl

After adding static const to the .h properties and static readonly to the .idl attributes, rebuilding the WASM then gives the correct, non-zero values when called in JS

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