33#ifndef DART_MATH_DETAIL_MESH_IMPL_HPP_
34#define DART_MATH_DETAIL_MESH_IMPL_HPP_
52 return !mVertices.empty();
59 return hasVertices() && mVertices.size() == mVertexNormals.size();
66 return this->mVertices;
73 return this->mVertexNormals;
81 mVertexNormals.clear();
88 return !(this->hasVertices());
95 for (
auto&
vertex : mVertices)
117 if ((isEmpty() || hasVertexNormals()) &&
other.hasVertexNormals())
119 mVertexNormals.insert(
120 mVertexNormals.end(),
121 other.mVertexNormals.begin(),
122 other.mVertexNormals.end());
126 mVertexNormals.
clear();
131 mVertices.end(),
other.mVertices.begin(),
other.mVertices.end());
147 for (
auto& normal : mVertexNormals)
Base class for meshes.
Definition Mesh.hpp:46
const Vertices & getVertices() const
Returns the vertices of the mesh.
Definition Mesh-impl.hpp:64
Eigen::Matrix< S, 3, 1 > Vector3
Definition Mesh.hpp:51
Mesh operator+(const Mesh &other) const
Addition operator.
Definition Mesh-impl.hpp:103
bool isEmpty() const
Returns true if the mesh has no vertices.
Definition Mesh-impl.hpp:86
std::vector< Vector3 > Normals
Definition Mesh.hpp:53
virtual ~Mesh()
Destructor.
Definition Mesh-impl.hpp:43
std::vector< Vector3 > Vertices
Definition Mesh.hpp:52
bool hasVertices() const
Returns true if the mesh contains vertices.
Definition Mesh-impl.hpp:50
virtual void clear()
Clears all the vertices and vertex normals.
Definition Mesh-impl.hpp:78
Mesh()
Default constructor.
Definition Mesh-impl.hpp:138
void normalizeVertexNormals()
Normalizes the vertex normals.
Definition Mesh-impl.hpp:145
bool hasVertexNormals() const
Returns true if the mesh contains vertex normals.
Definition Mesh-impl.hpp:57
void translate(const Vector3 &translation)
Translates the mesh vertices by adding translation to the vertices.
Definition Mesh-impl.hpp:93
const Normals & getVertexNormals() const
Returns the vertex normals of the mesh.
Definition Mesh-impl.hpp:71
Mesh & operator+=(const Mesh &other)
Addition assignment operator.
Definition Mesh-impl.hpp:110
Definition BulletCollisionDetector.cpp:60