/** @author Barsi Attila @copyright BMGE Department of Control Engineering and Informatics @brief Simple maya object vector renderer & storage. */ #ifndef OBJECTVECTOR_H #define OBJECTVECTOR_H using namespace std; class ObjectVector{ public: /** Constructor. */ ObjectVector(); /** Destructor. */ ~ObjectVector(); /** Returns the nth. model. @param modelNum The model to return. @return The nth model. NULL if modelNum is greater than the current model count. */ ObjectModel* getObjectModel(UINT modelNum); /** @return A vector of all object models. */ vector getAllObjectModels(); /** Adds an object model to the list. @param objectModel The object model to add. */ void addObjectModel(ObjectModel& objectModel); /** Creates D3D vertices for all stored models. */ bool createAllD3DVertices(); /** Renders all models with a specific effect file. */ HRESULT RenderAllWithFX(LPD3DXEFFECT m_pEffect,bool renderToAtlas,D3DXMATRIX modelview,D3DXMATRIX modelviewproj); /** Removes the nth object model. @param modelNum The model number to remove. */ void removeObjectModel(UINT modelNum); /** Removes all object models. */ void removeAllObjectModels(); /** Initializes all objects. @param The current Direct3D device. */ void initAllObjects(LPDIRECT3DDEVICE9 device); /** Resets all objects. @param The current Direct3D device. */ void resetAllObjects(LPDIRECT3DDEVICE9 device); /** Returns a triangle with all parameters from the array of all triangles based on an index. @param shooterIndex The index of the triangle to return. @param tri The triangle return parameter. @param vertex1 The 1st 3D vertex of the triangle. @param vertex2 The 2nd 3D vertex of the triangle. @param vertex3 The 3rd 3D vertex of the triangle. @param texcoord1 The 1st 2D texture coordinate of the triangle. @param texcoord2 The 1st 2D texture coordinate of the triangle. @param texcoord3 The 1st 2D texture coordinate of the triangle. */ void getTriangleByIndex(UINT shooterIndex,Triangle& tri,Vector& vertex1,Vector& vertex2,Vector& vertex3,Vector& texcoord1,Vector& texcoord2,Vector& texcoord3); private: /** The std vector of models. */ vector models; /** The sum of all faces. */ int offsetSum; }; #endif