3 #ifndef AGL_MESH_TEAPOT_H_
4 #define AGL_MESH_TEAPOT_H_
6 #include "agl/mesh/triangle_mesh.h"
27 Teapot(
int grid,
const glm::mat4& lidTransform);
34 glm::mat4 _lidTransform;
37 void generatePatches(std::vector<GLfloat> & p,
38 std::vector<GLfloat> & n,
39 std::vector<GLfloat> & tc,
40 std::vector<GLuint> & el,
int grid);
42 void buildPatchReflect(
int patchNum,
43 std::vector<GLfloat> & B, std::vector<GLfloat> & dB,
44 std::vector<GLfloat> & v, std::vector<GLfloat> & n,
45 std::vector<GLfloat> & tc, std::vector<GLuint> & el,
46 int &index,
int &elIndex,
int &tcIndex,
int grid,
47 bool reflectX,
bool reflectY);
49 void buildPatch(glm::vec3 patch[][4],
50 std::vector<GLfloat> & B, std::vector<GLfloat> & dB,
51 std::vector<GLfloat> & v, std::vector<GLfloat> & n,
52 std::vector<GLfloat> & tc, std::vector<GLuint> & el,
53 int &index,
int &elIndex,
int &tcIndex,
int grid,
54 glm::mat3 reflect,
bool invertNormal);
56 void getPatch(
int patchNum, glm::vec3 patch[][4],
bool reverseV);
58 void computeBasisFunctions(std::vector<GLfloat> & B,
59 std::vector<GLfloat>& dB,
int grid);
61 glm::vec3 evaluate(
int gridU,
int gridV, std::vector<GLfloat> & B,
62 glm::vec3 patch[][4]);
64 glm::vec3 evaluateNormal(
int gridU,
int gridV, std::vector<GLfloat>& B,
65 std::vector<GLfloat> & dB, glm::vec3 patch[][4]);
67 void fitUnitBox(std::vector<GLfloat>& p, std::vector<GLfloat>& n);
69 void moveLid(
int grid, std::vector<GLfloat>& p,
70 const glm::mat4& lidTransform);
75 #endif // AGL_MESH_TEAPOT_H_