1
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
* Contains code for a triangle container.
5
* \author Pierre Terdiman
8
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
10
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12
#ifndef __ICETRILIST_H__
13
#define __ICETRILIST_H__
15
class ICEMATHS_API TriList : public Container
18
// Constructor / Destructor
22
inline_ udword GetNbTriangles() const { return GetNbEntries()/9; }
23
inline_ Triangle* GetTriangles() const { return (Triangle*)GetEntries(); }
25
void AddTri(const Triangle& tri)
27
Add(tri.mVerts[0].x).Add(tri.mVerts[0].y).Add(tri.mVerts[0].z);
28
Add(tri.mVerts[1].x).Add(tri.mVerts[1].y).Add(tri.mVerts[1].z);
29
Add(tri.mVerts[2].x).Add(tri.mVerts[2].y).Add(tri.mVerts[2].z);
32
void AddTri(const Point& p0, const Point& p1, const Point& p2)
34
Add(p0.x).Add(p0.y).Add(p0.z);
35
Add(p1.x).Add(p1.y).Add(p1.z);
36
Add(p2.x).Add(p2.y).Add(p2.z);
40
class ICEMATHS_API TriangleList : public Container
43
// Constructor / Destructor
47
inline_ udword GetNbTriangles() const { return GetNbEntries()/3; }
48
inline_ IndexedTriangle* GetTriangles() const { return (IndexedTriangle*)GetEntries();}
50
void AddTriangle(const IndexedTriangle& tri)
52
Add(tri.mVRef[0]).Add(tri.mVRef[1]).Add(tri.mVRef[2]);
55
void AddTriangle(udword vref0, udword vref1, udword vref2)
57
Add(vref0).Add(vref1).Add(vref2);
61
#endif //__ICETRILIST_H__