![]() |
Dandelion 2.0.0
A light-weight 3D builder for educational usage
|
#include <mesh.hpp>
Public 成员函数 | |
| Mesh ()=default | |
| Mesh (const Mesh &other) | |
| Mesh (Mesh &&other)=default | |
| void | clear () noexcept |
| 清空 Mesh 中所有的图元数据。 | |
Public 属性 | |
| std::vector< Eigen::Vector3f > | positions |
| std::vector< Eigen::Vector3f > | normals |
| std::vector< std::array< unsigned int, 2 > > | edges |
| std::vector< std::array< unsigned int, 3 > > | faces |
| bool | modified |
| std::string | name |
用于同步渲染数据的三角形 Mesh 。
这个类负责表示可以直接同步到 GPU 的三角形 Mesh 数据。
外界读取 Mesh 中的顶点坐标、法线,以及边和三角形的索引时一般应该使用 positions/normals 等存储向量或定长数组的容器;而渲染器需要向 GPU 同步数据时,则应该直接使用存储 float 或 unsigned int 的扁平 vector 。
|
default |
默认构造一个空的 Mesh 。
|
default |
调用各成员的移动构造。
|
noexcept |
清空 Mesh 中所有的图元数据。
该方法只清空直接保存数据的容器(公有成员),不会清空用于向 GPU 传输数据的 buffer (私有成员)。
| std::vector<std::array<unsigned int, 2> > Mesh::edges |
边的顶点索引。
| std::vector<std::array<unsigned int, 3> > Mesh::faces |
面片的顶点索引。
| bool Mesh::modified |
相较于上次渲染,该 Mesh 是否被修改过。
| std::string Mesh::name |
名称。
| std::vector<Eigen::Vector3f> Mesh::normals |
顶点法线。
| std::vector<Eigen::Vector3f> Mesh::positions |
顶点坐标。