33 #ifndef DART_DYNAMICS_LINESEGMENTSHAPE_HPP_
34 #define DART_DYNAMICS_LINESEGMENTSHAPE_HPP_
53 float _thickness = 1.0f);
56 const std::string&
getType()
const override;
68 std::size_t
addVertex(
const Eigen::Vector3d& _v);
71 std::size_t
addVertex(
const Eigen::Vector3d& _v, std::size_t _parent);
81 void setVertex(std::size_t _idx,
const Eigen::Vector3d& _v);
85 const Eigen::Vector3d&
getVertex(std::size_t _idx)
const;
88 const std::vector<Eigen::Vector3d>&
getVertices()
const;
The LineSegmentShape facilitates creating graphs of line segments.
Definition: LineSegmentShape.hpp:46
static const Eigen::Vector3d mDummyVertex
A dummy vertex that can be returned when an out-of-bounds vertex is requested.
Definition: LineSegmentShape.hpp:129
float getThickness() const
Get the line thickness/width used for rendering.
Definition: LineSegmentShape.cpp:107
Eigen::Matrix3d computeInertia(double mass) const override
The returned inertia matrix will be like a very thin cylinder.
Definition: LineSegmentShape.cpp:292
void updateVolume() const override
Updates volume.
Definition: LineSegmentShape.cpp:383
const Eigen::Vector3d & getVertex(std::size_t _idx) const
Get the location of the specified vertex.
Definition: LineSegmentShape.cpp:194
void setThickness(float _thickness)
Set the line thickness/width for rendering.
Definition: LineSegmentShape.cpp:93
float mThickness
Line thickness for rendering.
Definition: LineSegmentShape.hpp:119
std::vector< Eigen::Vector3d > mVertices
Vector of vertices.
Definition: LineSegmentShape.hpp:122
static const std::string & getStaticType()
Returns shape type for this class.
Definition: LineSegmentShape.cpp:86
void updateBoundingBox() const override
Updates bounding box.
Definition: LineSegmentShape.cpp:355
void addConnection(std::size_t _idx1, std::size_t _idx2)
Create a connection between the two specified vertices.
Definition: LineSegmentShape.cpp:221
std::size_t addVertex(const Eigen::Vector3d &_v)
Add a vertex as a child to the last vertex that was added.
Definition: LineSegmentShape.cpp:113
common::aligned_vector< Eigen::Vector2i > mConnections
Vector of connections.
Definition: LineSegmentShape.hpp:125
void removeConnection(std::size_t _vertexIdx1, std::size_t _vertexIdx2)
Search for a connection between two vertices and break it if it exists.
Definition: LineSegmentShape.cpp:243
LineSegmentShape(float _thickness=1.0f)
Default constructor.
Definition: LineSegmentShape.cpp:44
const std::string & getType() const override
Returns a string representing the shape type.
Definition: LineSegmentShape.cpp:80
void removeVertex(std::size_t _idx)
Remove a vertex from the list of vertices.
Definition: LineSegmentShape.cpp:152
void setVertex(std::size_t _idx, const Eigen::Vector3d &_v)
Change the location of the specified vertex.
Definition: LineSegmentShape.cpp:174
const std::vector< Eigen::Vector3d > & getVertices() const
Get all the vertices.
Definition: LineSegmentShape.cpp:215
const common::aligned_vector< Eigen::Vector2i > & getConnections() const
Get all the connections.
Definition: LineSegmentShape.cpp:286
std::vector< _Tp, Eigen::aligned_allocator< _Tp > > aligned_vector
Definition: Memory.hpp:66
Definition: BulletCollisionDetector.cpp:63