blob: a0a4d5a954d089cc5e9242e5c995640eeff4db9d (
plain)
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
|
/*
render/face.h
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_RENDER_FACE_H__
#define __INCLUDED_RENDER_FACE_H__
#include <vector>
#include "math/mathlib.h"
namespace render {
/// one face (polygon) of a model
class Face {
public:
Face(math::Vector3f const & normal, math::Color const *color=0);
~Face();
/// the normal of this face
inline math::Vector3f const & normal() const { return face_normal; };
/// the color of this face
inline math::Color const *color() const { return face_color; };
/// add a vertex to the face
void add_vertex(math::Vector3f const &vertex);
/// draw the polygon
void draw();
private:
math::Vector3f face_normal;
math::Color *face_color;
std::vector<math::Vector3f *> face_vertex;
};
}
#endif // __INCLUDED_RENDER_FACE_H__
|