C++ glm:无法从quaternion.hpp使用toMat4
我尝试使用glm时出错。glm的一些功能起作用。然而,我不能使用所有重载和四元数相关的东西C++ glm:无法从quaternion.hpp使用toMat4,c++,glm-math,C++,Glm Math,我尝试使用glm时出错。glm的一些功能起作用。然而,我不能使用所有重载和四元数相关的东西 1>src\foo.cpp(369): error C2039: 'toMat4': is not a member of 'glm' 1> d:\..\glm\glm\gtc\type_ptr.inl(35): note: see declaration of 'glm' 1>src\foo.cpp(369): error C3861: 'to
1>src\foo.cpp(369): error C2039: 'toMat4': is not a member of 'glm'
1> d:\..\glm\glm\gtc\type_ptr.inl(35): note: see declaration of 'glm'
1>src\foo.cpp(369): error C3861: 'toMat4': identifier not found
为此:
#include <glm/glm.hpp> //vec3, vec4, ivec4, mat4
#include <glm/common.hpp> //vec3, vec4, ivec4, mat4
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/quaternion.hpp>
glm::mat4 t1 = glm::translate(glm::mat4x4(), -piv);
glm::mat4 rot = glm::toMat4(trafo.orientation);
glm::mat4 t2 = glm::translate(glm::mat4x4(), piv);
#包括//vec3、vec4、ivec4、mat4
#包括//vec3、vec4、ivec4、mat4
#包括
#包括
#包括
glm::mat4t1=glm::translate(glm::mat4x4(),-piv);
glm::mat4 rot=glm::toMat4(交通方向);
glm::mat4t2=glm::translate(glm::mat4x4(),piv);
在文档中,它列在glm::gtx名称空间中。请看这里:
但您也可以使用:
detail::tmat4x4<T> glm::gtc::quaternion::mat4_cast ( detail::tquat< T > const & x )
detail::tmat4x4 glm::gtc::四元数::mat4_cast(detail::tquatconst&x)
包括在内。看这里:
您使用的是最新的glm版本吗?你使用哪种编译器?有了包含,你就不必再包含任何东西了。我的回答对你有帮助吗?