38 #ifndef COAL_SHAPE_CONVEX_H
39 #define COAL_SHAPE_CONVEX_H
49 template <
typename PolygonT>
72 ConvexTpl(std::shared_ptr<std::vector<Vec3s>> points_,
73 unsigned int num_points_,
74 std::shared_ptr<std::vector<PolygonT>> polygons_,
75 unsigned int num_polygons_);
83 const Base &
base()
const {
return static_cast<const Base &
>(*this); }
109 template <
typename OtherPolygonT>
133 std::shared_ptr<std::vector<PolygonT>>
polygons,
147 template <
typename OtherPolygonT>
Base for convex polytope.
Definition: geometric_shapes.h:691
unsigned int num_points
Definition: geometric_shapes.h:797
std::shared_ptr< std::vector< Vec3s > > points
An array of the points of the polygon.
Definition: geometric_shapes.h:796
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
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
Base & base()
Cast Convex to ConvexBaseTpl. This method should never be marked as virtual.
Definition: convex.h:79
virtual Matrix3s computeMomentofInertia() const override
based on http://number-none.com/blow/inertia/bb_inertia.doc
Definition: convex.hxx:115
ConvexTpl()
Construct an uninitialized convex object.
Definition: convex.h:61
ConvexBaseTpl< IndexType > Base
Definition: convex.h:53
void set(std::shared_ptr< std::vector< Vec3s >> points, unsigned int num_points, std::shared_ptr< std::vector< PolygonT >> polygons, unsigned int num_polygons)
Set the current Convex from a list of points and polygons.
Definition: convex.hxx:101
ConvexTpl< OtherPolygonT > cast() const
Cast this Convex vertex indices to OtherIndexType. This effectively deep copies this Convex into a ne...
Definition: convex.h:110
ConvexTpl & operator=(const ConvexTpl &other)
Copy operator. The copy operator only shallow copies the data (it copies the shared pointers but does...
Definition: convex.hxx:60
~ConvexTpl()
Definition: convex.h:63
void fillNeighbors()
Definition: convex.hxx:266
Base::Neighbors Neighbors
Definition: convex.h:54
std::shared_ptr< std::vector< PolygonT > > polygons
An array of PolygonT object. PolygonT should contains a list of vertices for each polygon,...
Definition: convex.h:139
ConvexTpl * clone() const override
Clone (deep copy).
Definition: convex.h:97
virtual Scalar computeVolume() const override
compute the volume
Definition: convex.hxx:220
ConvexTpl * deepcopy() const override
Deep copy of the ConvexBaseTpl. This method deep copies every field of the class.
Definition: convex.h:101
const Base & base() const
Const cast Convex to ConvexBaseTpl. This method should never be marked as virtual.
Definition: convex.h:83
PolygonT::IndexType IndexType
Definition: convex.h:52
virtual Vec3s computeCOM() const override
compute center of mass
Definition: convex.hxx:175
unsigned int num_polygons
Definition: convex.h:140
ConvexTpl(const ConvexTpl &other)
Copy constructor. The copy constructor only shallow copies the data (it copies the shared pointers bu...
Definition: convex.h:88
#define COAL_DEPRECATED_MESSAGE(message)
Definition: deprecated.hh:38
Main namespace.
Definition: broadphase_bruteforce.h:44
ConvexTpl< Triangle32 > Convex32
Definition: convex.h:155
ConvexTpl< Triangle16 > Convex16
Definition: convex.h:154
Eigen::Matrix< Scalar, 3, 1 > Vec3s
Definition: data_types.h:70
double Scalar
Definition: data_types.h:68
Eigen::Matrix< Scalar, 3, 3 > Matrix3s
Definition: data_types.h:74
Definition: geometric_shapes.h:638