8 #ifndef META_OCEAN_TRACKING_MAPTEXTURING_BLOCKED_MESH_H
9 #define META_OCEAN_TRACKING_MAPTEXTURING_BLOCKED_MESH_H
27 namespace MapTexturing
46 typedef std::unordered_map<Index32, Index32>
IndexMap;
57 boundingBox_(boundingBox),
58 boundingSphere_(boundingBox),
59 vertices_(std::move(vertices)),
60 perVertexNormals_(std::move(perVertexNormals)),
61 perVertexColors_(std::move(perVertexColors)),
62 triangleFaces_(std::move(triangleFaces))
64 ocean_assert(!triangleFaces_.empty() == boundingBox_.isValid());
85 return boundingSphere_;
90 return !triangleFaces_.empty();
109 triangleIndex =
Index32(triangleId >> 32u);
This class implements a color defined by red, green, blue and alpha parameters.
Definition: RGBAColor.h:41
Definition of a triangle face with three vertex indices.
Definition: TriangleFace.h:37
This class implements a blocked mesh storing only triangles located in a 3D block/box.
Definition: BlockedMesh.h:43
static BlockedMeshes separateMesh(const Vectors3 &vertices, const Rendering::TriangleFaces &triangleFaces, const int blockSize=1)
BlockedMesh(const VectorI3 &block, const Box3 &boundingBox, Vectors3 &&vertices, Vectors3 &&perVertexNormals, RGBAColors &&perVertexColors, Rendering::TriangleFaces &&triangleFaces)
Definition: BlockedMesh.h:55
Rendering::TriangleFaces triangleFaces_
The triangle faces of this mesh.
Definition: BlockedMesh.h:130
bool isValid() const
Definition: BlockedMesh.h:88
RGBAColors perVertexColors_
The per-vertex colors of this mesh.
Definition: BlockedMesh.h:127
Box3 boundingBox_
Definition: BlockedMesh.h:116
std::unordered_map< Index32, Index32 > IndexMap
Definition: BlockedMesh.h:46
static Index64 makeTriangleId(const Index32 &meshId, const Index32 &triangleIndex)
Definition: BlockedMesh.h:101
Sphere3 boundingSphere_
Definition: BlockedMesh.h:118
static BlockedMeshes separateMesh(const Vectors3 &vertices, const Vectors3 &perVertexNormals, const Rendering::TriangleFaces &triangleFaces, const int blockSize=1)
Vectors3 vertices_
The vertices of this mesh.
Definition: BlockedMesh.h:121
BlockedMesh()=default
Default constructor.
VectorI3 block_
Definition: BlockedMesh.h:114
IndexMap indexMap_
Definition: BlockedMesh.h:132
const VectorI3 & block() const
Definition: BlockedMesh.h:73
static BlockedMeshes separateMesh(const Vectors3 &vertices, const Vectors3 &perVertexNormals, const RGBAColors &perVertexColors, const Rendering::TriangleFaces &triangleFaces, const int blockSize=1)
Vectors3 perVertexNormals_
The per-vertex normals of this mesh.
Definition: BlockedMesh.h:124
void addTriangle(const Rendering::TriangleFace &triangleFace, const Vector3 *vertices)
const Sphere3 & boundingSphere() const
Definition: BlockedMesh.h:83
static VectorT3< int > vertex2block(const Vector3 &vertex, const int blockSize)
void addTriangle(const Rendering::TriangleFace &triangleFace, const Vector3 *vertices, const Vector3 *perVertexNormals, const RGBAColor *perVertexColors)
void addTriangle(const Rendering::TriangleFace &triangleFace, const Vector3 *vertices, const Vector3 *perVertexNormals)
static void separateTriangleId(const Index64 triangleId, Index32 &meshId, Index32 &triangleIndex)
Definition: BlockedMesh.h:106
const Box3 & boundingBox() const
Definition: BlockedMesh.h:78
uint64_t Index64
Definition of a 64 bit index value.
Definition: Base.h:90
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
std::vector< RGBAColor > RGBAColors
Definition of a vector holding rgba color objects.
Definition: RGBAColor.h:21
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
std::vector< TriangleFace > TriangleFaces
Definition of a vector holding triangle faces.
Definition: TriangleFace.h:23
std::vector< BlockedMesh > BlockedMeshes
Definition of a vector holding BlockedMesh objects.
Definition: BlockedMesh.h:31
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15