BaseMesh
Fields
Point const * | points |
Normal const * | normals |
UV const * | uvs |
RGBA32 const * | rgba32s |
uint32_t | point_count |
uint32_t | normal_count |
uint32_t | uv_count |
uint32_t | rgba32_count |
Detailed Description
-
class
BaseMesh
The BaseMesh class is used to define a Mesh as its base class.
It contains indexable properties common to all meshes.
Definable properties are points, normals, UV parameters, and RGBA32 colors along with their corresponding counts. Each of these attributes is given by a user-supplied array pointer that is NOT owned by the base mesh. The pointers must remain valid until the mesh is inserted into the database.
These properties are not directly used to represent geometry. Instead, they are indexed by mesh elements in order to define actual geometry.
The BaseMesh is movable but not copyable.
Subclassed by SC::Store::Mesh
Public Functions
-
~BaseMesh
() = default
Public Members
-
Point const *
points
An array of points.
Each point is constructed with a three-element float array. For example: SC::Store::Point
points[] = {
{ 0.0f, 0.0f, 1.0f },
{ 1.0f, 0.0f, 1.0f },
};
-
Normal const *
normals
An array of normals.
Each normal is constructed with a three-element float array. For example: SC::Store::Normal
normals[] = {
{ 0.0f, -1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f },
};
-
UV const *
uvs
An array of UV points.
Each UV is constructed with a two-element float array. For example: SC::Store::UV
uvs[] = {
{ 0.0f, -1.0f },
{ 0.0f, 0.0f },
};
-
RGBA32 const *
rgba32s
An array of RGBA32 color values.
Each RGBA32 object is constructed with a four-element array of 8-bit integers (0—255). For example: SC::Store::RGBA32
rgba[] = {
RGBA32(255, 0, 0, 255),
RGBA32(255, 0, 0, 128),
};
-
uint32_t
point_count
The number of Point elements in the points array.
A points array with the elements { 0.0f, 0.0f, 1.0f }, { 1.0f, 0.0f, 1.0f } would have a point_count of 2.
-
uint32_t
normal_count
The number of Normal elements in the normals array.
A normals array with the elements { 0.0f, -1.0f, 0.0f }, { 0.0f, 0.0f, 1.0f } would have a normal_count of 2.
-