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 5 #ifndef __C_GEOMETRY_CREATOR_H_INCLUDED__ 6 #define __C_GEOMETRY_CREATOR_H_INCLUDED__ 7 8 #include "IGeometryCreator.h" 9 #include "SMeshBuffer.h" 10 11 namespace irr 12 { 13 14 namespace scene 15 { 16 17 //! class for creating geometry on the fly 18 class CGeometryCreator : public IGeometryCreator 19 { 20 void addToBuffer(const video::S3DVertex& v, SMeshBuffer* Buffer) const; 21 public: 22 IMesh* createCubeMesh(const core::vector3df& size) const; 23 24 IMesh* createHillPlaneMesh( 25 const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount, 26 video::SMaterial* material, f32 hillHeight, const core::dimension2d<f32>& countHills, 27 const core::dimension2d<f32>& textureRepeatCount) const; 28 29 IMesh* createTerrainMesh(video::IImage* texture, 30 video::IImage* heightmap, const core::dimension2d<f32>& stretchSize, 31 f32 maxHeight, video::IVideoDriver* driver, 32 const core::dimension2d<u32>& defaultVertexBlockSize, 33 bool debugBorders=false) const; 34 35 IMesh* createArrowMesh(const u32 tesselationCylinder, 36 const u32 tesselationCone, const f32 height, 37 const f32 cylinderHeight, const f32 width0, 38 const f32 width1, const video::SColor vtxColor0, 39 const video::SColor vtxColor1) const; 40 41 IMesh* createSphereMesh(f32 radius, u32 polyCountX, u32 polyCountY) const; 42 43 IMesh* createCylinderMesh(f32 radius, f32 length, u32 tesselation, 44 const video::SColor& color=0xffffffff, 45 bool closeTop=true, f32 oblique=0.f) const; 46 47 IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation, 48 const video::SColor& colorTop=0xffffffff, 49 const video::SColor& colorBottom=0xffffffff, 50 f32 oblique=0.f) const; 51 52 IMesh* createVolumeLightMesh( 53 const u32 subdivideU=32, const u32 subdivideV=32, 54 const video::SColor footColor=0xffffffff, 55 const video::SColor tailColor=0xffffffff, 56 const f32 lpDistance = 8.f, 57 const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const; 58 }; 59 60 61 } // end namespace scene 62 } // end namespace irr 63 64 #endif 65 66