scenepic 1.1.0
3D Visualization Made Easy
mesh_info.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_MESH_INFO_H_
5#define _SCENEPIC_MESH_INFO_H_
6
7#include "matrix.h"
8
9#include <memory>
10
11namespace scenepic
12{
15 {
16 public:
27 std::size_t num_vertices,
28 std::size_t num_triangles,
29 bool has_uvs,
30 bool has_normals,
31 bool has_colors);
32
34 VectorBufferRef position_buffer();
35
38 const ConstVectorBufferRef position_buffer() const;
39
41 VectorBufferRef normal_buffer();
42
44 const ConstVectorBufferRef normal_buffer() const;
45
48 TriangleBufferRef triangle_buffer();
49
52 const ConstTriangleBufferRef triangle_buffer() const;
53
55 UVBufferRef uv_buffer();
56
59 const ConstUVBufferRef uv_buffer() const;
60
63 ColorBufferRef color_buffer();
64
67 const ConstColorBufferRef color_buffer() const;
68
70 bool has_normals() const;
71
81 std::shared_ptr<MeshInfo>
82 subdivide(int steps = 1, bool project_to_limit = false);
83
84 private:
85 VectorBuffer m_position_buffer;
86 VectorBuffer m_normal_buffer;
87 TriangleBuffer m_triangle_buffer;
88 UVBuffer m_uv_buffer;
89 ColorBuffer m_color_buffer;
90 };
91} // namespace scenepic
92
93#endif
Container for Mesh creation information.
Definition: mesh_info.h:15
TriangleBufferRef triangle_buffer()
A reference to the triangle buffer containing the triangle vertex indices.
VectorBufferRef normal_buffer()
A reference to the vector buffer containing the vertex normals.
std::shared_ptr< MeshInfo > subdivide(int steps=1, bool project_to_limit=false)
Subdivide this mesh using loop subdivision.
const ConstVectorBufferRef position_buffer() const
A const reference to the vector buffer containing the vertex positions.
VectorBufferRef position_buffer()
A reference to the vector buffer containing the vertex positions.
const ConstUVBufferRef uv_buffer() const
A const reference to the UV buffer containing the per-vertex UV values.
const ConstTriangleBufferRef triangle_buffer() const
A const reference to the triangle buffer containing the triangle vertex indices.
const ConstColorBufferRef color_buffer() const
A const reference to the color buffer containing the per-vertex color values.
ColorBufferRef color_buffer()
A reference to the color buffer containing the per-vertex color values.
const ConstVectorBufferRef normal_buffer() const
A const reference to the vector buffer containing the vertex normals.
bool has_normals() const
Whether the mesh info contains vertex normals.
UVBufferRef uv_buffer()
A reference to the UV buffer containing the per-vertex UV values.
MeshInfo(std::size_t num_vertices, std::size_t num_triangles, bool has_uvs, bool has_normals, bool has_colors)
Constructor.
Definition: audio_track.h:14