g-truc / glm

OpenGL Mathematics (GLM)

Home Page:https://glm.g-truc.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

are there any gdb pretty printers for the glm library?

asmwarrior opened this issue · comments

Hi, when debugging a program with glm library, I would like to see the vectors or matrices in the gdb.

But sometimes, a simple vector shows several duplicated values, see below:

[debug]> output element.pos
[debug]{{x = 0, r = 0, s = 0}, {y = 0.5, g = 0.5, t = 0.5}, {z = 0, b = 0, p = 0}}>>>>>>cb_gdb:

The result visualized window is like the image below under code::blocks IDE:

image

What I think is that I only need tree values: x,y,z for a simple vec3.

[debug]> output axisTransform_scaled
[debug]{value = {{{x = -0.017251512, r = -0.017251512, s = -0.017251512}, {y = -0.017251512, g = -0.017251512, t = -0.017251512}, {z = -0.017251512, b = -0.017251512, p = -0.017251512}, {w = -0.017251512, a = -0.017251512, q = -0.017251512}}, {{x = -0.017251512, r = -0.017251512, s = -0.017251512}, {y = -0.017251512, g = -0.017251512, t = -0.017251512}, {z = -0.017251512, b = -0.017251512, p = -0.017251512}, {w = -0.017251512, a = -0.017251512, q = -0.017251512}}, {{x = -0.017251512, r = -0.017251512, s = -0.017251512}, {y = -0.017251512, g = -0.017251512, t = -0.017251512}, {z = -0.017251512, b = -0.017251512, p = -0.017251512}, {w = -0.017251512, a = -0.017251512, q = -0.017251512}}, {{x = -0.00132703932, r = -0.00132703932, s = -0.00132703932}, {y = -0.00132703932, g = -0.00132703932, t = -0.00132703932}, {z = -0.00132703932, b = -0.00132703932, p = -0.00132703932}, {w = -0.00132703932, a = -0.00132703932, q = -0.00132703932}}}}>>>>>>cb_gdb:

If I try to print a mat4, it becomes more complex with many duplicated values.

Any ideas?

Thanks.