[1808] | 1 | /**
|
---|
| 2 | @author Barsi Attila
|
---|
| 3 | @copyright BMGE Department of Control Engineering and Informatics
|
---|
| 4 | @brief Simple maya object vector renderer & storage.
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | #ifndef OBJECTVECTOR_H
|
---|
| 8 | #define OBJECTVECTOR_H
|
---|
| 9 |
|
---|
| 10 | using namespace std;
|
---|
| 11 |
|
---|
| 12 | class ObjectVector{
|
---|
| 13 | public:
|
---|
| 14 | /**
|
---|
| 15 | Constructor.
|
---|
| 16 | */
|
---|
| 17 | ObjectVector();
|
---|
| 18 | /**
|
---|
| 19 | Destructor.
|
---|
| 20 | */
|
---|
| 21 | ~ObjectVector();
|
---|
| 22 | /**
|
---|
| 23 | Returns the nth. model.
|
---|
| 24 | @param modelNum The model to return.
|
---|
| 25 | @return The nth model. NULL if modelNum is greater than the current model count.
|
---|
| 26 | */
|
---|
| 27 | ObjectModel* getObjectModel(UINT modelNum);
|
---|
| 28 | /**
|
---|
| 29 | @return A vector of all object models.
|
---|
| 30 | */
|
---|
| 31 | vector<ObjectModel*> getAllObjectModels();
|
---|
| 32 | /**
|
---|
| 33 | Adds an object model to the list.
|
---|
| 34 | @param objectModel The object model to add.
|
---|
| 35 | */
|
---|
| 36 | void addObjectModel(ObjectModel& objectModel);
|
---|
| 37 |
|
---|
| 38 | /**
|
---|
| 39 | Creates D3D vertices for all stored models.
|
---|
| 40 | */
|
---|
| 41 |
|
---|
| 42 | bool createAllD3DVertices();
|
---|
| 43 | /**
|
---|
| 44 | Renders all models with a specific effect file.
|
---|
| 45 | */
|
---|
| 46 | HRESULT RenderAllWithFX(LPD3DXEFFECT m_pEffect,bool renderToAtlas,D3DXMATRIX modelview,D3DXMATRIX modelviewproj);
|
---|
| 47 | /**
|
---|
| 48 | Removes the nth object model.
|
---|
| 49 | @param modelNum The model number to remove.
|
---|
| 50 | */
|
---|
| 51 | void removeObjectModel(UINT modelNum);
|
---|
| 52 | /**
|
---|
| 53 | Removes all object models.
|
---|
| 54 | */
|
---|
| 55 | void removeAllObjectModels();
|
---|
| 56 | /**
|
---|
| 57 | Initializes all objects.
|
---|
| 58 | @param The current Direct3D device.
|
---|
| 59 | */
|
---|
| 60 | void initAllObjects(LPDIRECT3DDEVICE9 device);
|
---|
| 61 | /**
|
---|
| 62 | Resets all objects.
|
---|
| 63 | @param The current Direct3D device.
|
---|
| 64 | */
|
---|
| 65 | void resetAllObjects(LPDIRECT3DDEVICE9 device);
|
---|
| 66 | /**
|
---|
| 67 | Returns a triangle with all parameters from the array of all triangles based on an index.
|
---|
| 68 | @param shooterIndex The index of the triangle to return.
|
---|
| 69 | @param tri The triangle return parameter.
|
---|
| 70 | @param vertex1 The 1st 3D vertex of the triangle.
|
---|
| 71 | @param vertex2 The 2nd 3D vertex of the triangle.
|
---|
| 72 | @param vertex3 The 3rd 3D vertex of the triangle.
|
---|
| 73 | @param texcoord1 The 1st 2D texture coordinate of the triangle.
|
---|
| 74 | @param texcoord2 The 1st 2D texture coordinate of the triangle.
|
---|
| 75 | @param texcoord3 The 1st 2D texture coordinate of the triangle.
|
---|
| 76 | */
|
---|
| 77 | void getTriangleByIndex(UINT shooterIndex,Triangle& tri,Vector& vertex1,Vector& vertex2,Vector& vertex3,Vector& texcoord1,Vector& texcoord2,Vector& texcoord3);
|
---|
| 78 |
|
---|
| 79 | private:
|
---|
| 80 | /**
|
---|
| 81 | The std vector of models.
|
---|
| 82 | */
|
---|
| 83 | vector<ObjectModel*> models;
|
---|
| 84 | /**
|
---|
| 85 | The sum of all faces.
|
---|
| 86 | */
|
---|
| 87 | int offsetSum;
|
---|
| 88 | };
|
---|
| 89 |
|
---|
| 90 | #endif |
---|