CGeometryCreator.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_GEOMETRY_CREATOR_H_INCLUDED__
  5. #define __C_GEOMETRY_CREATOR_H_INCLUDED__
  6. #include "IGeometryCreator.h"
  7. #include "SMeshBuffer.h"
  8. namespace irr
  9. {
  10. namespace scene
  11. {
  12. //! class for creating geometry on the fly
  13. class CGeometryCreator : public IGeometryCreator
  14. {
  15. void addToBuffer(const video::S3DVertex& v, SMeshBuffer* Buffer) const;
  16. public:
  17. IMesh* createCubeMesh(const core::vector3df& size) const;
  18. IMesh* createHillPlaneMesh(
  19. const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
  20. video::SMaterial* material, f32 hillHeight, const core::dimension2d<f32>& countHills,
  21. const core::dimension2d<f32>& textureRepeatCount) const;
  22. IMesh* createTerrainMesh(video::IImage* texture,
  23. video::IImage* heightmap, const core::dimension2d<f32>& stretchSize,
  24. f32 maxHeight, video::IVideoDriver* driver,
  25. const core::dimension2d<u32>& defaultVertexBlockSize,
  26. bool debugBorders=false) const;
  27. IMesh* createArrowMesh(const u32 tesselationCylinder,
  28. const u32 tesselationCone, const f32 height,
  29. const f32 cylinderHeight, const f32 width0,
  30. const f32 width1, const video::SColor vtxColor0,
  31. const video::SColor vtxColor1) const;
  32. IMesh* createSphereMesh(f32 radius, u32 polyCountX, u32 polyCountY) const;
  33. IMesh* createCylinderMesh(f32 radius, f32 length, u32 tesselation,
  34. const video::SColor& color=0xffffffff,
  35. bool closeTop=true, f32 oblique=0.f) const;
  36. IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation,
  37. const video::SColor& colorTop=0xffffffff,
  38. const video::SColor& colorBottom=0xffffffff,
  39. f32 oblique=0.f) const;
  40. IMesh* createVolumeLightMesh(
  41. const u32 subdivideU=32, const u32 subdivideV=32,
  42. const video::SColor footColor=0xffffffff,
  43. const video::SColor tailColor=0xffffffff,
  44. const f32 lpDistance = 8.f,
  45. const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const;
  46. };
  47. } // end namespace scene
  48. } // end namespace irr
  49. #endif