From 30cdb2740906a33a891963b49d77e69954c579cc Mon Sep 17 00:00:00 2001 From: Lucile Remigy <lucile.remigy@epitech.eu> Date: Fri, 4 Oct 2019 09:43:54 +0200 Subject: [PATCH] initialize lz = lz_ and HAlfLength = lz_/2 --- include/hpp/fcl/shape/geometric_shapes.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/include/hpp/fcl/shape/geometric_shapes.h b/include/hpp/fcl/shape/geometric_shapes.h index 2aa5b444..776183ec 100644 --- a/include/hpp/fcl/shape/geometric_shapes.h +++ b/include/hpp/fcl/shape/geometric_shapes.h @@ -149,12 +149,10 @@ class Capsule : public ShapeBase public: Capsule(FCL_REAL radius_, FCL_REAL lz_) : ShapeBase(), radius(radius_), lz(lz_) { - lz = 0; - HalfLength = lz/2; + lz = lz_ + HalfLength = lz_/2; } - // Capsule::Capsule() : HalfLength(lz/2), lz(0){} - /// @brief Radius of capsule FCL_REAL radius; @@ -196,12 +194,10 @@ class Cone : public ShapeBase public: Cone(FCL_REAL radius_, FCL_REAL lz_) : ShapeBase(), radius(radius_), lz(lz_) { - lz = 0; - HalfLength = lz/2; + lz = lz_ + HalfLength = lz_/2; } - //Cone::Cone() : HalfLength(lz/2), lz(0){} - /// @brief Radius of the cone FCL_REAL radius; @@ -245,11 +241,9 @@ class Cylinder : public ShapeBase public: Cylinder(FCL_REAL radius_, FCL_REAL lz_) : ShapeBase(), radius(radius_), lz(lz_) { - lz = 0; - HalfLength = lz/2; + lz = lz_ + HalfLength = lz_/2; } - - // Cylinder::Cylinder() : HalfLength(lz/2), lz(0){} /// @brief Radius of the cylinder FCL_REAL radius; -- GitLab