39 #ifndef FCL_SHAPE_CONVEX_H 40 #define FCL_SHAPE_CONVEX_H 83 template <
typename S_>
111 int num_faces,
const std::shared_ptr<
const std::vector<int>>& faces,
112 bool throw_if_invalid =
false);
120 void computeLocalAABB()
override;
126 const std::vector<Vector3<S>>&
getVertices()
const {
return *vertices_; }
152 const std::vector<int>&
getFaces()
const {
return *faces_; }
159 Matrix3<S> computeMomentofInertia()
const override;
165 S computeVolume()
const override;
169 std::vector<Vector3<S>> getBoundVertices(
const Transform3<S>& tf)
const;
184 std::string representation(
int precision = 20)
const;
188 out <<
"Convex(v count: " << convex.
vertices_->size() <<
", f count: " 215 void ValidateMesh(
bool throw_on_error);
227 void ValidateTopology(
bool throw_on_error);
231 void FindVertexNeighbors();
233 const std::shared_ptr<const std::vector<Vector3<S>>>
vertices_;
235 const std::shared_ptr<const std::vector<int>>
faces_;
237 const bool throw_if_invalid_{};
267 bool find_extreme_via_neighbors_{
false};
272 static constexpr
int kMinVertCountForEdgeWalking = 32;
278 template <
typename S>
Convex(const std::shared_ptr< const std::vector< Vector3< S >>> &vertices, int num_faces, const std::shared_ptr< const std::vector< int >> &faces, bool throw_if_invalid=false)
Constructor.
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18, kDOP24), basic shape (box, sphere, ellipsoid, capsule, cone, cylinder, convex, plane, halfspace, triangle), and octree
Base class for all basic geometric shapes.
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
const std::shared_ptr< const std::vector< Vector3< S > > > vertices_
const std::shared_ptr< const std::vector< int > > faces_
Eigen::Matrix< S, 3, 3 > Matrix3
Eigen::Matrix< S, 3, 1 > Vector3
const std::vector< Vector3< S > > & getVertices() const
Gets the vertex positions in the geometry's frame G.
const std::vector< int > & getFaces() const
Gets the representation of the faces of the convex hull.
std::vector< int > neighbors_
const Vector3< S > & getInteriorPoint() const
A point guaranteed to be on the interior of the convex polytope, used for collision.
Vector3< S > interior_point_
int getFaceCount() const
Gets the total number of faces in the convex mesh.
friend std::ostream & operator<<(std::ostream &out, const Convex &convex)