Mesh data container, validator and exporter. 更多...
#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) |
Appends a index to the indexes list. | |
void | AddMaterial (const std::string &material_name) |
Starts applying a new material to the new added triangles. | |
void | AddNormal (normal_type normal) |
Appends a normal to the normal list. | |
void | AddTriangleFan (const std::vector< vertex_type > &vertices) |
Adds a triangle fan to the mesh, vertex order is counterclockwise. | |
void | AddTriangleStrip (const std::vector< vertex_type > &vertices) |
Adds a triangle strip to the mesh, vertex order is counterclockwise. | |
void | AddUV (uv_type uv) |
Appends a vertex to the vertices list, they will be read 3 in 3. | |
void | AddUVs (const std::vector< uv_type > &uv) |
Appends uvs. | |
void | AddVertex (vertex_type vertex) |
Appends a vertex to the vertices list. | |
void | AddVertices (const std::vector< vertex_type > &vertices) |
Appends a vertex to the vertices list. | |
Mesh & | ConcatMesh (const Mesh &rhs, int num_vertices_to_link) |
Merges two meshes into a single mesh | |
void | EndMaterial () |
Stops applying the material to the new added triangles. | |
std::string | GenerateOBJ () const |
Returns a string containing the mesh encoded in OBJ. | |
std::string | GenerateOBJForRecast () const |
Returns a string containing the mesh encoded in OBJ. | |
std::string | GeneratePLY () const |
Returns a string containing the mesh encoded in PLY. | |
std::vector< index_type > & | GetIndexes () |
const std::vector< index_type > & | GetIndexes () const |
size_t | GetIndexesNum () const |
size_t | GetLastVertexIndex () const |
Returns the index of the last added vertex (number of vertices). | |
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 |
Check if the mesh can be valid or not. | |
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) |
Merges two meshes into a single mesh | |
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 | ) |
Appends a index to the indexes list.
引用了 _indexes.
被这些函数引用 AddTriangleFan(), AddTriangleStrip(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated() , 以及 carla::road::Map::SDFToMesh().
void carla::geom::Mesh::AddMaterial | ( | const std::string & | material_name | ) |
Starts applying a new material to the new added triangles.
引用了 _indexes, _materials , 以及 EndMaterial().
被这些函数引用 carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated() , 以及 carla::road::Map::GetAllCrosswalkMesh().
void carla::geom::Mesh::AddNormal | ( | normal_type | normal | ) |
void carla::geom::Mesh::AddTriangleFan | ( | const std::vector< vertex_type > & | vertices | ) |
Adds a triangle fan to the mesh, vertex order is counterclockwise.
引用了 AddIndex(), AddVertices(), DEBUG_ASSERT , 以及 GetVerticesNum().
被这些函数引用 carla::road::Map::GetAllCrosswalkMesh().
void carla::geom::Mesh::AddTriangleStrip | ( | const std::vector< vertex_type > & | vertices | ) |
Adds a triangle strip to the mesh, vertex order is counterclockwise.
引用了 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 | ) |
Appends uvs.
引用了 _uvs.
被这些函数引用 carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
void carla::geom::Mesh::AddVertex | ( | vertex_type | vertex | ) |
Appends a vertex to the vertices list.
引用了 _vertices.
被这些函数引用 carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine() , 以及 carla::road::Map::SDFToMesh().
void carla::geom::Mesh::AddVertices | ( | const std::vector< vertex_type > & | vertices | ) |
Appends a vertex to the vertices list.
引用了 _vertices.
被这些函数引用 AddTriangleFan(), AddTriangleStrip(), carla::geom::MeshFactory::GenerateSidewalk() , 以及 carla::geom::MeshFactory::GenerateTesselated().
Merges two meshes into a single mesh
引用了 _indexes, _materials, _normals, _uvs, _vertices, GetIndexes(), GetIndexesNum(), GetMaterials(), GetNormals(), GetUVs(), GetVertices(), GetVerticesNum() , 以及 IsValid().
void carla::geom::Mesh::EndMaterial | ( | ) |
Stops applying the material to the new added triangles.
引用了 _indexes , 以及 _materials.
被这些函数引用 AddMaterial(), carla::geom::MeshFactory::Generate(), carla::geom::MeshFactory::GenerateLeftWall(), carla::geom::MeshFactory::GenerateRightWall(), carla::geom::MeshFactory::GenerateSidewalk(), carla::geom::MeshFactory::GenerateTesselated() , 以及 carla::road::Map::GetAllCrosswalkMesh().
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 |
Check if the mesh can be valid or not.
引用了 _indexes, _materials , 以及 _vertices.
被这些函数引用 ConcatMesh(), carla::geom::MeshFactory::GenerateLaneMarksForCenterLine(), carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine(), GenerateOBJ(), GenerateOBJForRecast() , 以及 GeneratePLY().
|
inline |
Merges two meshes into a single mesh
引用了 _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 |