scenepic 1.1.0
3D Visualization Made Easy
Public Member Functions | List of all members
scenepic::MeshInfo Class Reference

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< MeshInfosubdivide (int steps=1, bool project_to_limit=false)
 Subdivide this mesh using loop subdivision. More...
 

Detailed Description

Container for Mesh creation information.

Constructor & Destructor Documentation

◆ MeshInfo()

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.

Parameters
num_verticesthe number of vertices in the mesh
num_trianglesthe number of triangles in the mesh
has_uvswhether the mesh will have vertex UVs
has_normalswhether the mesh will have vertex normals
has_colorswhether the mesh will have vertex colors

Member Function Documentation

◆ color_buffer() [1/2]

ColorBufferRef scenepic::MeshInfo::color_buffer ( )

A reference to the color buffer containing the per-vertex color values.

◆ color_buffer() [2/2]

const ConstColorBufferRef scenepic::MeshInfo::color_buffer ( ) const

A const reference to the color buffer containing the per-vertex color values.

◆ has_normals()

bool scenepic::MeshInfo::has_normals ( ) const

Whether the mesh info contains vertex normals.

◆ normal_buffer() [1/2]

VectorBufferRef scenepic::MeshInfo::normal_buffer ( )

A reference to the vector buffer containing the vertex normals.

◆ normal_buffer() [2/2]

const ConstVectorBufferRef scenepic::MeshInfo::normal_buffer ( ) const

A const reference to the vector buffer containing the vertex normals.

◆ position_buffer() [1/2]

VectorBufferRef scenepic::MeshInfo::position_buffer ( )

A reference to the vector buffer containing the vertex positions.

◆ position_buffer() [2/2]

const ConstVectorBufferRef scenepic::MeshInfo::position_buffer ( ) const

A const reference to the vector buffer containing the vertex positions.

◆ subdivide()

std::shared_ptr< MeshInfo > scenepic::MeshInfo::subdivide ( int  steps = 1,
bool  project_to_limit = false 
)

Subdivide this mesh using loop subdivision.

Parameters
stepsspecifies how many steps of subdivision to apply. Defaults to 1.
project_to_limitspecifies whether the vertices should be projected onto the limit surface in the final step of subdivision. Defaults to false.
Returns
a subdivided version of this mesh

◆ triangle_buffer() [1/2]

TriangleBufferRef scenepic::MeshInfo::triangle_buffer ( )

A reference to the triangle buffer containing the triangle vertex indices.

◆ triangle_buffer() [2/2]

const ConstTriangleBufferRef scenepic::MeshInfo::triangle_buffer ( ) const

A const reference to the triangle buffer containing the triangle vertex indices.

◆ uv_buffer() [1/2]

UVBufferRef scenepic::MeshInfo::uv_buffer ( )

A reference to the UV buffer containing the per-vertex UV values.

◆ uv_buffer() [2/2]

const ConstUVBufferRef scenepic::MeshInfo::uv_buffer ( ) const

A const reference to the UV buffer containing the per-vertex UV values.


The documentation for this class was generated from the following file: