瀏覽代碼

Use Math::abs to avoid ambiguity with integer abs

Marc Gilleron 8 月之前
父節點
當前提交
7e6c9c9370
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/godot_cpp/variant/quaternion.hpp

+ 1 - 1
include/godot_cpp/variant/quaternion.hpp

@@ -149,7 +149,7 @@ struct [[nodiscard]] Quaternion {
 		Vector3 n0 = p_v0.normalized();
 		Vector3 n0 = p_v0.normalized();
 		Vector3 n1 = p_v1.normalized();
 		Vector3 n1 = p_v1.normalized();
 		real_t d = n0.dot(n1);
 		real_t d = n0.dot(n1);
-		if (abs(d) > ALMOST_ONE) {
+		if (Math::abs(d) > ALMOST_ONE) {
 			if (d >= 0) {
 			if (d >= 0) {
 				return; // Vectors are same.
 				return; // Vectors are same.
 			}
 			}