Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing glm::equalEpsilon and glm::notEqualEpsilon for glm::quat. #11

Closed
ghost opened this issue Nov 15, 2012 · 3 comments
Closed

Missing glm::equalEpsilon and glm::notEqualEpsilon for glm::quat. #11

ghost opened this issue Nov 15, 2012 · 3 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Nov 15, 2012

It seems that GLM is missing some versions of glm::equalEpsilon and glm::notEqualEpsilon for glm:quat:

#include "glm/glm.hpp"
#include "glm/gtx/epsilon.hpp"

int main(int argc, char* argv[])
{
  glm::equalEpsilon(glm::vec2(), glm::vec2(), glm::vec2());
  glm::equalEpsilon(glm::vec3(), glm::vec3(), glm::vec3());
  glm::equalEpsilon(glm::vec4(), glm::vec4(), glm::vec4());
  glm::equalEpsilon(glm::quat(), glm::quat(), glm::quat()); // Works fine.

  glm::notEqualEpsilon(glm::vec2(), glm::vec2(), glm::vec2());
  glm::notEqualEpsilon(glm::vec3(), glm::vec3(), glm::vec3());
  glm::notEqualEpsilon(glm::vec4(), glm::vec4(), glm::vec4());
  glm::notEqualEpsilon(glm::quat(), glm::quat(), glm::quat()); // Works fine.


  glm::equalEpsilon(glm::vec2(), glm::vec2(), 0.0f);
  glm::equalEpsilon(glm::vec3(), glm::vec3(), 0.0f);
  glm::equalEpsilon(glm::vec4(), glm::vec4(), 0.0f);
  glm::equalEpsilon(glm::quat(), glm::quat(), 0.0f); // Linker error!

  glm::notEqualEpsilon(glm::vec2(), glm::vec2(), 0.0f);
  glm::notEqualEpsilon(glm::vec3(), glm::vec3(), 0.0f);
  glm::notEqualEpsilon(glm::vec4(), glm::vec4(), 0.0f);
  glm::notEqualEpsilon(glm::quat(), glm::quat(), 0.0f); // Linker error!

  return 0;
}

I made a patch that fixes the issue: https://gist.github.com/4078772

Groovounet pushed a commit that referenced this issue Nov 15, 2012
@ghost ghost assigned Groovounet Nov 15, 2012
@Groovounet
Copy link
Member

Hi,

This bug has been fixed in GLM 0.9.4 branch. Please not that GTX_epsilon has been promoted into GTC_epsilon with a couple of changes:

int test_defined()
{
glm::epsilonEqual(glm::vec2(), glm::vec2(), glm::vec2());
glm::epsilonEqual(glm::vec3(), glm::vec3(), glm::vec3());
glm::epsilonEqual(glm::vec4(), glm::vec4(), glm::vec4());
glm::epsilonEqual(glm::quat(), glm::quat(), glm::quat());

glm::epsilonNotEqual(glm::vec2(), glm::vec2(), glm::vec2());
glm::epsilonNotEqual(glm::vec3(), glm::vec3(), glm::vec3());
glm::epsilonNotEqual(glm::vec4(), glm::vec4(), glm::vec4());
glm::epsilonNotEqual(glm::quat(), glm::quat(), glm::quat());


glm::epsilonEqual(glm::vec2(), glm::vec2(), 0.0f);
glm::epsilonEqual(glm::vec3(), glm::vec3(), 0.0f);
glm::epsilonEqual(glm::vec4(), glm::vec4(), 0.0f);
glm::epsilonEqual(glm::quat(), glm::quat(), 0.0f);

glm::epsilonNotEqual(glm::vec2(), glm::vec2(), 0.0f);
glm::epsilonNotEqual(glm::vec3(), glm::vec3(), 0.0f);
glm::epsilonNotEqual(glm::vec4(), glm::vec4(), 0.0f);
glm::epsilonNotEqual(glm::quat(), glm::quat(), 0.0f);

return 0;

}

Thanks for contributing!
Christophe

@ghost
Copy link
Author

ghost commented Nov 15, 2012

Wow, that was fast, thank you!

@Groovounet
Copy link
Member

It's not always that fast, it just turned out that I had a look at this code Yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant