14 if (vertexCount > 0) {
15 positions_.reserve(
size_t(vertexCount) * 3u);
16 normals_.reserve(
size_t(vertexCount) * 3u);
17 uvs_.reserve(
size_t(vertexCount) * 2u);
19 if (indexCount > 0) indices_.reserve(
size_t(indexCount));
24 positions_.push_back(
px);
25 positions_.push_back(py);
26 positions_.push_back(pz);
27 normals_.push_back(nx);
28 normals_.push_back(ny);
29 normals_.push_back(nz);
35 indices_.push_back(
i0);
36 indices_.push_back(
i1);
37 indices_.push_back(
i2);
46 return positions_[size_t(i) * 3u];
50 return positions_[size_t(i) * 3u + 1u];
54 return positions_[size_t(i) * 3u + 2u];
58 return normals_[size_t(i) * 3u];
62 return normals_[size_t(i) * 3u + 1u];
66 return normals_[size_t(i) * 3u + 2u];
70 return uvs_[size_t(i) * 2u];
74 return uvs_[size_t(i) * 2u + 1u];
78 return int(indices_[
size_t(i)]);
84 auto it = meta_.find(key);
85 return it == meta_.end() ? defaultValue : it->second;
float getPositionZ(int i) const
float getPositionY(int i) const
std::string getMeta(const std::string &key, const std::string &defaultValue) const
void addVertex(float px, float py, float pz, float nx, float ny, float nz, float u, float v)
void addTriangle(uint32_t i0, uint32_t i1, uint32_t i2)
float getNormalZ(int i) const
void reserve(int vertexCount, int indexCount)
void setMeta(const std::string &key, const std::string &value)
float getNormalY(int i) const
int getIndexCount() const
float getUvU(int i) const
int getVertexCount() const
float getUvV(int i) const
float getNormalX(int i) const
int getIndex(int i) const
float getPositionX(int i) const