瀏覽代碼

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

Christophe Riccio 13 年之前
父節點
當前提交
9926506c7f
共有 1 個文件被更改,包括 4 次插入0 次删除
  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);
 	}