Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LuisMerinoP opened this issue Jan 21, 2024 · 1 comment
Open

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

LuisMerinoP opened this issue Jan 21, 2024 · 1 comment
Labels
Valuable Suggestion (Sunsetted) Issue acknowledged. Open in meantime for community discussion and potential future exploration.

Comments

@LuisMerinoP
Copy link

LuisMerinoP commented Jan 21, 2024

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.

@LuisMerinoP LuisMerinoP changed the title glm types handle JS Float32Arrays under the hood. glm types always use JS Float32Arrays under the hood. Jan 21, 2024
@humbletim
Copy link
Owner

Thanks for reporting this issue and your feedback. Unfortunately, the glm-js project is currently in the process of sunsetting and is no longer actively maintained (see discussion #19 for details).

While I can't personally address this, it does sounds like a potential issue with TypedArray usage. I recall working with different TypedArrays for uvec and ivec in glm.experimental.js or glm.buffers.js, or possibly related to legacy browser sniffing code.

If you're interested in contributing, you're welcome to fork the project and share your work here for potential visibility, but keep in mind that future support for such contributions is not guaranteed.

Thanks for your interest and your understanding! Best regards, -Tim

@humbletim humbletim added the Valuable Suggestion (Sunsetted) Issue acknowledged. Open in meantime for community discussion and potential future exploration. label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Valuable Suggestion (Sunsetted) Issue acknowledged. Open in meantime for community discussion and potential future exploration.
Projects
None yet
Development

No branches or pull requests

2 participants