-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mesh.h
executable file
·49 lines (38 loc) · 1.09 KB
/
Mesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MESH_H
#define MESH_H
#include <vector>
#include <vecmath.h>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include "tuple.h"
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
typedef tuple< unsigned, 3 > Tuple3u;
struct Mesh
{
// list of vertices from the OBJ file
// in the "bind pose"
std::vector< Vector3f > bindVertices;
// each face has 3 indices
// referencing 3 vertices
std::vector< Tuple3u > faces;
// current vertex positions after animation
std::vector< Vector3f > currentVertices;
// list of vertex to joint attachments
// each element of attachments is a vector< float > containing
// one attachment weight per joint
std::vector< std::vector< float > > attachments;
// 2.1.1. load() should populate bindVertices, currentVertices, and faces
void load(const char *filename);
// 2.1.2. draw the current mesh.
void draw();
// 2.2. Implement this method to load the per-vertex attachment weights
// this method should update m_mesh.attachments
void loadAttachments( const char* filename, int numJoints );
};
#endif