Commit 64dc11fa authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Minor code improvements.

parent e861655b
......@@ -55,8 +55,8 @@ void generateBVHModel(BVHModel<BV>& model, const Box& shape, const Transform3f&
double a = shape.halfSide[0];
double b = shape.halfSide[1];
double c = shape.halfSide[2];
std::vector<Vec3f> points(8);
std::vector<Triangle> tri_indices(12);
Vec3f points[8];
Triangle tri_indices[12];
points[0] = Vec3f ( a, -b, c);
points[1] = Vec3f ( a, b, c);
points[2] = Vec3f (-a, b, c);
......@@ -66,16 +66,16 @@ void generateBVHModel(BVHModel<BV>& model, const Box& shape, const Transform3f&
points[6] = Vec3f (-a, b, -c);
points[7] = Vec3f (-a, -b, -c);
tri_indices[0].set(0, 4, 1);
tri_indices[1].set(1, 4, 5);
tri_indices[2].set(2, 6, 3);
tri_indices[3].set(3, 6, 7);
tri_indices[4].set(3, 0, 2);
tri_indices[5].set(2, 0, 1);
tri_indices[6].set(6, 5, 7);
tri_indices[7].set(7, 5, 4);
tri_indices[8].set(1, 5, 2);
tri_indices[9].set(2, 5, 6);
tri_indices[ 0].set(0, 4, 1);
tri_indices[ 1].set(1, 4, 5);
tri_indices[ 2].set(2, 6, 3);
tri_indices[ 3].set(3, 6, 7);
tri_indices[ 4].set(3, 0, 2);
tri_indices[ 5].set(2, 0, 1);
tri_indices[ 6].set(6, 5, 7);
tri_indices[ 7].set(7, 5, 4);
tri_indices[ 8].set(1, 5, 2);
tri_indices[ 9].set(2, 5, 6);
tri_indices[10].set(3, 7, 0);
tri_indices[11].set(0, 7, 4);
......
......@@ -126,7 +126,7 @@ namespace fcl {
FCL_REAL norm (normal.norm());
dist = norm - s1.radius - s2.radius;
FCL_REAL eps (std::numeric_limits<FCL_REAL>::epsilon());
static const FCL_REAL eps (std::numeric_limits<FCL_REAL>::epsilon());
if (norm > eps) {
normal.normalize();
} else {
......@@ -147,7 +147,7 @@ namespace fcl {
const Cylinder& s2, const Transform3f& tf2,
FCL_REAL& dist, Vec3f& p1, Vec3f& p2, Vec3f& normal)
{
FCL_REAL eps (sqrt (std::numeric_limits <FCL_REAL>::epsilon ()));
static const FCL_REAL eps (sqrt (std::numeric_limits <FCL_REAL>::epsilon ()));
FCL_REAL r1 (s1.radius);
FCL_REAL r2 (s2.radius);
FCL_REAL lz2 (.5*s2.lz);
......@@ -979,7 +979,7 @@ namespace fcl {
Q.array() += fudge2;
Vec3f n;
FCL_REAL eps = std::numeric_limits<FCL_REAL>::epsilon();
static const FCL_REAL eps = std::numeric_limits<FCL_REAL>::epsilon();
// separating axis = u1 x (v1,v2,v3)
tmp = pp[2] * R(1, 0) - pp[1] * R(2, 0);
......
......@@ -447,7 +447,7 @@ bool collide_Test_OBB(const Transform3f& tf,
bool success (initialize(node, (const BVHModel<OBB>&)m1, tf,
(const BVHModel<OBB>&)m2, Transform3f(),
local_result));
assert (success);
BOOST_REQUIRE (success);
node.enable_statistics = verbose;
......
Supports Markdown
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