![]() |
Dandelion 2.0.0
A light-weight 3D builder for educational usage
|
用于同步线条渲染数据的内存对象。 更多...
#include <mesh.hpp>
Public 成员函数 | |
| LineSet ()=default | |
| LineSet (const LineSet &other)=default | |
| LineSet (LineSet &&other)=default | |
| void | add_line (const Eigen::Vector3f &from, const Eigen::Vector3f &to) |
| std::size_t | n_lines () const noexcept |
| void | clear () noexcept |
| 清空 Mesh 中所有的图元数据。 | |
Public 属性 | |
| std::vector< Eigen::Vector3f > | positions |
| std::vector< std::array< unsigned int, 2 > > | lines |
| Eigen::Vector3f | color |
| bool | modified |
| std::string | name |
用于同步线条渲染数据的内存对象。
这个类负责表示可以直接同步到 GPU 的线条数据。
外界读取顶点和线条数据时一般应该选择 positions/lines 属性,而渲染器需要向 GPU 同步数据时而渲染器需要向 GPU 同步数据时则应该直接使用扁平的 vector 。
线条只支持单色渲染,着色效果不受光照的影响。
|
default |
默认构造一个空的 LineSet 。
|
default |
调用各成员的移动构造。
| void LineSet::add_line | ( | const Eigen::Vector3f & | from, |
| const Eigen::Vector3f & | to ) |
添加一条从 from 到 to 的线段。
| from | 起始点。 |
| to | 终止点。 |
|
noexcept |
清空 Mesh 中所有的图元数据。
该方法只清空直接保存数据的容器(公有成员),不会清空用于向 GPU 传输数据的 buffer (私有成员)。
|
noexcept |
统计当前总共有多少条线段。
| Eigen::Vector3f LineSet::color |
线条的颜色,每个分量取值范围在 0 到 1 之间。
| std::vector<std::array<unsigned int, 2> > LineSet::lines |
线条的顶点索引。
| bool LineSet::modified |
相较于上次渲染,该线条集是否被修改过。
| std::string LineSet::name |
名称。
| std::vector<Eigen::Vector3f> LineSet::positions |
顶点坐标。