recp / cglm

📽 Highly Optimized 2D / 3D Graphics Math (glm) for C
MIT License
2.34k stars 231 forks source link

Struct API missing 3D Affine Transform #316

Closed FrostKiwi closed 1 year ago

FrostKiwi commented 1 year ago

I found both... https://github.com/recp/cglm/blob/adec2ee8e6679efec4c85aa8f6c9afe567a686c1/include/cglm/affine-mat.h#L115 https://github.com/recp/cglm/blob/adec2ee8e6679efec4c85aa8f6c9afe567a686c1/include/cglm/affine-mat.h#L166 ...to be very useful optimizations and use them in my camera calculation code. I recently switched to the struct API and found them to be missing, requiring me to use

glm_mul_rot(gctx.cam.view_matrix.raw, gctx.cam.cam_rotation_matrix.raw,
    gctx.cam.view_matrix.raw);
glm_inv_tr(gctx.cam.view_matrix.raw);

Would be really nice if they could be added to the struct api.

recp commented 1 year ago

Wow yes indeed we should add them to struct api (affine-mat.h), a PR would be nice to bring these to struct api otherwise I'll do asap :)

FrostKiwi commented 1 year ago

Wow yes indeed we should add them to struct api (affine-mat.h), a PR would be nice to bring these to struct api otherwise I'll do asap :)

Kinda hacked it into my codebase already. I'll make a PR later this evening.

recp commented 1 year ago

@FrostKiwi thanks 🤗

FrostKiwi commented 1 year ago

@FrostKiwi thanks 🤗

@recp added in PR https://github.com/recp/cglm/pull/317

recp commented 1 year ago

Since the PR is merged, I'm going to close this issue, feel free to bring any issues, ideas, feedbacks, contributions ..

Thanks