Added dependencies to cmath in order to use sqrt

This commit is contained in:
Vazquinhos
2016-05-13 12:37:24 +02:00
parent 0dcc72239d
commit 9aee576b99

View File

@@ -44,6 +44,7 @@
#include <string>
#include <vector>
#include <map>
#include <cmath>
namespace tinyobj {
@@ -138,9 +139,9 @@ public:
void normalize()
{
const float length = sqrt( ( coord[0] * coord[0] ) +
( coord[1] * coord[1] ) +
( coord[2] * coord[2] ) );
const float length = std::sqrt( ( coord[0] * coord[0] ) +
( coord[1] * coord[1] ) +
( coord[2] * coord[2] ) );
if( length != 1 )
{
coord[0] = (coord[0] / length);