|
coal 3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
|
Convex polytope. More...
#include <coal/shape/convex.h>


Public Types | |
| typedef PolygonT::IndexType | IndexType |
| typedef ConvexBaseTpl< IndexType > | Base |
| typedef Base::Neighbors | Neighbors |
Public Types inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| typedef PolygonT::IndexType | index_type |
| typedef PolygonT::IndexType | IndexType |
| typedef ShapeBase | Base |
| using | Neighbors = coal::ConvexBaseTplNeighbors< IndexType > |
| using | SupportWarmStartPolytope = ConvexBaseTplSupportWarmStartPolytope< IndexType > |
Public Member Functions | |
| ConvexTpl () | |
| Construct an uninitialized convex object. | |
| ~ConvexTpl () | |
| ConvexTpl (std::shared_ptr< std::vector< Vec3s > > points_, unsigned int num_points_, std::shared_ptr< std::vector< PolygonT > > polygons_, unsigned int num_polygons_) | |
| Constructing a convex, providing normal and offset of each polytype surface, and the points and shape topology information. | |
| Base & | base () |
| Cast Convex to ConvexBaseTpl. This method should never be marked as virtual. | |
| const Base & | base () const |
| Const cast Convex to ConvexBaseTpl. This method should never be marked as virtual. | |
| ConvexTpl (const ConvexTpl &other) | |
| Copy constructor. The copy constructor only shallow copies the data (it copies the shared pointers but does not deep clones the data). | |
| ConvexTpl & | operator= (const ConvexTpl &other) |
| Copy operator. The copy operator only shallow copies the data (it copies the shared pointers but does not deep clones the data). | |
| ConvexTpl * | clone () const override |
| Clone (deep copy). | |
| ConvexTpl * | deepcopy () const override |
| Deep copy of the ConvexBaseTpl. This method deep copies every field of the class. | |
| template<typename OtherPolygonT > | |
| ConvexTpl< OtherPolygonT > | cast () const |
| Cast this Convex vertex indices to OtherIndexType. This effectively deep copies this Convex into a new one. | |
| virtual Matrix3s | computeMomentofInertia () const override |
| based on http://number-none.com/blow/inertia/bb_inertia.doc | |
| virtual Vec3s | computeCOM () const override |
| compute center of mass | |
| virtual Scalar | computeVolume () const override |
| compute the volume | |
| 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. | |
Public Member Functions inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| ConvexBaseTpl (const ConvexBaseTpl &other) | |
| Copy constructor. The copy constructor only shallow copies the data (it copies the shared pointers but does not deep clones the data). | |
| virtual | ~ConvexBaseTpl () |
| Base & | base () |
| Cast ConvexBaseTpl to ShapeBase. This method should never be marked as virtual. | |
| const Base & | base () const |
| Const cast ConvexBaseTpl to ShapeBase. This method should never be marked as virtual. | |
| ConvexBaseTpl & | operator= (const ConvexBaseTpl &other) |
| Copy assignment operator. The copy assignment operator shallow copies the data, just as the copy constructor. | |
| ConvexBaseTpl< OtherIndexType > | cast () const |
| Cast this ConvexBase vertex indices to OtherIndexType. This effectively deep copies this ConvexBaseTpl into a new one. | |
| void | computeLocalAABB () |
| Compute AABB. | |
| NODE_TYPE | getNodeType () const |
| Get node type: a convex polytope. | |
| NODE_TYPE | getNodeType () const |
| get the node type | |
| NODE_TYPE | getNodeType () const |
| get the node type | |
| IndexType | neighbor (IndexType i, IndexType j) const |
| Get the index of the j-th neighbor of the i-th vertex. | |
Public Member Functions inherited from coal::ShapeBase | |
| ShapeBase () | |
| ShapeBase (const ShapeBase &other) | |
| | |
| ShapeBase & | operator= (const ShapeBase &other)=default |
| virtual | ~ShapeBase () |
| OBJECT_TYPE | getObjectType () const |
| Get object type: a geometric shape. | |
| void | setSweptSphereRadius (Scalar radius) |
| Set radius of sphere swept around the shape. Must be >= 0. | |
| Scalar | getSweptSphereRadius () const |
| Get radius of sphere swept around the shape. This radius is always >= 0. | |
Public Member Functions inherited from coal::CollisionGeometry | |
| CollisionGeometry () | |
| CollisionGeometry (const CollisionGeometry &other)=default | |
| Copy constructor. | |
| virtual | ~CollisionGeometry () |
| bool | operator== (const CollisionGeometry &other) const |
| Equality operator. | |
| bool | operator!= (const CollisionGeometry &other) const |
| Difference operator. | |
| void * | getUserData () const |
| get user data in geometry | |
| void | setUserData (void *data) |
| set user data in geometry | |
| bool | isOccupied () const |
| whether the object is completely occupied | |
| bool | isFree () const |
| whether the object is completely free | |
| bool | isUncertain () const |
| whether the object has some uncertainty | |
| virtual Matrix3s | computeMomentofInertiaRelatedToCOM () const |
| compute the inertia matrix, related to the com | |
Public Attributes | |
| std::shared_ptr< std::vector< PolygonT > > | polygons |
| An array of PolygonT object. PolygonT should contains a list of vertices for each polygon, in counter clockwise order. | |
| unsigned int | num_polygons |
Public Attributes inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| std::shared_ptr< std::vector< Vec3s > > | points |
| An array of the points of the polygon. | |
| unsigned int | num_points |
| std::shared_ptr< std::vector< Vec3s > > | normals |
| An array of the normals of the polygon. | |
| 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. | |
| unsigned int | num_normals_and_offsets |
| 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 of neighbors and a list of indices pointing to them. | |
| Vec3s | center |
| center of the convex polytope, this is used for collision: center is guaranteed in the internal of the polytope (as it is convex) | |
| SupportWarmStartPolytope | support_warm_starts |
| Support warm start polytopes. | |
Public Attributes inherited from coal::CollisionGeometry | |
| Vec3s | aabb_center |
| AABB center in local coordinate. | |
| Scalar | aabb_radius |
| AABB radius. | |
| AABB | aabb_local |
| AABB in local coordinate, used for tight AABB when only translation transform. | |
| void * | user_data |
| pointer to user defined data specific to this object | |
| Scalar | cost_density |
| collision cost for unit volume | |
| Scalar | threshold_occupied |
| threshold for occupied ( >= is occupied) | |
| Scalar | threshold_free |
| threshold for free (<= is free) | |
Protected Member Functions | |
| void | fillNeighbors () |
Protected Member Functions inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| ConvexBaseTpl () | |
| Construct an uninitialized convex object Initialization is done with ConvexBase::initialize. | |
| 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. | |
| void | set (std::shared_ptr< std::vector< Vec3s > > points_, unsigned int num_points_) |
| Set the points of the convex shape. | |
| void | buildSupportWarmStart () |
| Build the support points warm starts. | |
| void | computeCenter () |
| virtual bool | isEqual (const CollisionGeometry &_other) const |
| equal operator with another object of derived type. | |
Static Protected Member Functions | |
| template<typename OtherPolygonT > | |
| static void | deepcopy (const ConvexTpl< PolygonT > *source, ConvexTpl< OtherPolygonT > *copy) |
Static Protected Member Functions inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| static void | deepcopy (const ConvexBaseTpl< IndexType > *source, ConvexBaseTpl< OtherIndexType > *copy) |
| Deep copy of a ConvexBaseTpl. This method deep copies every field of the class. | |
Additional Inherited Members | |
Static Public Member Functions inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| 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. | |
| static ConvexBaseTpl * | convexHull (const Vec3s *points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL) |
Static Public Attributes inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| static constexpr size_t | num_vertices_large_convex_threshold |
| Above this threshold, the convex polytope is considered large. This influcences the way the support function is computed. | |
| static constexpr size_t | num_support_warm_starts |
| Number of support warm starts. | |
Protected Attributes inherited from coal::ConvexBaseTpl< PolygonT::IndexType > | |
| 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 neighbors of each vertex, we store the indices of the neighbors in a single array. The neighbors attribute, an array of Neighbors, is used to point each vertex to the right indices in the nneighbors_ array. | |
Protected Attributes inherited from coal::ShapeBase | |
| Scalar | m_swept_sphere_radius {0} |
Radius of the sphere swept around the shape. Default value is 0. Note: this property differs from inflated method of certain derived classes (e.g. Box, Sphere, Ellipsoid, Capsule, Cone, Cylinder) in the sense that inflated returns a new shape which can be inflated but also deflated. Also, an inflated shape is not rounded. It simply has a different size. Sweeping a shape with a sphere is a different operation (a Minkowski sum), which rounds the sharp corners of a shape. The swept sphere radius is a property of the shape itself and can be manually updated between collision checks. | |
Convex polytope.
| PolygonT | the polygon class. It must have method size() and operator[](int i) |
| typedef ConvexBaseTpl<IndexType> coal::ConvexTpl< PolygonT >::Base |
| typedef PolygonT::IndexType coal::ConvexTpl< PolygonT >::IndexType |
| typedef Base::Neighbors coal::ConvexTpl< PolygonT >::Neighbors |
|
inline |
Construct an uninitialized convex object.
|
inline |
| coal::ConvexTpl< PolygonT >::ConvexTpl | ( | std::shared_ptr< std::vector< Vec3s > > | points_, |
| unsigned int | num_points_, | ||
| std::shared_ptr< std::vector< PolygonT > > | polygons_, | ||
| unsigned int | num_polygons_ | ||
| ) |
Constructing a convex, providing normal and offset of each polytype surface, and the points and shape topology information.
| points_ | list of 3D points |
| num_points_ | number of 3D points |
| polygons_ | |
| num_polygons_ | the number of polygons. |
|
inline |
Copy constructor. The copy constructor only shallow copies the data (it copies the shared pointers but does not deep clones the data).
|
inline |
Cast Convex to ConvexBaseTpl. This method should never be marked as virtual.
Const cast Convex to ConvexBaseTpl. This method should never be marked as virtual.
|
inline |
Cast this Convex vertex indices to OtherIndexType. This effectively deep copies this Convex into a new one.
|
inlineoverridevirtual |
Clone (deep copy).
Reimplemented from coal::ConvexBaseTpl< PolygonT::IndexType >.
|
overridevirtual |
compute center of mass
Reimplemented from coal::CollisionGeometry.
|
overridevirtual |
based on http://number-none.com/blow/inertia/bb_inertia.doc
Reimplemented from coal::CollisionGeometry.
|
overridevirtual |
compute the volume
Reimplemented from coal::CollisionGeometry.
|
inlineoverridevirtual |
Deep copy of the ConvexBaseTpl. This method deep copies every field of the class.
Reimplemented from coal::ConvexBaseTpl< PolygonT::IndexType >.
|
staticprotected |
|
protected |
| ConvexTpl< PolygonT > & coal::ConvexTpl< PolygonT >::operator= | ( | const ConvexTpl< PolygonT > & | other | ) |
Copy operator. The copy operator only shallow copies the data (it copies the shared pointers but does not deep clones the data).
| void coal::ConvexTpl< PolygonT >::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.
| points | list of 3D points |
| num_points | number of 3D points |
| polygons | |
| num_polygons | the number of polygons. |
| std::shared_ptr<std::vector<PolygonT> > coal::ConvexTpl< PolygonT >::polygons |
An array of PolygonT object. PolygonT should contains a list of vertices for each polygon, in counter clockwise order.