use std:: namespace for most cmath functions:
http://en.cppreference.com/w/cpp/header/cmath
This commit is contained in:
@@ -192,7 +192,7 @@ unsigned int StandardShapes::MakeIcosahedron(std::vector<aiVector3D>& positions)
|
||||
positions.reserve(positions.size()+60);
|
||||
|
||||
const float t = (1.f + 2.236067977f)/2.f;
|
||||
const float s = sqrt(1.f + t*t);
|
||||
const float s = std::sqrt(1.f + t*t);
|
||||
|
||||
const aiVector3D v0 = aiVector3D(t,1.f, 0.f)/s;
|
||||
const aiVector3D v1 = aiVector3D(-t,1.f, 0.f)/s;
|
||||
@@ -242,8 +242,8 @@ unsigned int StandardShapes::MakeDodecahedron(std::vector<aiVector3D>& positions
|
||||
positions.reserve(positions.size()+108);
|
||||
|
||||
const float a = 1.f / 1.7320508f;
|
||||
const float b = sqrt((3.f-2.23606797f)/6.f);
|
||||
const float c = sqrt((3.f+2.23606797f)/6.f);
|
||||
const float b = std::sqrt((3.f-2.23606797f)/6.f);
|
||||
const float c = std::sqrt((3.f+2.23606797f)/6.f);
|
||||
|
||||
const aiVector3D v0 = aiVector3D(a,a,a);
|
||||
const aiVector3D v1 = aiVector3D(a,a,-a);
|
||||
@@ -390,8 +390,8 @@ void StandardShapes::MakeCone(float height,float radius1,
|
||||
size_t old = positions.size();
|
||||
|
||||
// No negative radii
|
||||
radius1 = ::fabs(radius1);
|
||||
radius2 = ::fabs(radius2);
|
||||
radius1 = std::fabs(radius1);
|
||||
radius2 = std::fabs(radius2);
|
||||
|
||||
float halfHeight = height / 2;
|
||||
|
||||
@@ -415,8 +415,8 @@ void StandardShapes::MakeCone(float height,float radius1,
|
||||
const float angle_delta = (float)AI_MATH_TWO_PI / tess;
|
||||
const float angle_max = (float)AI_MATH_TWO_PI;
|
||||
|
||||
float s = 1.f; // cos(angle == 0);
|
||||
float t = 0.f; // sin(angle == 0);
|
||||
float s = 1.f; // std::cos(angle == 0);
|
||||
float t = 0.f; // std::sin(angle == 0);
|
||||
|
||||
for (float angle = 0.f; angle < angle_max; )
|
||||
{
|
||||
@@ -424,8 +424,8 @@ void StandardShapes::MakeCone(float height,float radius1,
|
||||
const aiVector3D v2 = aiVector3D (s * radius2, halfHeight, t * radius2 );
|
||||
|
||||
const float next = angle + angle_delta;
|
||||
float s2 = ::cos(next);
|
||||
float t2 = ::sin(next);
|
||||
float s2 = std::cos(next);
|
||||
float t2 = std::sin(next);
|
||||
|
||||
const aiVector3D v3 = aiVector3D (s2 * radius2, halfHeight, t2 * radius2 );
|
||||
const aiVector3D v4 = aiVector3D (s2 * radius1, -halfHeight, t2 * radius1 );
|
||||
@@ -476,7 +476,7 @@ void StandardShapes::MakeCircle(float radius, unsigned int tess,
|
||||
if (tess < 3 || !radius)
|
||||
return;
|
||||
|
||||
radius = ::fabs(radius);
|
||||
radius = std::fabs(radius);
|
||||
|
||||
// We will need 3 vertices per segment
|
||||
positions.reserve(positions.size()+tess*3);
|
||||
@@ -484,15 +484,15 @@ void StandardShapes::MakeCircle(float radius, unsigned int tess,
|
||||
const float angle_delta = (float)AI_MATH_TWO_PI / tess;
|
||||
const float angle_max = (float)AI_MATH_TWO_PI;
|
||||
|
||||
float s = 1.f; // cos(angle == 0);
|
||||
float t = 0.f; // sin(angle == 0);
|
||||
float s = 1.f; // std::cos(angle == 0);
|
||||
float t = 0.f; // std::sin(angle == 0);
|
||||
|
||||
for (float angle = 0.f; angle < angle_max; )
|
||||
{
|
||||
positions.push_back(aiVector3D(s * radius,0.f,t * radius));
|
||||
angle += angle_delta;
|
||||
s = ::cos(angle);
|
||||
t = ::sin(angle);
|
||||
s = std::cos(angle);
|
||||
t = std::sin(angle);
|
||||
positions.push_back(aiVector3D(s * radius,0.f,t * radius));
|
||||
|
||||
positions.push_back(aiVector3D(0.f,0.f,0.f));
|
||||
|
||||
Reference in New Issue
Block a user