16 #ifndef SURGSIM_MATH_MESHSHAPE_H 17 #define SURGSIM_MATH_MESHSHAPE_H 21 #include "SurgSim/DataStructures/EmptyData.h" 22 #include "SurgSim/DataStructures/NormalData.h" 23 #include "SurgSim/DataStructures/TriangleMesh.h" 24 #include "SurgSim/Framework/ObjectFactory.h" 26 #include "SurgSim/Math/Shape.h" 27 #include "SurgSim/Math/VerticesShape.h" 31 namespace DataStructures
40 SURGSIM_STATIC_REGISTRATION(MeshShape);
57 SurgSim::DataStructures::EmptyData, SurgSim::DataStructures::NormalData>
72 template <
class V,
class E,
class T>
77 int getType()
const override;
84 double getVolume()
const override;
86 Vector3d getCenter()
const override;
88 Matrix33d getSecondMomentOfVolume()
const override;
90 std::shared_ptr<Shape> getTransformed(
const RigidTransform3d& pose)
const override;
94 const std::shared_ptr<const SurgSim::DataStructures::AabbTree> getAabbTree()
const;
101 void buildAabbTree();
105 void updateAabbTree();
110 bool calculateNormals();
112 void updateShape()
override;
113 void updateShapePartial()
override;
116 bool doUpdate()
override;
118 bool doLoad(
const std::string& fileName)
override;
122 virtual void computeVolumeIntegrals();
135 std::shared_ptr<SurgSim::DataStructures::AabbTree> m_aabbTree;
136 std::vector<SurgSim::Math::Aabbd> m_aabbCache;
142 #include "SurgSim/Math/MeshShape-inl.h" 144 #endif // SURGSIM_MATH_MESHSHAPE_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Mesh shape: shape made of a triangle mesh The triangle mesh needs to be watertight to produce valid v...
Definition: MeshShape.h:56
double m_volume
Volume (in m^-3)
Definition: MeshShape.h:128
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
A Shape that also inherits from Vertices is transformable and carries a member variable of the initia...
Definition: VerticesShape.h:30
SurgSim::Math::Matrix33d m_secondMomentOfVolume
Second moment of volume.
Definition: MeshShape.h:131
bool isValid(float value)
Check if a float value is valid.
Definition: Valid-inl.h:97
Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality...
Definition: TriangleMesh.h:62
SurgSim::Math::Vector3d m_center
Center (considering a uniform distribution in the mesh volume)
Definition: MeshShape.h:125
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51