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

Small issue using GLM 1.0 or more recent #7910

Open
dimitre opened this issue Mar 13, 2024 · 4 comments
Open

Small issue using GLM 1.0 or more recent #7910

dimitre opened this issue Mar 13, 2024 · 4 comments

Comments

@dimitre
Copy link
Member

dimitre commented Mar 13, 2024

Updating a project here I've noticed newer GLM versions got some problems when using an unitialized mat4, like:

	glm::mat4 view;

and worked ok after I've updated to

	glm::mat4 view { 1.0 };

I'm not sure if this will be corrected there in more recent versions, but I'm wondering if we should inspect the core to find some unitialized glm::mat4 and update them, like in ofShadow, ofMatrixStack and ofxAssimpMeshHelper.

PS: It seems #define GLM_FORCE_CTOR_INIT is used correctly in all OF Core.

@2bbb
Copy link
Contributor

2bbb commented Mar 13, 2024

maybe, you need to add suffix of float?
i.e. glm::mat4 view{1.0f};

@artificiel
Copy link
Contributor

@dimitre is #define GLM_FORCE_CTOR_INIT also present in the file where you use the glm::mat4?

because if it's for instance in an autonomous class (that does not import ofMain.h or something) there is no guarantee that the define is "picked-up" prior to your file.

it would be a good occasion to leave uninitialized and try adding a preprocessor define (#6530) and see if it fixes the problem. it creates an additional detail to compile OF, but since most/all people start with a template it's probably not a trouble — and it would be much cleaner than putting #define GLM_FORCE_CTOR_INIT all over the source.

@2bbb
Copy link
Contributor

2bbb commented Mar 14, 2024

@dimitre

sorry, previous my pointing out is my misunderstand.
glm::mat4 view{1.0} is no problem. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants