Skip to content

glm types always use JS Float32Arrays under the hood. #18

Description

@LuisMerinoP

Hi there. Awesome work. Thanks very much for working this out.

Noticed that no matter the type of vector built, FloatArray32 JS type is what is used under the hood.

const glmIvec = glm.ivec3(-3, 0, 0);
const glmUvec = glm.uvec3(-3, 0, 0);
const glmVec = glm.vec3(-3, 0, 0);

console.log('glmIvec', glmIvec);
console.log('glmUvec', glmUvec);
console.log('glmVec', glmVec);

image

I would expect that once the library takes care of the glm type specifics on the semantic side, the closest JS type array match would be used. This would be for memory efficiency also, but mainly to avoid misunderstandings/bugs when memory strides are passed into the graphics API functions.

Taking the chance to ask if PRs are welcome, maybe to fix this or for example to add typescript types to the library.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Valuable Suggestion (Sunsetted)Issue acknowledged. Open in meantime for community discussion and potential future exploration.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions