Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Sep 18, 2018
1 parent c9d9143 commit 30c0e23
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
22 changes: 11 additions & 11 deletions include/fcl/geometry/shape/convex-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class FCL_EXPORT Convex<double>;

//==============================================================================
template <typename S>
Convex<S>::Convex(const std::shared_ptr<const std::vector<Vector3<S>>> &vertices,
int num_faces, const std::shared_ptr<const std::vector<int>> &faces)
Convex<S>::Convex(const std::shared_ptr<const std::vector<Vector3<S>>>& vertices,
int num_faces, const std::shared_ptr<const std::vector<int>>& faces)
: ShapeBase<S>(),
vertices_(vertices),
num_faces_(num_faces),
Expand Down Expand Up @@ -93,8 +93,8 @@ NODE_TYPE Convex<S>::getNodeType() const {
// http://number-none.com/blow/inertia/bb_inertia.doc
template <typename S>
Matrix3<S> Convex<S>::computeMomentofInertia() const {
const std::vector<Vector3<S>> &vertices = *vertices_;
const std::vector<int> &faces = *faces_;
const std::vector<Vector3<S>>& vertices = *vertices_;
const std::vector<int>& faces = *faces_;
Matrix3<S> C = Matrix3<S>::Zero();

Matrix3<S> C_canonical;
Expand Down Expand Up @@ -131,7 +131,7 @@ Matrix3<S> Convex<S>::computeMomentofInertia() const {
vol_times_six += d_six_vol;
}

face_index += vertex_count + 2;
face_index += vertex_count + 1;
}

S trace_C = C(0, 0) + C(1, 1) + C(2, 2);
Expand All @@ -147,8 +147,8 @@ Matrix3<S> Convex<S>::computeMomentofInertia() const {
//==============================================================================
template <typename S>
Vector3<S> Convex<S>::computeCOM() const {
const std::vector<Vector3<S>> &vertices = *vertices_;
const std::vector<int> &faces = *faces_;
const std::vector<Vector3<S>>& vertices = *vertices_;
const std::vector<int>& faces = *faces_;
Vector3<S> com = Vector3<S>::Zero();
S vol = 0;
int face_index = 0;
Expand Down Expand Up @@ -178,16 +178,16 @@ Vector3<S> Convex<S>::computeCOM() const {
com += (v1 + v2 + face_center) * d_six_vol;
}

face_index += vertex_count + 2;
face_index += vertex_count + 1;
}

return com / (vol * 4); // here we choose zero as the reference
}

//==============================================================================
template <typename S> S Convex<S>::computeVolume() const {
const std::vector<Vector3<S>> &vertices = *vertices_;
const std::vector<int> &faces = *faces_;
const std::vector<Vector3<S>>& vertices = *vertices_;
const std::vector<int>& faces = *faces_;
S vol = 0;
int face_index = 0;
for(int i = 0; i < num_faces_; ++i) {
Expand Down Expand Up @@ -224,7 +224,7 @@ template <typename S> S Convex<S>::computeVolume() const {
vol += d_six_vol;
}

face_index += vertex_count + 2;
face_index += vertex_count + 1;
}

return vol / 6;
Expand Down
6 changes: 3 additions & 3 deletions include/fcl/geometry/shape/convex.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FCL_EXPORT Convex : public ShapeBase<S_>
/// @brief Constructor
///
/// @note: The %Convex geometry assumes that the input data %vertices and
/// %faces does not change through the life of the object.
/// %faces do not change through the life of the object.
///
/// @warning: The %Convex class does *not* validate the input; it trusts that
/// the inputs truly represent a coherent convex polytope.
Expand All @@ -98,8 +98,8 @@ class FCL_EXPORT Convex : public ShapeBase<S_>
/// @param faces Encoding of the polytope faces. Must encode
/// `num_faces` number of faces. See member
/// documentation for details on encoding.
Convex(const std::shared_ptr<const std::vector<Vector3<S>>> &vertices,
int num_faces, const std::shared_ptr<const std::vector<int>> &faces);
Convex(const std::shared_ptr<const std::vector<Vector3<S>>>& vertices,
int num_faces, const std::shared_ptr<const std::vector<int>>& faces);

/// @brief Copy constructor
Convex(const Convex& other) = default;
Expand Down
5 changes: 2 additions & 3 deletions include/fcl/geometry/shape/utility-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ struct FCL_EXPORT ComputeBVImpl<S, AABB<S>, Convex<S>>
const Vector3<S>& T = tf.translation();

AABB<S> bv_;
for(const auto& vertice : *(s.getVertices()))
for(const auto& vertex : *(s.getVertices()))
{
Vector3<S> new_p = R * vertice + T;
Vector3<S> new_p = R * vertex + T;
bv_ += new_p;
}

Expand All @@ -250,7 +250,6 @@ struct FCL_EXPORT ComputeBVImpl<S, OBB<S>, Convex<S>>
{
static void run(const Convex<S>& s, const Transform3<S>& tf, OBB<S>& bv)
{

fit(s.getVertices()->data(), (int)s.getVertices()->size(), bv);

bv.axis = tf.linear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2110,13 +2110,13 @@ static void supportConvex(const void* obj, const ccd_vec3_t* dir_, ccd_vec3_t* v

maxdot = -CCD_REAL_MAX;

for(const auto& vertice : *(c->convex->getVertices()))
for(const auto& vertex : *(c->convex->getVertices()))
{
ccdVec3Set(&p, vertice[0] - center[0], vertice[1] - center[1], vertice[2] - center[2]);
ccdVec3Set(&p, vertex[0] - center[0], vertex[1] - center[1], vertex[2] - center[2]);
dot = ccdVec3Dot(&dir, &p);
if(dot > maxdot)
{
ccdVec3Set(v, vertice[0], vertice[1], vertice[2]);
ccdVec3Set(v, vertex[0], vertex[1], vertex[2]);
maxdot = dot;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ Vector3<S> getSupport(
const Convex<S>* convex = static_cast<const Convex<S>*>(shape);
S maxdot = - std::numeric_limits<S>::max();
Vector3<S> bestv = Vector3<S>::Zero();
for(const auto& vertice : *(convex->getVertices()))
for(const auto& vertex : *(convex->getVertices()))
{
S dot = dir.dot(vertice);
S dot = dir.dot(vertex);
if(dot > maxdot)
{
bestv = vertice;
bestv = vertex;
maxdot = dot;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ bool convexHalfspaceIntersect(const Convex<S>& s1, const Transform3<S>& tf1,
Vector3<S> v;
S depth = std::numeric_limits<S>::max();

for(const auto& vertice : *(s1.getVertices()))
for(const auto& vertex : *(s1.getVertices()))
{
Vector3<S> p = tf1 * vertice;
Vector3<S> p = tf1 * vertex;

S d = new_s2.signedDistance(p);
if(d < depth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,9 @@ bool convexPlaneIntersect(const Convex<S>& s1, const Transform3<S>& tf1,
Vector3<S> v_min, v_max;
S d_min = std::numeric_limits<S>::max(), d_max = -std::numeric_limits<S>::max();

for(const auto& vertice : *(s1.getVertices()))
for(const auto& vertex : *(s1.getVertices()))
{
Vector3<S> p = tf1 * vertice;
Vector3<S> p = tf1 * vertex;

S d = new_s2.signedDistance(p);

Expand Down
4 changes: 2 additions & 2 deletions test/geometry/shape/test_convex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class Polytope {

// The scale of the polytope to use with test tolerances.
S scale() const { return scale_; }
const std::shared_ptr<const std::vector<Vector3<S>>>& points() const {
std::shared_ptr<const std::vector<Vector3<S>>> points() const {
return vertices_;
}
const std::shared_ptr<const std::vector<int>>& polygons() const {
std::shared_ptr<const std::vector<int>> polygons() const {
return polygons_;
}
Convex<S> MakeConvex() const {
Expand Down

0 comments on commit 30c0e23

Please sign in to comment.