33 #ifndef DART_DYNAMICS_MESHSHAPE_HPP_
34 #define DART_DYNAMICS_MESHSHAPE_HPP_
38 #include <assimp/scene.h>
81 const Eigen::Vector3d& scale,
90 const std::string&
getType()
const override;
105 const std::string& path =
"",
126 void setScale(
const Eigen::Vector3d& scale);
128 const Eigen::Vector3d&
getScale()
const;
155 static const aiScene*
loadMesh(
const std::string& filePath);
std::size_t index
Definition: SkelParser.cpp:1672
Definition: MeshShape.hpp:47
common::ResourceRetrieverPtr mResourceRetriever
Optional method of loading resources by URI.
Definition: MeshShape.hpp:182
const aiScene * mMesh
Definition: MeshShape.hpp:173
int mColorIndex
Specifies which color index should be used when mColorMode is COLOR_INDEX.
Definition: MeshShape.hpp:197
common::ResourceRetrieverPtr getResourceRetriever()
Definition: MeshShape.cpp:195
Eigen::Vector3d mScale
Scale.
Definition: MeshShape.hpp:188
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
AlphaMode
Alpha mode to specify how the alpha of this mesh should be determined.
Definition: MeshShape.hpp:60
@ BLEND
Blend alphas of visual aspect and mesh.
Definition: MeshShape.hpp:67
@ SHAPE_ALPHA
Always use the alpha of visual aspect.
Definition: MeshShape.hpp:76
@ AUTO
Use the alpha of mesh or visual aspect.
Definition: MeshShape.hpp:73
MeshShape(const Eigen::Vector3d &scale, const aiScene *mesh, const common::Uri &uri="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
Constructor.
Definition: MeshShape.cpp:130
void setScale(const Eigen::Vector3d &scale)
Definition: MeshShape.cpp:238
ColorMode
Definition: MeshShape.hpp:50
@ COLOR_INDEX
Use the colors specified by aiMesh::mColor.
Definition: MeshShape.hpp:52
@ MATERIAL_COLOR
Use the colors specified by the Mesh's material.
Definition: MeshShape.hpp:51
@ SHAPE_COLOR
Use the color specified by the visual aspect.
Definition: MeshShape.hpp:53
void updateVolume() const override
Updates volume.
Definition: MeshShape.cpp:355
int getDisplayList() const
Definition: MeshShape.cpp:292
ColorMode mColorMode
Specifies how the color of this mesh should be determined.
Definition: MeshShape.hpp:191
void updateBoundingBox() const override
Updates bounding box.
Definition: MeshShape.cpp:311
void setAlphaMode(AlphaMode mode)
Sets how the alpha of this mesh should be determined.
Definition: MeshShape.cpp:268
int mDisplayList
OpenGL DisplayList id for rendering.
Definition: MeshShape.hpp:185
AlphaMode mAlphaMode
Specifies how the alpha of this mesh should be determined.
Definition: MeshShape.hpp:194
~MeshShape() override
Destructor.
Definition: MeshShape.cpp:146
std::string mMeshPath
Path the mesh on disk, if available.
Definition: MeshShape.hpp:179
int getColorIndex() const
Get the index that will be used when the ColorMode is set to COLOR_INDEX.
Definition: MeshShape.cpp:286
const Eigen::Vector3d & getScale() const
Definition: MeshShape.cpp:250
Eigen::Matrix3d computeInertia(double mass) const override
Computes the inertia.
Definition: MeshShape.cpp:304
AlphaMode getAlphaMode() const
Returns the alpha mode that this mesh is using.
Definition: MeshShape.cpp:274
void setColorMode(ColorMode mode)
Set how the color of this mesh should be determined.
Definition: MeshShape.cpp:256
const std::string & getMeshPath() const
Returns path to the mesh on disk; an empty string if unavailable.
Definition: MeshShape.cpp:189
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:262
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:280
common::Uri mMeshUri
URI the mesh, if available).
Definition: MeshShape.hpp:176
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:435
void setDisplayList(int index)
Definition: MeshShape.cpp:298
void setMesh(const aiScene *mesh, const std::string &path="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
Definition: MeshShape.cpp:201
std::shared_ptr< ResourceRetriever > ResourceRetrieverPtr
Definition: ResourceRetriever.hpp:76
Definition: BulletCollisionDetector.cpp:65
The Uri struct provides URI parsing and merging functionality based on RFC 3986.
Definition: Uri.hpp:87