Skip to content

warnings for glm::decompose in MS VS12.0.21005.1 for glm 0.9.6.3 #373

@senselevel

Description

@senselevel

In MS Visual Studio 2013, if I do something like:

glm::mat4x4 glmMat;
// assign something to glmMat (removed for brevity)
glm::vec3 scale, translation, skew;
glm::vec4 perspective;
glm::quat rotation;

glm::decompose(glmMat, scale, rotation, translation, skew, perspective);

it will generate the following conversion warnings, based on loss of precision.

4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(189): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4> ..\MeshSceneManager.cpp(213) : see reference to function template instantiation 'bool glm::decompose<float,0>(const glm::tmat4x4<float,0> &,glm::tvec3<float,0> &,glm::tquat<float,0> &,glm::tvec3<float,0> &,glm::tvec3<float,0> &,glm::tvec4<float,0> &)' being compiled
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(193): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(194): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(201): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(202): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(209): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(211): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(217): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
4>c:\monkey\dependencies\glm\glm\gtx\matrix_decompose.inl(220): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data

I looked at it, seemed like explicit casts to the template type should handle it, but I thought you should look at it.

M

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions