38 #ifndef COAL_GEOMETRIC_SHAPES_H
39 #define COAL_GEOMETRIC_SHAPES_H
44 #include <boost/math/constants/constants.hpp>
65 m_swept_sphere_radius(other.m_swept_sphere_radius) {}
79 std::invalid_argument);
81 this->m_swept_sphere_radius = radius;
116 :
ShapeBase(other), a(other.a), b(other.b), c(other.c) {}
152 if (other_ptr ==
nullptr)
return false;
155 return a == other.
a && b == other.
b && c == other.
c &&
160 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
167 :
ShapeBase(), halfSide(x / 2, y / 2, z / 2) {}
174 if (
this == &other)
return *
this;
198 Scalar V = computeVolume();
199 Vec3s s(halfSide.cwiseAbs2() * V);
200 return (
Vec3s(s[1] + s[2], s[0] + s[2], s[0] + s[1]) / 3).asDiagonal();
214 if (value <= minInflationValue())
216 <<
"is two small. It should be at least: "
217 << minInflationValue(),
218 std::invalid_argument);
219 return std::make_pair(
Box(2 * (halfSide + Vec3s::Constant(value))),
225 const Box* other_ptr =
dynamic_cast<const Box*
>(&_other);
226 if (other_ptr ==
nullptr)
return false;
227 const Box& other = *other_ptr;
229 return halfSide == other.
halfSide &&
234 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
260 Scalar I =
Scalar(0.4) * radius * radius * computeVolume();
261 return I * Matrix3s::Identity();
265 return 4 * boost::math::constants::pi<Scalar>() * radius * radius * radius /
280 if (value <= minInflationValue())
282 <<
") is two small. It should be at least: "
283 << minInflationValue(),
284 std::invalid_argument);
290 const Sphere* other_ptr =
dynamic_cast<const Sphere*
>(&_other);
291 if (other_ptr ==
nullptr)
return false;
292 const Sphere& other = *other_ptr;
294 return radius == other.
radius &&
299 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
328 Scalar V = computeVolume();
329 Scalar a2 = V * radii[0] * radii[0];
330 Scalar b2 = V * radii[1] * radii[1];
331 Scalar c2 = V * radii[2] * radii[2];
333 return (
Matrix3s() << alpha * (b2 + c2), 0, 0, 0, alpha * (a2 + c2), 0, 0,
334 0, alpha * (a2 + b2))
339 return 4 * boost::math::constants::pi<Scalar>() * radii[0] * radii[1] *
354 if (value <= minInflationValue())
356 <<
") is two small. It should be at least: "
357 << minInflationValue(),
358 std::invalid_argument);
359 return std::make_pair(
Ellipsoid(radii + Vec3s::Constant(value)),
366 if (other_ptr ==
nullptr)
return false;
369 return radii == other.
radii &&
374 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
387 halfLength = lz_ / 2;
391 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
409 return boost::math::constants::pi<Scalar>() * radius * radius *
410 ((halfLength * 2) + radius * 4 /
Scalar(3));
414 Scalar v_cyl = radius * radius * (halfLength * 2) *
415 boost::math::constants::pi<Scalar>();
416 Scalar v_sph = radius * radius * radius *
417 boost::math::constants::pi<Scalar>() * 4 /
Scalar(3);
419 Scalar h2 = halfLength * halfLength;
420 Scalar r2 = radius * radius;
423 v_sph * (
Scalar(0.4) * r2 + h2 +
Scalar(0.75) * radius * halfLength);
426 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
440 if (value <= minInflationValue())
442 <<
") is two small. It should be at least: "
443 << minInflationValue(),
444 std::invalid_argument);
445 return std::make_pair(
Capsule(radius + value, 2 * halfLength),
452 if (other_ptr ==
nullptr)
return false;
453 const Capsule& other = *other_ptr;
460 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
472 halfLength = lz_ / 2;
476 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
494 return boost::math::constants::pi<Scalar>() * radius * radius *
495 (halfLength * 2) / 3;
499 Scalar V = computeVolume();
501 V * (
Scalar(0.4) * halfLength * halfLength + 3 * radius * radius / 20);
504 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
520 if (value <= minInflationValue())
522 <<
") is two small. It should be at least: "
523 << minInflationValue(),
524 std::invalid_argument);
527 const Scalar tan_alpha = 2 * halfLength / radius;
528 const Scalar sin_alpha = tan_alpha / std::sqrt(1 + tan_alpha * tan_alpha);
529 const Scalar top_inflation = value / sin_alpha;
530 const Scalar bottom_inflation = value;
532 const Scalar new_lz = 2 * halfLength + top_inflation + bottom_inflation;
533 const Scalar new_cz = (top_inflation + bottom_inflation) /
Scalar(2);
534 const Scalar new_radius = new_lz / tan_alpha;
536 return std::make_pair(
Cone(new_radius, new_lz),
542 const Cone* other_ptr =
dynamic_cast<const Cone*
>(&_other);
543 if (other_ptr ==
nullptr)
return false;
544 const Cone& other = *other_ptr;
551 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
562 halfLength = lz_ / 2;
566 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
569 if (
this == &other)
return *
this;
571 this->radius = other.
radius;
592 return boost::math::constants::pi<Scalar>() * radius * radius *
597 Scalar V = computeVolume();
598 Scalar ix = V * (radius * radius / 4 + halfLength * halfLength / 3);
599 Scalar iz = V * radius * radius / 2;
600 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
614 if (value <= minInflationValue())
616 <<
") is two small. It should be at least: "
617 << minInflationValue(),
618 std::invalid_argument);
619 return std::make_pair(
Cylinder(radius + value, 2 * (halfLength + value)),
626 if (other_ptr ==
nullptr)
return false;
634 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
637 template <
typename _IndexType>
652 return !(*
this == other);
660 template <
typename _IndexType>
674 template <
typename OtherIndexType>
680 for (
size_t i = 0; i < this->indices.size(); ++i) {
681 res.indices.push_back(OtherIndexType(this->indices[i]));
690 template <
typename _IndexType>
699 template <
typename OtherIndexType>
716 bool keepTriangles,
const char* qhullCommand = NULL);
721 const char* qhullCommand = NULL);
757 template <
typename OtherIndexType>
770 #ifdef COAL_HAS_QHULL
781 const std::vector<Neighbors>& nns = *
neighbors;
784 unsigned char count = nns[i].count;
787 const std::vector<IndexType>& nns_vec = *
nneighbors_;
788 return nns_vec[begin_id + j];
796 std::shared_ptr<std::vector<Vec3s>>
points;
838 void initialize(std::shared_ptr<std::vector<Vec3s>> points_,
839 unsigned int num_points_);
845 void set(std::shared_ptr<std::vector<Vec3s>> points_,
846 unsigned int num_points_);
848 #ifdef COAL_HAS_QHULL
850 buildDoubleDescriptionFromQHullResult(
const orgQhull::Qhull& qh);
866 template <
typename OtherIndexType>
875 if (other_ptr ==
nullptr)
return false;
884 const std::vector<Vec3s>& points_ = *
points;
885 const std::vector<Vec3s>& other_points_ = *(other.
points);
886 for (
unsigned int i = 0; i <
num_points; ++i) {
887 if (points_[i] != (other_points_)[i])
return false;
895 const std::vector<Neighbors>& neighbors_ = *
neighbors;
896 const std::vector<Neighbors>& other_neighbors_ = *(other.
neighbors);
897 for (
unsigned int i = 0; i <
num_points; ++i) {
898 if (neighbors_[i] != other_neighbors_[i])
return false;
906 const std::vector<Vec3s>& normals_ = *
normals;
907 const std::vector<Vec3s>& other_normals_ = *(other.
normals);
909 if (normals_[i] != other_normals_[i])
return false;
917 const std::vector<Scalar>& offsets_ = *
offsets;
918 const std::vector<Scalar>& other_offsets_ = *(other.
offsets);
920 if (offsets_[i] != other_offsets_[i])
return false;
924 if (this->support_warm_starts.
points.size() !=
926 this->support_warm_starts.
indices.size() !=
931 for (
size_t i = 0; i < this->support_warm_starts.
points.size(); ++i) {
932 if (this->support_warm_starts.
points[i] !=
934 this->support_warm_starts.indices[i] !=
945 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
952 template <
typename PolygonT>
979 :
ShapeBase(other), n(other.n), d(other.d) {}
992 return n.dot(p) - (d + this->getSweptSphereRadius());
996 return std::abs(this->signedDistance(p));
1006 return std::numeric_limits<Scalar>::lowest();
1018 if (value <= minInflationValue())
1020 <<
") is two small. It should be at least: "
1021 << minInflationValue(),
1022 std::invalid_argument);
1039 if (other_ptr ==
nullptr)
return false;
1042 return n == other.
n && d == other.
d &&
1047 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1082 const Scalar dist = n.dot(p) - d;
1083 Scalar signed_dist = std::abs(n.dot(p) - d) - this->getSweptSphereRadius();
1087 if (signed_dist >= 0) {
1088 return -signed_dist;
1094 return std::abs(std::abs(n.dot(p) - d) - this->getSweptSphereRadius());
1115 const Plane* other_ptr =
dynamic_cast<const Plane*
>(&_other);
1116 if (other_ptr ==
nullptr)
return false;
1117 const Plane& other = *other_ptr;
1119 return n == other.
n && d == other.
d &&
1124 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Center at zero point, axis aligned box.
Definition: geometric_shapes.h:164
Box & operator=(const Box &other)
Definition: geometric_shapes.h:173
virtual Box * clone() const
Clone *this into a new Box.
Definition: geometric_shapes.h:181
Box()
Default constructor.
Definition: geometric_shapes.h:184
std::pair< Box, Transform3s > inflated(const Scalar value) const
Inflate the box by an amount given by value. This value can be positive or negative but must always >...
Definition: geometric_shapes.h:213
void computeLocalAABB()
Compute AABB.
Box(Scalar x, Scalar y, Scalar z)
Definition: geometric_shapes.h:166
Vec3s halfSide
box side half-length
Definition: geometric_shapes.h:187
Scalar minInflationValue() const
Definition: geometric_shapes.h:203
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:195
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:197
Box(const Vec3s &side_)
Definition: geometric_shapes.h:169
Box(const Box &other)
Definition: geometric_shapes.h:171
NODE_TYPE getNodeType() const
Get node type: a box.
Definition: geometric_shapes.h:193
Capsule It is where is the distance between the point x and the capsule segment AB,...
Definition: geometric_shapes.h:381
Scalar minInflationValue() const
Definition: geometric_shapes.h:429
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:413
virtual Capsule * clone() const
Clone *this into a new Capsule.
Definition: geometric_shapes.h:394
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:400
Capsule(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:386
Capsule(const Capsule &other)
Definition: geometric_shapes.h:390
void computeLocalAABB()
Compute AABB.
std::pair< Capsule, Transform3s > inflated(const Scalar value) const
Inflate the capsule by an amount given by value. This value can be positive or negative but must alwa...
Definition: geometric_shapes.h:439
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:408
Capsule()
Default constructor.
Definition: geometric_shapes.h:384
Scalar radius
Radius of capsule.
Definition: geometric_shapes.h:394
NODE_TYPE getNodeType() const
Get node type: a capsule.
Definition: geometric_shapes.h:406
The geometry for the object for collision or distance computation.
Definition: collision_object.h:96
Cone The base of the cone is at and the top is at .
Definition: geometric_shapes.h:466
std::pair< Cone, Transform3s > inflated(const Scalar value) const
Inflate the cone by an amount given by value. This value can be positive or negative but must always ...
Definition: geometric_shapes.h:519
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:485
Cone(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:471
NODE_TYPE getNodeType() const
Get node type: a cone.
Definition: geometric_shapes.h:491
Scalar minInflationValue() const
Definition: geometric_shapes.h:509
void computeLocalAABB()
Compute AABB.
Scalar radius
Radius of the cone.
Definition: geometric_shapes.h:479
Vec3s computeCOM() const
compute center of mass
Definition: geometric_shapes.h:507
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:493
virtual Cone * clone() const
Clone *this into a new Cone.
Definition: geometric_shapes.h:479
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:498
Cone()
Default constructor.
Definition: geometric_shapes.h:469
Cone(const Cone &other)
Definition: geometric_shapes.h:475
Base for convex polytope.
Definition: geometric_shapes.h:691
unsigned int num_points
Definition: geometric_shapes.h:797
virtual ConvexBaseTpl * deepcopy() const
Deep copy of the ConvexBaseTpl. This method deep copies every field of the class.
Definition: geometric_shapes.h:749
ShapeBase Base
Definition: geometric_shapes.h:697
std::shared_ptr< std::vector< Vec3s > > normals
An array of the normals of the polygon.
Definition: geometric_shapes.h:800
SupportWarmStartPolytope support_warm_starts
Support warm start polytopes.
Definition: geometric_shapes.h:822
std::shared_ptr< std::vector< Vec3s > > points
An array of the points of the polygon.
Definition: geometric_shapes.h:796
_IndexType IndexType
Definition: geometric_shapes.h:696
const Base & base() const
Const cast ConvexBaseTpl to ShapeBase. This method should never be marked as virtual.
Definition: geometric_shapes.h:731
static ConvexBaseTpl * convexHull(std::shared_ptr< std::vector< Vec3s >> &points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL)
Build a convex hull based on Qhull library and store the vertices and optionally the triangles.
Vec3s center
center of the convex polytope, this is used for collision: center is guaranteed in the internal of th...
Definition: geometric_shapes.h:813
virtual ~ConvexBaseTpl()
Definition: geometric_shapes.h:723
static constexpr size_t num_vertices_large_convex_threshold
Above this threshold, the convex polytope is considered large. This influcences the way the support f...
Definition: geometric_shapes.h:793
void buildSupportWarmStart()
Build the support points warm starts.
void computeCenter()
Definition: geometric_shapes.hxx:184
_IndexType index_type
Definition: geometric_shapes.h:694
ConvexBaseTpl & operator=(const ConvexBaseTpl &other)
Copy assignment operator. The copy assignment operator shallow copies the data, just as the copy cons...
Definition: geometric_shapes.hxx:88
static constexpr size_t num_support_warm_starts
Number of support warm starts.
Definition: geometric_shapes.h:819
void computeLocalAABB()
Compute AABB.
Definition: geometric_shapes.hxx:197
std::shared_ptr< std::vector< Neighbors > > neighbors
Neighbors of each vertex. It is an array of size num_points. For each vertex, it contains the number ...
Definition: geometric_shapes.h:809
static ConvexBaseTpl * convexHull(const Vec3s *points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL)
NODE_TYPE getNodeType() const
Get node type: a convex polytope.
Definition: geometric_shapes.hxx:50
void set(std::shared_ptr< std::vector< Vec3s >> points_, unsigned int num_points_)
Set the points of the convex shape.
Definition: geometric_shapes.hxx:82
friend class ConvexBaseTpl
Definition: geometric_shapes.h:700
std::shared_ptr< std::vector< Scalar > > offsets
An array of the offsets to the normals of the polygon. Note: there are as many offsets as normals.
Definition: geometric_shapes.h:803
virtual bool isEqual(const CollisionGeometry &_other) const
equal operator with another object of derived type.
Definition: geometric_shapes.h:872
ConvexBaseTpl< OtherIndexType > cast() const
Cast this ConvexBase vertex indices to OtherIndexType. This effectively deep copies this ConvexBaseTp...
Definition: geometric_shapes.h:758
ConvexBaseTpl()
Construct an uninitialized convex object Initialization is done with ConvexBase::initialize.
Definition: geometric_shapes.h:827
Base & base()
Cast ConvexBaseTpl to ShapeBase. This method should never be marked as virtual.
Definition: geometric_shapes.h:727
IndexType neighbor(IndexType i, IndexType j) const
Get the index of the j-th neighbor of the i-th vertex.
Definition: geometric_shapes.h:779
void initialize(std::shared_ptr< std::vector< Vec3s >> points_, unsigned int num_points_)
Initialize the points of the convex shape This also initializes the ConvexBase::center.
Definition: geometric_shapes.hxx:67
virtual ConvexBaseTpl * clone() const
Clone (deep copy).
Definition: geometric_shapes.h:745
ConvexBaseTpl(const ConvexBaseTpl &other)
Copy constructor. The copy constructor only shallow copies the data (it copies the shared pointers bu...
Definition: geometric_shapes.h:736
unsigned int num_normals_and_offsets
Definition: geometric_shapes.h:804
std::shared_ptr< std::vector< IndexType > > nneighbors_
Array of indices of the neighbors of each vertex. Since we don't know a priori the number of neighbor...
Definition: geometric_shapes.h:861
Convex polytope.
Definition: convex.h:50
Cylinder along Z axis. The cylinder is defined at its centroid.
Definition: geometric_shapes.h:556
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:596
Scalar radius
Radius of the cylinder.
Definition: geometric_shapes.h:577
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:591
Cylinder(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:561
Cylinder()
Default constructor.
Definition: geometric_shapes.h:559
Scalar minInflationValue() const
Definition: geometric_shapes.h:603
void computeLocalAABB()
Compute AABB.
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:583
Cylinder(const Cylinder &other)
Definition: geometric_shapes.h:565
std::pair< Cylinder, Transform3s > inflated(const Scalar value) const
Inflate the cylinder by an amount given by value. This value can be positive or negative but must alw...
Definition: geometric_shapes.h:613
NODE_TYPE getNodeType() const
Get node type: a cylinder.
Definition: geometric_shapes.h:589
virtual Cylinder * clone() const
Clone *this into a new Cylinder.
Definition: geometric_shapes.h:577
Cylinder & operator=(const Cylinder &other)
Definition: geometric_shapes.h:568
Ellipsoid centered at point zero.
Definition: geometric_shapes.h:303
Ellipsoid(const Ellipsoid &other)
Definition: geometric_shapes.h:312
Ellipsoid()
Default constructor.
Definition: geometric_shapes.h:306
void computeLocalAABB()
Compute AABB.
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:327
NODE_TYPE getNodeType() const
Get node type: an ellipsoid.
Definition: geometric_shapes.h:325
Ellipsoid(const Vec3s &radii)
Definition: geometric_shapes.h:310
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:338
virtual Ellipsoid * clone() const
Clone *this into a new Ellipsoid.
Definition: geometric_shapes.h:315
std::pair< Ellipsoid, Transform3s > inflated(const Scalar value) const
Inflate the ellipsoid by an amount given by value. This value can be positive or negative but must al...
Definition: geometric_shapes.h:353
Vec3s radii
Radii of the Ellipsoid (such that on boundary: x^2/rx^2 + y^2/ry^2.
Definition: geometric_shapes.h:315
Scalar minInflationValue() const
Definition: geometric_shapes.h:343
Ellipsoid(Scalar rx, Scalar ry, Scalar rz)
Definition: geometric_shapes.h:308
Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the dir...
Definition: geometric_shapes.h:963
Scalar minInflationValue() const
Definition: geometric_shapes.h:1005
Vec3s n
Plane normal.
Definition: geometric_shapes.h:1027
Halfspace & operator=(const Halfspace &other)
operator =
Definition: geometric_shapes.h:982
Scalar d
Plane offset.
Definition: geometric_shapes.h:1030
Scalar distance(const Vec3s &p) const
Definition: geometric_shapes.h:995
std::pair< Halfspace, Transform3s > inflated(const Scalar value) const
Inflate the halfspace by an amount given by value. This value can be positive or negative but must al...
Definition: geometric_shapes.h:1017
Halfspace(const Halfspace &other)
Definition: geometric_shapes.h:978
Halfspace(Scalar a, Scalar b, Scalar c, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:971
Halfspace()
Definition: geometric_shapes.h:976
Halfspace(const Vec3s &n_, Scalar d_)
Construct a half space with normal direction and offset.
Definition: geometric_shapes.h:966
Scalar signedDistance(const Vec3s &p) const
Definition: geometric_shapes.h:991
void unitNormalTest()
Turn non-unit normal into unit.
NODE_TYPE getNodeType() const
Get node type: a half space.
Definition: geometric_shapes.h:1003
virtual Halfspace * clone() const
Clone *this into a new Halfspace.
Definition: geometric_shapes.h:989
void computeLocalAABB()
Compute AABB.
Infinite plane. A plane can be viewed as two half spaces; it has no priviledged direction....
Definition: geometric_shapes.h:1054
Scalar distance(const Vec3s &p) const
Definition: geometric_shapes.h:1093
Plane()
Definition: geometric_shapes.h:1067
Vec3s n
Plane normal.
Definition: geometric_shapes.h:1104
virtual Plane * clone() const
Clone *this into a new Plane.
Definition: geometric_shapes.h:1079
Plane(const Vec3s &n_, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:1057
Plane(const Plane &other)
Definition: geometric_shapes.h:1069
void unitNormalTest()
Turn non-unit normal into unit.
void computeLocalAABB()
Compute AABB.
Plane & operator=(const Plane &other)
operator =
Definition: geometric_shapes.h:1072
Scalar signedDistance(const Vec3s &p) const
Definition: geometric_shapes.h:1081
NODE_TYPE getNodeType() const
Get node type: a plane.
Definition: geometric_shapes.h:1101
Scalar d
Plane offset.
Definition: geometric_shapes.h:1107
Plane(Scalar a, Scalar b, Scalar c, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:1062
Base class for all basic geometric shapes.
Definition: geometric_shapes.h:58
ShapeBase & operator=(const ShapeBase &other)=default
virtual ~ShapeBase()
Definition: geometric_shapes.h:69
ShapeBase(const ShapeBase &other)
 
Definition: geometric_shapes.h:63
void setSweptSphereRadius(Scalar radius)
Set radius of sphere swept around the shape. Must be >= 0.
Definition: geometric_shapes.h:76
OBJECT_TYPE getObjectType() const
Get object type: a geometric shape.
Definition: geometric_shapes.h:72
Scalar getSweptSphereRadius() const
Get radius of sphere swept around the shape. This radius is always >= 0.
Definition: geometric_shapes.h:86
ShapeBase()
Definition: geometric_shapes.h:60
Center at zero point sphere.
Definition: geometric_shapes.h:238
Scalar minInflationValue() const
Definition: geometric_shapes.h:269
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:259
Sphere(const Sphere &other)
Definition: geometric_shapes.h:245
std::pair< Sphere, Transform3s > inflated(const Scalar value) const
Inflate the sphere by an amount given by value. This value can be positive or negative but must alway...
Definition: geometric_shapes.h:279
void computeLocalAABB()
Compute AABB.
Sphere()
Default constructor.
Definition: geometric_shapes.h:241
Scalar radius
Radius of the sphere.
Definition: geometric_shapes.h:248
NODE_TYPE getNodeType() const
Get node type: a sphere.
Definition: geometric_shapes.h:257
virtual Sphere * clone() const
Clone *this into a new Sphere.
Definition: geometric_shapes.h:248
Sphere(Scalar radius_)
Definition: geometric_shapes.h:243
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:264
Triangle stores the points instead of only indices of points.
Definition: geometric_shapes.h:108
virtual TriangleP * clone() const
Clone *this into a new TriangleP.
Definition: geometric_shapes.h:119
NODE_TYPE getNodeType() const
get the node type
Definition: geometric_shapes.h:124
TriangleP(const TriangleP &other)
Definition: geometric_shapes.h:115
Vec3s a
Definition: geometric_shapes.h:147
Vec3s b
Definition: geometric_shapes.h:147
Vec3s c
Definition: geometric_shapes.h:147
void computeLocalAABB()
virtual function of compute AABB in local coordinate
TriangleP()
Definition: geometric_shapes.h:110
TriangleP(const Vec3s &a_, const Vec3s &b_, const Vec3s &c_)
Definition: geometric_shapes.h:112
#define COAL_DLLAPI
Definition: config.hh:88
#define COAL_DEPRECATED
Definition: deprecated.hh:37
#define COAL_DEPRECATED_MESSAGE(message)
Definition: deprecated.hh:38
#define COAL_THROW_PRETTY(message, exception)
Definition: fwd.hh:64
@ GEOM_CONE
Definition: collision_object.h:77
@ GEOM_TRIANGLE
Definition: collision_object.h:84
@ GEOM_BOX
Definition: collision_object.h:74
@ GEOM_SPHERE
Definition: collision_object.h:75
@ GEOM_CYLINDER
Definition: collision_object.h:78
@ GEOM_CAPSULE
Definition: collision_object.h:76
@ GEOM_ELLIPSOID
Definition: collision_object.h:86
@ GEOM_HALFSPACE
Definition: collision_object.h:83
@ GEOM_PLANE
Definition: collision_object.h:82
@ OT_GEOM
Definition: collision_object.h:55
ConvexBaseTpl< Triangle32::IndexType > ConvexBase32
Definition: geometric_shapes.h:949
ConvexBaseTpl< Triangle16::IndexType > ConvexBase16
Definition: geometric_shapes.h:948
Main namespace.
Definition: broadphase_bruteforce.h:44
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18,...
Definition: collision_object.h:64
Eigen::Matrix< Scalar, 3, 1 > Vec3s
Definition: data_types.h:70
double Scalar
Definition: data_types.h:68
OBJECT_TYPE
object type: BVH (mesh, points), basic geometry, octree
Definition: collision_object.h:52
Eigen::Matrix< Scalar, 3, 3 > Matrix3s
Definition: data_types.h:74
bool isEqual(const Eigen::MatrixBase< Derived > &lhs, const Eigen::MatrixBase< OtherDerived > &rhs, const Scalar tol=std::numeric_limits< Scalar >::epsilon() *100)
Definition: tools.h:204
Definition: geometric_shapes.h:638
_IndexType IndexType
Definition: geometric_shapes.h:639
unsigned char count
Definition: geometric_shapes.h:641
bool operator==(const ConvexBaseTplNeighbors &other) const
Definition: geometric_shapes.h:644
bool operator!=(const ConvexBaseTplNeighbors &other) const
Definition: geometric_shapes.h:651
IndexType begin_id
Definition: geometric_shapes.h:642
Definition: geometric_shapes.h:661
std::vector< Vec3s > points
Definition: geometric_shapes.h:666
std::vector< IndexType > indices
Definition: geometric_shapes.h:671
_IndexType IndexType
Definition: geometric_shapes.h:662
ConvexBaseTplSupportWarmStartPolytope< OtherIndexType > cast() const
Definition: geometric_shapes.h:675