Browse Source

Fix Face3::get_random_point_inside()

Use correct overload of Math::random(from, to) to return floating point values within the correct range.
John Wigg 3 years ago
parent
commit
ccf05aeb9a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/math/face3.cpp

+ 2 - 2
core/math/face3.cpp

@@ -151,8 +151,8 @@ Face3::Side Face3::get_side_of(const Face3 &p_face, ClockDirection p_clock_dir)
 }
 }
 
 
 Vector3 Face3::get_random_point_inside() const {
 Vector3 Face3::get_random_point_inside() const {
-	real_t a = Math::random(0, 1);
-	real_t b = Math::random(0, 1);
+	real_t a = Math::random(0.0, 1.0);
+	real_t b = Math::random(0.0, 1.0);
 	if (a > b) {
 	if (a > b) {
 		SWAP(a, b);
 		SWAP(a, b);
 	}
 	}