g-truc / glm

OpenGL Mathematics (GLM)

Home Page:https://glm.g-truc.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Floating point checks cannot be disabled

elliotwoods opened this issue · comments

As mentioned in #378

It is often advantageous to be able to perform glm math functions on non-floating point types (e.g. Ceres Solver JetT for automatic differentiation).

Here I'm requesting that glm either:

  1. Offers a #define which disables the GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, lines
  2. Allow for specific user-defined types to be added to the checklist

Example functions are in func_geometric.inl

It does seem possible to workaround this with the following include-pattern:

#include <ceres/ceres.h>
namespace std {
	template<typename T, int N>
	struct numeric_limits<ceres::Jet<T, N> > {
		static const bool is_signed = true;
		static const bool is_integer = false;
		static const bool is_iec559 = true;
	};
}

#include <glm/glm.hpp>

This issue is resolved with this PR: #1195

Thanks for contributing!