mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 06:59:18 +02:00
removed dependencies on the old parser. The code can now be compiled outside of Borland C++
This commit is contained in:
20
dumb3d.h
20
dumb3d.h
@@ -7,11 +7,9 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef MATH3D_H
|
||||
#define MATH3D_H
|
||||
#pragma once
|
||||
|
||||
//#include <cmath>
|
||||
#include <fastmath.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace Math3D
|
||||
{
|
||||
@@ -29,15 +27,15 @@ typedef double scalar_t;
|
||||
// written in this style to allow for easy substitution with more efficient versions
|
||||
inline scalar_t SINE_FUNCTION(scalar_t x)
|
||||
{
|
||||
return sin(x);
|
||||
return std::sin(x);
|
||||
}
|
||||
inline scalar_t COSINE_FUNCTION(scalar_t x)
|
||||
{
|
||||
return cos(x);
|
||||
return std::cos(x);
|
||||
}
|
||||
inline scalar_t SQRT_FUNCTION(scalar_t x)
|
||||
{
|
||||
return sqrt(x);
|
||||
return std::sqrt(x);
|
||||
}
|
||||
|
||||
// 2 element vector
|
||||
@@ -113,11 +111,11 @@ class vector3
|
||||
// };
|
||||
bool inline Equal(vector3 *v)
|
||||
{ // sprawdzenie odleg³oœci punktów
|
||||
if (fabs(x - v->x) > 0.02)
|
||||
if (std::fabs(x - v->x) > 0.02)
|
||||
return false; // szeœcian zamiast kuli
|
||||
if (fabs(z - v->z) > 0.02)
|
||||
if (std::fabs(z - v->z) > 0.02)
|
||||
return false;
|
||||
if (fabs(y - v->y) > 0.02)
|
||||
if (std::fabs(y - v->y) > 0.02)
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
@@ -635,5 +633,3 @@ std::ostream &operator<<(std::ostream &os, const Math3D::matrix4x4 &m)
|
||||
return os;
|
||||
}
|
||||
#endif // OSTREAM_MATH3D
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user