#pragma once #include #include "Vector.hpp" #include "Material.hpp" class TriangleMesh; class SubMesh { friend class Mesh; friend class SubEntity; friend class FinalCompositionRenderStrategy; Mesh* parent; int subsetId; int edgeStartIndex; int edgeCount; D3DXMATERIAL material; char bumpFileName[256]; LPDIRECT3DTEXTURE9 lambertTexture; //!< D3D textures for the materials LPDIRECT3DTEXTURE9 bumpTexture; //!< D3D texture for the bump map LPDIRECT3DTEXTURE9 normalTexture; //!< D3D texture for the normal map Material* rayTraceMaterial; //!< material used in for ray tracing TriangleMesh* rayTraceMesh; //!< the raytracable representation of the mesh public: SubMesh(Mesh* parent, int subsetId, D3DXMATERIAL& dMaterial); ~SubMesh(void); void loadBumpMap(LPCSTR fileName, float bumpScale); void buildRayTraceMesh(DWORD startIndex, DWORD indexCount); void drawToAtlas(); void draw(); };