Commit f28106f3 authored by Jan Möbius's avatar Jan Möbius
Browse files

More size_t fixes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17113 383ad7c9-94d9-4d36-a494-682f7c89f535
parent da4a59fc
......@@ -213,15 +213,15 @@ distPointTriangleSquared( const Vec& _p,
std::cerr << "distPointTriangleSquared: Degenerated triangle !\n";
return -1.0;
}
typename Vec::value_type invD = 1.0 / d;
typename Vec::value_type invD = Vec::value_type(1.0) / d;
// these are not needed for every point, should still perform
// better with many points against one triangle
Vec v1v2 = _v2 - _v1;
typename Vec::value_type inv_v0v2_2 = 1.0 / v0v2.sqrnorm();
typename Vec::value_type inv_v0v1_2 = 1.0 / v0v1.sqrnorm();
typename Vec::value_type inv_v1v2_2 = 1.0 / v1v2.sqrnorm();
typename Vec::value_type inv_v0v2_2 = typename Vec::value_type(1.0) / v0v2.sqrnorm();
typename Vec::value_type inv_v0v1_2 = typename Vec::value_type(1.0) / v0v1.sqrnorm();
typename Vec::value_type inv_v1v2_2 = typename Vec::value_type(1.0) / v1v2.sqrnorm();
Vec v0p = _p - _v0;
......@@ -1173,7 +1173,7 @@ triangleIntersection( const Vec& _o,
if (det > -0.000001 && det < 0.000001)
return false;
inv_det = 1.0 / det;
inv_det = typename Vec::value_type(1.0) / det;
//calculate distance from vert0 to ray origin
tvec = _o - _v0;
......
......@@ -95,7 +95,7 @@ public: //---------------------------------------------------------------------
/// Reserve memory for _n entries
void reserve(unsigned int _n) { handles_.reserve(_n); }
void reserve(size_t _n) { handles_.reserve(_n); }
/// Add a handle to the BSP
void push_back(Handle _h) { handles_.push_back(_h); ++n_triangles; }
......
......@@ -155,7 +155,7 @@ public:
}
vertices.unique(); ///todo: does this work with Points?!
int size = vertices.size();
size_t size = vertices.size();
typename std::list<Point>::iterator it_v;
it_v = vertices.begin();
std::advance(it_v, size / 2);
......
......@@ -54,8 +54,8 @@ TEST_F(ALGORITHM_TEST_BASE, triangleIntersection ) {
ACG::Vec3f p2 ( 0.0,1.0,0.0);
// Shooting ray origin and direction
ACG::Vec3f origin( 0.1, 0.1, -1.0);
ACG::Vec3f direction( 0.0, 0.0, 1.0);
ACG::Vec3f origin( 0.1f, 0.1f, -1.0f);
ACG::Vec3f direction( 0.0f, 0.0f, 1.0f);
float distance,u,v;
bool result = ACG::Geometry::triangleIntersection(origin, direction,
......@@ -97,7 +97,7 @@ TEST_F(ALGORITHM_TEST_BASE, triangleIntersection_FlippedTriangleOrientation ) {
ACG::Vec3f p2 ( 0.0,1.0,0.0);
// Shooting ray origin and direction
ACG::Vec3f origin( 0.1, 0.1, -1.0);
ACG::Vec3f origin( 0.1f, 0.1f, -1.0f);
ACG::Vec3f direction( 0.0, 0.0, 1.0);
float distance,u,v;
......@@ -140,8 +140,8 @@ TEST_F(ALGORITHM_TEST_BASE, triangleIntersection_NegativeShootingDirection ) {
ACG::Vec3f p2 ( 0.0,1.0,0.0);
// Shooting ray origin and direction
ACG::Vec3f origin( 0.1, 0.1, -1.0);
ACG::Vec3f direction( 0.0, 0.0, -1.0);
ACG::Vec3f origin( 0.1f, 0.1f, -1.0f);
ACG::Vec3f direction( 0.0f, 0.0f, -1.0f);
float distance,u,v;
bool result = ACG::Geometry::triangleIntersection(origin, direction,
......@@ -183,8 +183,8 @@ TEST_F(ALGORITHM_TEST_BASE, triangleIntersection_NegativeShootingDirection_Flipp
ACG::Vec3f p2 ( 0.0,1.0,0.0);
// Shooting ray origin and direction
ACG::Vec3f origin( 0.1, 0.1, -1.0);
ACG::Vec3f direction( 0.0, 0.0, -1.0);
ACG::Vec3f origin( 0.1f, 0.1f, -1.0f);
ACG::Vec3f direction( 0.0f, 0.0f, -1.0f);
float distance,u,v;
bool result = ACG::Geometry::triangleIntersection(origin, direction,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment