2018-07-28 18:51:13 +00:00
|
|
|
#include <glm/gtc/constants.hpp>
|
|
|
|
#include <glm/ext/vector_relational.hpp>
|
2014-09-20 14:56:24 +00:00
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
2016-06-10 21:14:17 +00:00
|
|
|
#if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC)
|
2024-01-20 09:11:13 +00:00
|
|
|
|
|
|
|
#define GLM_ENABLE_EXPERIMENTAL
|
2014-10-05 17:37:07 +00:00
|
|
|
#include <glm/gtx/scalar_multiplication.hpp>
|
2014-10-05 11:26:02 +00:00
|
|
|
|
2014-09-20 14:56:24 +00:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int Error(0);
|
|
|
|
glm::vec3 v(0.5, 3.1, -9.1);
|
|
|
|
|
2018-07-28 18:51:13 +00:00
|
|
|
Error += glm::all(glm::equal(v, 1.0 * v, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal(v, 1 * v, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal(v, 1u * v, glm::epsilon<float>())) ? 0 : 1;
|
2014-09-20 14:56:24 +00:00
|
|
|
|
|
|
|
glm::mat3 m(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
|
|
|
glm::vec3 w = 0.5f * m * v;
|
|
|
|
|
2018-07-28 18:51:13 +00:00
|
|
|
Error += glm::all(glm::equal((m*v)/2, w, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal(m*(v/2), w, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal((m/2)*v, w, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal((0.5*m)*v, w, glm::epsilon<float>())) ? 0 : 1;
|
|
|
|
Error += glm::all(glm::equal(0.5*(m*v), w, glm::epsilon<float>())) ? 0 : 1;
|
2014-09-20 14:56:24 +00:00
|
|
|
|
|
|
|
return Error;
|
|
|
|
}
|
2014-10-05 11:26:02 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|