33 #ifndef DART_DYNAMICS_LINESEGMENTSHAPE_HPP_
34 #define DART_DYNAMICS_LINESEGMENTSHAPE_HPP_
53 const Eigen::Vector3d& _v1,
54 const Eigen::Vector3d& _v2,
55 float _thickness = 1.0f);
58 const std::string&
getType()
const override;
70 std::size_t
addVertex(
const Eigen::Vector3d& _v);
73 std::size_t
addVertex(
const Eigen::Vector3d& _v, std::size_t _parent);
83 void setVertex(std::size_t _idx,
const Eigen::Vector3d& _v);
87 const Eigen::Vector3d&
getVertex(std::size_t _idx)
const;
90 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:131
float getThickness() const
Get the line thickness/width used for rendering.
Definition: LineSegmentShape.cpp:104
Eigen::Matrix3d computeInertia(double mass) const override
The returned inertia matrix will be like a very thin cylinder.
Definition: LineSegmentShape.cpp:299
void updateVolume() const override
Updates volume.
Definition: LineSegmentShape.cpp:391
const Eigen::Vector3d & getVertex(std::size_t _idx) const
Get the location of the specified vertex.
Definition: LineSegmentShape.cpp:195
void setThickness(float _thickness)
Set the line thickness/width for rendering.
Definition: LineSegmentShape.cpp:90
float mThickness
Line thickness for rendering.
Definition: LineSegmentShape.hpp:121
std::vector< Eigen::Vector3d > mVertices
Vector of vertices.
Definition: LineSegmentShape.hpp:124
static const std::string & getStaticType()
Returns shape type for this class.
Definition: LineSegmentShape.cpp:83
void updateBoundingBox() const override
Updates bounding box.
Definition: LineSegmentShape.cpp:363
void addConnection(std::size_t _idx1, std::size_t _idx2)
Create a connection between the two specified vertices.
Definition: LineSegmentShape.cpp:222
std::size_t addVertex(const Eigen::Vector3d &_v)
Add a vertex as a child to the last vertex that was added.
Definition: LineSegmentShape.cpp:110
common::aligned_vector< Eigen::Vector2i > mConnections
Vector of connections.
Definition: LineSegmentShape.hpp:127
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:246
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:77
void removeVertex(std::size_t _idx)
Remove a vertex from the list of vertices.
Definition: LineSegmentShape.cpp:153
void setVertex(std::size_t _idx, const Eigen::Vector3d &_v)
Change the location of the specified vertex.
Definition: LineSegmentShape.cpp:175
const std::vector< Eigen::Vector3d > & getVertices() const
Get all the vertices.
Definition: LineSegmentShape.cpp:216
const common::aligned_vector< Eigen::Vector2i > & getConnections() const
Get all the connections.
Definition: LineSegmentShape.cpp:293
std::vector< _Tp, Eigen::aligned_allocator< _Tp > > aligned_vector
Definition: Memory.hpp:71
Definition: BulletCollisionDetector.cpp:65