36 lines
1018 B
C++
36 lines
1018 B
C++
#ifndef MESHBUILDER_H
|
|
#define MESHBUILDER_H
|
|
|
|
#include "mesh.h"
|
|
|
|
class MeshBuilder : public Mesh
|
|
{
|
|
int currentGroup;
|
|
|
|
public:
|
|
void addTriangle(int i1, int i2, int i3);
|
|
|
|
void addPosition(float x, float y, float z);
|
|
void addPosition(const glm::vec3 &position);
|
|
void addNormal(float x, float y, float z);
|
|
void addNormal(const glm::vec3 &normal);
|
|
void addTexCoord(float u, float v);
|
|
void addTexCoord(const glm::vec2 &texCoord);
|
|
|
|
void addVertex(const glm::vec3 &position, const glm::vec3 &normal);
|
|
void addVertex(const glm::vec3 &position, const glm::vec2 &texCoord);
|
|
void addVertex(const glm::vec3 &position, const glm::vec3 &normal, const glm::vec2 &texCoord);
|
|
|
|
void addGroup(Material* myMaterial);
|
|
void setCurrentGroup(int groupId);
|
|
void setCurrentGroupMaterial(Material* myMaterial);
|
|
int getNbGroups();
|
|
|
|
// require positions and indices
|
|
void computeNormals();
|
|
// require normals and texCoord
|
|
void computeTangents();
|
|
};
|
|
|
|
#endif // MESHBUILDER_H
|