Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: 85b07eed3942492d282003eeda0ad77bb023894f (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
/*
   model/primitives.cc
   This file is part of the Osirion project and is distributed under
   the terms of the GNU General Public License version 2
*/

#include "model/primitives.h"

namespace model
{

Primitives::Primitives(Material *material)
{
	primitives_material = material;
}

Primitives::~Primitives()
{
	// clear list of triangles
	for (std::list<Triangle *>::iterator tris_it = primitives_triangles.begin(); tris_it != primitives_triangles.end(); tris_it++)
		delete(*tris_it);
	primitives_triangles.clear();

	// clear list of quads
	for (std::list<Quad *>::iterator quad_it = primitives_quads.begin(); quad_it != primitives_quads.end(); quad_it++)
		delete(*quad_it);
	primitives_quads.clear();
}

void Primitives::add_triangle(Triangle *triangle)
{
	primitives_triangles.push_back(triangle);
}

void Primitives::add_quad(Quad *quad)
{
	primitives_quads.push_back(quad);
}

}