ofNode::getGlobalPosition problems and glm::tmat4x4 has no member named ‘xyz’

I’m having a weird behavior working with the position of a camera.
Somehow getGlobalPosition returns a different vector than the assigned on setGlobalPosition in the same node.

camera.setGlobalPosition( glm::vec3(0, 10, 200) );
camera.getGlobalPosition();  // => returns <200, 0, 10>

*The values are correct but the axes are disordered.

Have been checking the source code of ofNode. ofNode::getGlobalPosition is calling ofNode::getGlobalTransformMatrix which return a glm::mat4, then ofNode::getGlobalPosition gets the 3rd row and return the xyz points of the vector in a glm::vec3.


glm::mat4 ofNode::getGlobalTransformMatrix() const {
	if(parent) return parent->getGlobalTransformMatrix() * getLocalTransformMatrix();
	else return getLocalTransformMatrix();

glm::vec3 ofNode::getGlobalPosition() const {
	return getGlobalTransformMatrix()[3].xyz();

When I try to get the getGlobalTransformMatrix by myself and select the 3rd row of the matrix, then I got the correct and organized values which I can cats on a glm :: vec3 and work with it.
But when I directly use the ofNode :: getGlobalPosition method, the vector is wrong.

// This works
glm::vec3 globalPosition = camera.getGlobalTransformMatrix()[3];

Then I try to use the xyz() method and check if this is what makes it fail. But instead I get the followinf error:

glm::vec3 globalPosition = camera.getGlobalTransformMatrix()[3].xyz();

error: ‘glm::tmat4x4<float, (glm::precision)0>::col_type {aka struct glm::tvec4<float, (glm::precision)0>}’ has no member named ‘xyz’
glm::vec3 test = cam.getGlobalTransformMatrix()[3].xyz();

Should be this the propperly behavior of the ‘getGlobalPosition’ function?
Have anybody had any similar behavior before?

I’m woring on Arch Linux, with the github version of OF, compied a week ago.

I was using some old code which was including the gml library by itself.
#include <glm/glm.hpp>

This was conflicting with the already included glm library by OF.

ofDrawGrid axis are still wrong.
i can confirm no such issues in ofxIrrlicht’s CameraSceneNodeFPS, when back and forth between glm and irr::core::vector3df, seamless transcription of coordinate spaces, ie, camera->setPosition(irr::core::vector3df(10, 10.0f, 0)); just works
also you need to patch glm if you are on gcc73 (caused a half hour detour, https://github.com/g-truc/glm/issues/728)
thank you for your workarounds in this post, extremely helpful