GLM: function taking degrees as a parameter is deprecated (WHEN USING RADIANS)

HarrisonG16 picture HarrisonG16 · May 30, 2014 · Viewed 12.8k times · Source

Currently using VC++ 11 with SDL2, GLM, and GLEW. The issue is stemming from GLM when I attempt to do two things: Create a rotation matrix, create a perspective camera matrix (3D).

The error is: "GLM: perspective function taking degrees as a parameter is deprecated" despite the fact that I am passing radians (as floats) to both functions. It says I should define something like "#define GLM_FORCE_RADIANS." Is that really necessary?

Personally I use degrees for everything, but OpenGL, so having to convert back and forth (for AI movement and what not) is a pain and actually causes a spike in CPU when I have many NPCs moving.

Answer

alexX AleX alexge50 picture alexX AleX alexge50 · Jun 26, 2015

Instead of manual transformation you can use

glm::radians(degrees) // from degrees to radians. 

Or

glm::degrees(radians) // from radians to degrees. 

For further information about glm's trigonometry functions consult this page: http://glm.g-truc.net/0.9.4/api/a00136.html#ga4fb76e28851c9ff6653532566084e091