Subversion Repositories gelsvn

Rev

Rev 153 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 156
Line 1... Line 1...
1
#ifndef __MINI_MESH_H
1
#ifndef __MINI_MESH_H
2
#define __MINI_MESH_H
2
#define __MINI_MESH_H
3
 
3
 
4
#include "IndexedFaceSet.h"
4
#include "IndexedFaceSet.h"
5
#include "Material.h"
5
#include "Material.h"
6
#include "Texmap.h"
-
 
7
 
6
 
8
namespace Geometry
7
namespace Geometry
9
{
8
{
10
 
9
 
11
 
10
 
Line 40... Line 39...
40
		std::vector<int> tex_idx;
39
		std::vector<int> tex_idx;
41
 
40
 
42
		/// Vector of materials
41
		/// Vector of materials
43
		std::vector<Material> materials;
42
		std::vector<Material> materials;
44
 
43
 
45
		/// Vector of texture maps.
-
 
46
		std::vector<Texmap> texmaps;
-
 
47
 
-
 
48
		// -------- FUNCTIONS -----------
44
		// -------- FUNCTIONS -----------
49
 
45
 
50
		/// Get an axis aligned bounding box for the model.
46
		/// Get an axis aligned bounding box for the model.
51
		void get_bbox(CGLA::Vec3f& p0, CGLA::Vec3f& p7) const;
47
		void get_bbox(CGLA::Vec3f& p0, CGLA::Vec3f& p7) const;
52
 
48
 
Line 60... Line 56...
60
		}
56
		}
61
		
57
		
62
		/// Find a material from its name
58
		/// Find a material from its name
63
		int find_material(const std::string&) const;
59
		int find_material(const std::string&) const;
64
 
60
 
65
		/// Find a texture map from its name
-
 
66
		int find_texmap(const std::string&) const;
-
 
67
		
-
 
68
		/// Compute normals for the mesh. Does not check if there are normals.
61
		/// Compute normals for the mesh. Does not check if there are normals.
69
		void compute_normals();
62
		void compute_normals();
70
 
63
 
71
		/// Initialize textures
-
 
72
		void gl_init_textures();
-
 
73
 
-
 
74
		/// Use material corresponding to idx
-
 
75
		void TriMesh::gl_set_material(size_t idx);
-
 
76
		
-
 
77
		/// Draw the mesh using OpenGL.
-
 
78
		void gl_draw();
-
 
79
	};
64
	};
80
 
65
 
81
 
66
 
82
}
67
}
83
#endif
68
#endif