engine/collision/concretePolyList.h
2024-01-07 04:36:33 +00:00

62 lines
1.4 KiB
C++

//-----------------------------------------------------------------------------
// Torque Game Engine
//
// Copyright (c) 2001 GarageGames.Com
// Portions Copyright (c) 2001 by Sierra Online, Inc.
//-----------------------------------------------------------------------------
#ifndef _CONCRETEPOLYLIST_H_
#define _CONCRETEPOLYLIST_H_
#ifndef _ABSTRACTPOLYLIST_H_
#include "collision/abstractPolyList.h"
#endif
class ConcretePolyList : public AbstractPolyList
{
public:
struct Poly {
PlaneF plane;
SceneObject* object;
U32 material;
U32 vertexStart;
U32 vertexCount;
U32 surfaceKey;
};
typedef Vector<PlaneF> PlaneList;
typedef Vector<Point3F> VertexList;
typedef Vector<Poly> PolyList;
typedef Vector<U32> IndexList;
PolyList mPolyList;
VertexList mVertexList;
IndexList mIndexList;
PlaneList mPolyPlaneList;
public:
ConcretePolyList();
~ConcretePolyList();
void clear();
// Virtual methods
U32 addPoint(const Point3F& p);
U32 addPlane(const PlaneF& plane);
void begin(U32 material,U32 surfaceKey);
void plane(U32 v1,U32 v2,U32 v3);
void plane(const PlaneF& p);
void plane(const U32 index);
void vertex(U32 vi);
void end();
void render();
bool isEmpty() const;
protected:
const PlaneF& getIndexedPlane(const U32 index);
};
#endif // _H_EARLYOUTPOLYLIST_