meshRenderSystem.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "scene/sceneRenderState.h"
  3. #include "T3D/systems/componentSystem.h"
  4. #include "ts/tsShape.h"
  5. #include "ts/tsShapeInstance.h"
  6. #include "T3D/assets/ShapeAsset.h"
  7. #include "T3D/assets/MaterialAsset.h"
  8. #ifndef _GFXVERTEXBUFFER_H_
  9. #include "gfx/gfxVertexBuffer.h"
  10. #endif
  11. #ifndef _GFXPRIMITIVEBUFFER_H_
  12. #include "gfx/gfxPrimitiveBuffer.h"
  13. #endif
  14. #ifndef _OPTIMIZEDPOLYLIST_H_
  15. #include "collision/optimizedPolyList.h"
  16. #endif
  17. class MeshRenderSystemInterface : public SystemInterface<MeshRenderSystemInterface>
  18. {
  19. public:
  20. TSShapeInstance * mShapeInstance;
  21. MatrixF mTransform;
  22. Point3F mScale;
  23. Box3F mBounds;
  24. SphereF mSphere;
  25. bool mIsClient;
  26. struct matMap
  27. {
  28. //MaterialAsset* matAsset;
  29. String assetId;
  30. U32 slot;
  31. };
  32. Vector<matMap> mChangingMaterials;
  33. Vector<matMap> mMaterials;
  34. MeshRenderSystemInterface() : SystemInterface(), mShapeInstance(nullptr), mTransform(MatrixF::Identity), mScale(Point3F::One), mIsClient(false)
  35. {
  36. mBounds = Box3F(1);
  37. mSphere = SphereF();
  38. }
  39. ~MeshRenderSystemInterface()
  40. {
  41. //SAFE_DELETE(mShape);
  42. SAFE_DELETE(mShapeInstance);
  43. }
  44. };
  45. class MeshRenderSystem
  46. {
  47. public:
  48. //Core render function, which does all the real work
  49. static void render(SceneManager *sceneManager, SceneRenderState* state);
  50. //Render our particular interface's data
  51. static void renderInterface(U32 interfaceIndex, SceneRenderState* state);
  52. };