scenepic 1.1.0
3D Visualization Made Easy
|
Container for Mesh creation information. More...
#include <mesh_info.h>
Public Member Functions | |
MeshInfo (std::size_t num_vertices, std::size_t num_triangles, bool has_uvs, bool has_normals, bool has_colors) | |
Constructor. More... | |
VectorBufferRef | position_buffer () |
A reference to the vector buffer containing the vertex positions. More... | |
const ConstVectorBufferRef | position_buffer () const |
A const reference to the vector buffer containing the vertex positions. More... | |
VectorBufferRef | normal_buffer () |
A reference to the vector buffer containing the vertex normals. More... | |
const ConstVectorBufferRef | normal_buffer () const |
A const reference to the vector buffer containing the vertex normals. More... | |
TriangleBufferRef | triangle_buffer () |
A reference to the triangle buffer containing the triangle vertex indices. More... | |
const ConstTriangleBufferRef | triangle_buffer () const |
A const reference to the triangle buffer containing the triangle vertex indices. More... | |
UVBufferRef | uv_buffer () |
A reference to the UV buffer containing the per-vertex UV values. More... | |
const ConstUVBufferRef | uv_buffer () const |
A const reference to the UV buffer containing the per-vertex UV values. More... | |
ColorBufferRef | color_buffer () |
A reference to the color buffer containing the per-vertex color values. More... | |
const ConstColorBufferRef | color_buffer () const |
A const reference to the color buffer containing the per-vertex color values. More... | |
bool | has_normals () const |
Whether the mesh info contains vertex normals. More... | |
std::shared_ptr< MeshInfo > | subdivide (int steps=1, bool project_to_limit=false) |
Subdivide this mesh using loop subdivision. More... | |
Container for Mesh creation information.
scenepic::MeshInfo::MeshInfo | ( | std::size_t | num_vertices, |
std::size_t | num_triangles, | ||
bool | has_uvs, | ||
bool | has_normals, | ||
bool | has_colors | ||
) |
Constructor.
This will allocate buffers to the given sizes. Note: A mesh cannot have both UVs and color information, though it can have neither.
num_vertices | the number of vertices in the mesh |
num_triangles | the number of triangles in the mesh |
has_uvs | whether the mesh will have vertex UVs |
has_normals | whether the mesh will have vertex normals |
has_colors | whether the mesh will have vertex colors |
ColorBufferRef scenepic::MeshInfo::color_buffer | ( | ) |
A reference to the color buffer containing the per-vertex color values.
const ConstColorBufferRef scenepic::MeshInfo::color_buffer | ( | ) | const |
A const reference to the color buffer containing the per-vertex color values.
bool scenepic::MeshInfo::has_normals | ( | ) | const |
Whether the mesh info contains vertex normals.
VectorBufferRef scenepic::MeshInfo::normal_buffer | ( | ) |
A reference to the vector buffer containing the vertex normals.
const ConstVectorBufferRef scenepic::MeshInfo::normal_buffer | ( | ) | const |
A const reference to the vector buffer containing the vertex normals.
VectorBufferRef scenepic::MeshInfo::position_buffer | ( | ) |
A reference to the vector buffer containing the vertex positions.
const ConstVectorBufferRef scenepic::MeshInfo::position_buffer | ( | ) | const |
A const reference to the vector buffer containing the vertex positions.
std::shared_ptr< MeshInfo > scenepic::MeshInfo::subdivide | ( | int | steps = 1 , |
bool | project_to_limit = false |
||
) |
Subdivide this mesh using loop subdivision.
steps | specifies how many steps of subdivision to apply. Defaults to 1. |
project_to_limit | specifies whether the vertices should be projected onto the limit surface in the final step of subdivision. Defaults to false. |
TriangleBufferRef scenepic::MeshInfo::triangle_buffer | ( | ) |
A reference to the triangle buffer containing the triangle vertex indices.
const ConstTriangleBufferRef scenepic::MeshInfo::triangle_buffer | ( | ) | const |
A const reference to the triangle buffer containing the triangle vertex indices.
UVBufferRef scenepic::MeshInfo::uv_buffer | ( | ) |
A reference to the UV buffer containing the per-vertex UV values.
const ConstUVBufferRef scenepic::MeshInfo::uv_buffer | ( | ) | const |
A const reference to the UV buffer containing the per-vertex UV values.