网格数据容器、验证器和导出器。 更多...
#include <Mesh.h>
Public 类型 | |
using | index_type = size_t |
using | material_type = MeshMaterial |
using | normal_type = Vector3D |
using | uv_type = Vector2D |
using | vertex_type = Vector3D |
Public 成员函数 | |
void | AddIndex (index_type index) |
将索引附加到索引列表。 | |
void | AddMaterial (const std::string &material_name) |
开始将新材质应用到新添加的三角形。 | |
void | AddNormal (normal_type normal) |
将法线附加到法线列表。 | |
void | AddTriangleFan (const std::vector< vertex_type > &vertices) |
向网格添加三角形扇形,顶点顺序为逆时针。 | |
void | AddTriangleStrip (const std::vector< vertex_type > &vertices) |
向网格添加三角形带,顶点顺序为逆时针。 | |
void | AddUV (uv_type uv) |
将一个顶点附加到顶点列表,它们将被读取 3 个中的 3 个。 | |
void | AddUVs (const std::vector< uv_type > &uv) |
添加纹理映射坐标(Texture-Mapping Coordinates, UV) | |
void | AddVertex (vertex_type vertex) |
将顶点附加到顶点列表。 | |
void | AddVertices (const std::vector< vertex_type > &vertices) |
将顶点附加到顶点列表。 | |
Mesh & | ConcatMesh (const Mesh &rhs, int num_vertices_to_link) |
将两个网格合并为一个网格 | |
void | EndMaterial () |
停止将材质应用到新添加的三角形。 | |
std::string | GenerateOBJ () const |
返回包含 OBJ 中编码的网格的字符串。单位为米。它位于虚幻空间中。 | |
std::string | GenerateOBJForRecast () const |
返回包含 OBJ 中编码的网格的字符串。单位为米。 此函数导出 OBJ 文件,供 Recast 库专门使用。更改构建面的方向和坐标空间。 | |
std::string | GeneratePLY () const |
返回包含 PLY 中编码的网格的字符串。单位为米。 | |
std::vector< index_type > & | GetIndexes () |
const std::vector< index_type > & | GetIndexes () const |
size_t | GetIndexesNum () const |
size_t | GetLastVertexIndex () const |
返回最后添加的顶点索引(顶点数)。 | |
const std::vector< material_type > & | GetMaterials () const |
const std::vector< normal_type > & | GetNormals () const |
const std::vector< uv_type > & | GetUVs () const |
std::vector< vertex_type > & | GetVertices () |
const std::vector< vertex_type > & | GetVertices () const |
size_t | GetVerticesNum () const |
bool | IsValid () const |
检查网格是否有效。 | |
Mesh (const std::vector< vertex_type > &vertices={}, const std::vector< normal_type > &normals={}, const std::vector< index_type > &indexes={}, const std::vector< uv_type > &uvs={}) | |
operator FProceduralCustomMesh () const | |
Mesh & | operator+= (const Mesh &rhs) |
将两个网格合并为一个网格 | |
Private 属性 | |
std::vector< index_type > | _indexes |
std::vector< material_type > | _materials |
std::vector< normal_type > | _normals |
std::vector< uv_type > | _uvs |
std::vector< vertex_type > | _vertices |
友元 | |
Mesh | operator+ (const Mesh &lhs, const Mesh &rhs) |
using carla::geom::Mesh::index_type = size_t |
using carla::geom::Mesh::uv_type = Vector2D |
|
inline |
void carla::geom::Mesh::AddIndex | ( | index_type | index | ) |
将索引附加到索引列表。
引用了 _indexes.
被这些函数引用 AddTriangleFan(), AddTriangleStrip(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
void carla::geom::Mesh::AddMaterial | ( | const std::string & | material_name | ) |
开始将新材质应用到新添加的三角形。
引用了 _indexes, _materials , 以及 EndMaterial().
被这些函数引用 carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
void carla::geom::Mesh::AddNormal | ( | normal_type | normal | ) |
void carla::geom::Mesh::AddTriangleFan | ( | const std::vector< vertex_type > & | vertices | ) |
void carla::geom::Mesh::AddTriangleStrip | ( | const std::vector< vertex_type > & | vertices | ) |
向网格添加三角形带,顶点顺序为逆时针。
引用了 AddIndex(), AddVertices(), DEBUG_ASSERT , 以及 GetVerticesNum().
被这些函数引用 carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall() , 以及 carla::geom::MeshFactory::GenerateRightWall().
void carla::geom::Mesh::AddUV | ( | uv_type | uv | ) |
void carla::geom::Mesh::AddUVs | ( | const std::vector< uv_type > & | uv | ) |
添加纹理映射坐标(Texture-Mapping Coordinates, UV)
引用了 _uvs.
被这些函数引用 carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
void carla::geom::Mesh::AddVertex | ( | vertex_type | vertex | ) |
将顶点附加到顶点列表。
引用了 _vertices.
被这些函数引用 carla::geom::MeshFactory::GenerateLaneMarksForCenterLine() , 以及 carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine().
void carla::geom::Mesh::AddVertices | ( | const std::vector< vertex_type > & | vertices | ) |
将顶点附加到顶点列表。
引用了 _vertices.
被这些函数引用 AddTriangleFan(), AddTriangleStrip(), carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
将两个网格合并为一个网格
引用了 _indexes, _materials, _normals, _uvs, _vertices, GetIndexes(), GetIndexesNum(), GetMaterials(), GetNormals(), GetUVs(), GetVertices(), GetVerticesNum() , 以及 IsValid().
void carla::geom::Mesh::EndMaterial | ( | ) |
停止将材质应用到新添加的三角形。
引用了 _indexes , 以及 _materials.
被这些函数引用 AddMaterial(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
std::string carla::geom::Mesh::GenerateOBJ | ( | ) | const |
std::string carla::geom::Mesh::GenerateOBJForRecast | ( | ) | const |
std::string carla::geom::Mesh::GeneratePLY | ( | ) | const |
std::vector< Mesh::index_type > & carla::geom::Mesh::GetIndexes | ( | ) |
const std::vector< Mesh::index_type > & carla::geom::Mesh::GetIndexes | ( | ) | const |
引用了 _indexes.
被这些函数引用 ConcatMesh(), operator FProceduralCustomMesh() , 以及 operator+=().
size_t carla::geom::Mesh::GetIndexesNum | ( | ) | const |
size_t carla::geom::Mesh::GetLastVertexIndex | ( | ) | const |
const std::vector< Mesh::material_type > & carla::geom::Mesh::GetMaterials | ( | ) | const |
const std::vector< Mesh::normal_type > & carla::geom::Mesh::GetNormals | ( | ) | const |
const std::vector< Mesh::uv_type > & carla::geom::Mesh::GetUVs | ( | ) | const |
std::vector< Mesh::vertex_type > & carla::geom::Mesh::GetVertices | ( | ) |
const std::vector< Mesh::vertex_type > & carla::geom::Mesh::GetVertices | ( | ) | const |
size_t carla::geom::Mesh::GetVerticesNum | ( | ) | const |
引用了 _vertices.
被这些函数引用 AddTriangleFan(), AddTriangleStrip(), ConcatMesh() , 以及 operator+=().
bool carla::geom::Mesh::IsValid | ( | ) | const |
检查网格是否有效。
引用了 _indexes, _materials , 以及 _vertices.
被这些函数引用 ConcatMesh(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), GenerateOBJ(), GenerateOBJForRecast() , 以及 GeneratePLY().
|
inline |
将两个网格合并为一个网格
引用了 _indexes, _materials, _normals, _uvs, _vertices, GetIndexes(), GetIndexesNum(), GetMaterials(), GetNormals(), GetUVs(), GetVertices() , 以及 GetVerticesNum().
|
private |
|
private |
被这些函数引用 AddMaterial(), ConcatMesh(), EndMaterial(), GenerateOBJ(), GenerateOBJForRecast(), GetMaterials(), IsValid() , 以及 operator+=().
|
private |
被这些函数引用 AddNormal(), ConcatMesh(), GenerateOBJ(), GetNormals() , 以及 operator+=().
|
private |
被这些函数引用 AddUV(), AddUVs(), ConcatMesh(), GenerateOBJ(), GetUVs() , 以及 operator+=().
|
private |