33 #ifndef DART_DYNAMICS_MESHSHAPE_HPP_
34 #define DART_DYNAMICS_MESHSHAPE_HPP_
38 #include <assimp/scene.h>
72 const std::string&
getType()
const override;
90 const std::string& path =
"",
111 void setScale(
const Eigen::Vector3d& scale);
113 const Eigen::Vector3d&
getScale()
const;
134 static const aiScene*
loadMesh(
const std::string& filePath);
std::size_t index
Definition: SkelParser.cpp:1617
Definition: MeshShape.hpp:53
void notifyAlphaUpdated(double alpha) override
Notify that the alpha of this shape has updated.
Definition: MeshShape.cpp:189
common::ResourceRetrieverPtr mResourceRetriever
Optional method of loading resources by URI.
Definition: MeshShape.hpp:161
const aiScene * mMesh
Definition: MeshShape.hpp:152
int mColorIndex
Specifies which color index should be used when mColorMode is COLOR_INDEX.
Definition: MeshShape.hpp:173
common::ResourceRetrieverPtr getResourceRetriever()
Definition: MeshShape.cpp:206
Eigen::Vector3d mScale
Scale.
Definition: MeshShape.hpp:167
const common::Uri & getMeshUri2() const
Returns URI to the mesh; an empty string if unavailable.
Definition: MeshShape.cpp:177
static const std::string & getStaticType()
Returns shape type for this class.
Definition: MeshShape.cpp:158
MeshShape(const Eigen::Vector3d &scale, const aiScene *mesh, const common::Uri &uri="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
Constructor.
Definition: MeshShape.cpp:131
void setScale(const Eigen::Vector3d &scale)
Definition: MeshShape.cpp:248
ColorMode
Definition: MeshShape.hpp:56
@ COLOR_INDEX
Use the colors specified by aiMesh::mColor.
Definition: MeshShape.hpp:58
@ MATERIAL_COLOR
Use the colors specified by the Mesh's material.
Definition: MeshShape.hpp:57
@ SHAPE_COLOR
Use the color specified by the Shape base class.
Definition: MeshShape.hpp:59
void updateVolume() const override
Updates volume.
Definition: MeshShape.cpp:351
int getDisplayList() const
Definition: MeshShape.cpp:290
ColorMode mColorMode
Specifies how the color of this mesh should be determined.
Definition: MeshShape.hpp:170
void updateBoundingBox() const override
Updates bounding box.
Definition: MeshShape.cpp:309
int mDisplayList
OpenGL DisplayList id for rendering.
Definition: MeshShape.hpp:164
std::string mMeshPath
Path the mesh on disk, if available.
Definition: MeshShape.hpp:158
int getColorIndex() const
Get the index that will be used when the ColorMode is set to COLOR_INDEX.
Definition: MeshShape.cpp:284
const Eigen::Vector3d & getScale() const
Definition: MeshShape.cpp:260
Eigen::Matrix3d computeInertia(double mass) const override
Computes the inertia.
Definition: MeshShape.cpp:302
void setColorMode(ColorMode mode)
Set how the color of this mesh should be determined.
Definition: MeshShape.cpp:266
virtual ~MeshShape()
Destructor.
Definition: MeshShape.cpp:146
const std::string & getMeshPath() const
Returns path to the mesh on disk; an empty string if unavailable.
Definition: MeshShape.cpp:200
const aiScene * getMesh() const
Definition: MeshShape.cpp:165
std::string getMeshUri() const
Returns URI to the mesh as std::string; an empty string if unavailable.
Definition: MeshShape.cpp:171
ColorMode getColorMode() const
Get the coloring mode that this mesh is using.
Definition: MeshShape.cpp:272
virtual void update()
Updates positions of the vertices or the elements.
Definition: MeshShape.cpp:183
void setColorIndex(int index)
Set which entry in aiMesh::mColor should be used when the color mode is COLOR_INDEX.
Definition: MeshShape.cpp:278
common::Uri mMeshUri
URI the mesh, if available).
Definition: MeshShape.hpp:155
const std::string & getType() const override
Returns a string representing the shape type.
Definition: MeshShape.cpp:152
static const aiScene * loadMesh(const std::string &filePath)
Definition: MeshShape.cpp:431
void setDisplayList(int index)
Definition: MeshShape.cpp:296
void setMesh(const aiScene *mesh, const std::string &path="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
Definition: MeshShape.cpp:212
Definition: MeshShape.hpp:43
std::shared_ptr< ResourceRetriever > ResourceRetrieverPtr
Definition: ResourceRetriever.hpp:76
Definition: BulletCollisionDetector.cpp:63
The Uri struct provides URI parsing and merging functionality based on RFC 3986.
Definition: Uri.hpp:87