Бранимир Караџић 6 years ago
parent
commit
a91b4bb4c8
2 changed files with 3 additions and 3 deletions
  1. 1 1
      examples/29-debugdraw/debugdraw.cpp
  2. 2 2
      examples/common/bounds.cpp

+ 1 - 1
examples/29-debugdraw/debugdraw.cpp

@@ -844,7 +844,7 @@ public:
 				Cylinder cylinder =
 				Cylinder cylinder =
 				{
 				{
 					{ -10.0f, 1.0f, 10.0f },
 					{ -10.0f, 1.0f, 10.0f },
-					{ 0.0f, 0.0f, 0.0f },
+					{   0.0f, 0.0f,  0.0f },
 					1.0f
 					1.0f
 				};
 				};
 
 

+ 2 - 2
examples/common/bounds.cpp

@@ -1029,7 +1029,7 @@ Vec3 closestPoint(const LineSegment& _line, const Vec3& _point)
 	const Vec3  axis     = sub(_line.end, _line.pos);
 	const Vec3  axis     = sub(_line.end, _line.pos);
 	const float lengthSq = dot(axis, axis);
 	const float lengthSq = dot(axis, axis);
 	const float tt       = clamp(projectToAxis(axis, sub(_point, _line.pos) ) / lengthSq, 0.0f, 1.0f);
 	const float tt       = clamp(projectToAxis(axis, sub(_point, _line.pos) ) / lengthSq, 0.0f, 1.0f);
-	return mad(axis, { tt, tt, tt }, _line.pos);
+	return mad(axis, tt, _line.pos);
 }
 }
 
 
 Vec3 closestPoint(const Plane& _plane, const Vec3& _point)
 Vec3 closestPoint(const Plane& _plane, const Vec3& _point)
@@ -1065,7 +1065,7 @@ Vec3 closestPoint(const Triangle& _triangle, const Vec3& _point)
 	const Vec3 pos = closestPoint(plane, _point);
 	const Vec3 pos = closestPoint(plane, _point);
 	const Vec3 uvw = barycentric(_triangle, pos);
 	const Vec3 uvw = barycentric(_triangle, pos);
 
 
-	return cartesian(_triangle, clamp(uvw, {0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f}) );
+	return cartesian(_triangle, clamp<Vec3>(uvw, 0.0f, 1.0f) );
 }
 }
 
 
 bool overlap(const Sphere& _sphere, const Vec3& _pos)
 bool overlap(const Sphere& _sphere, const Vec3& _pos)