Browse Source

Added assert to ensure lerp is used in the correct range of value

Christophe Riccio 13 years ago
parent
commit
9926506c7f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      glm/gtc/quaternion.inl

+ 4 - 0
glm/gtc/quaternion.inl

@@ -480,6 +480,10 @@ namespace detail
 		T const & a
 	)
 	{
+		// Lerp is only defined in [0, 1]
+		assert(a >= T(0));
+		assert(a <= T(1));
+
 		return x * (T(1) - a) + (y * a);
 	}