arsa  2.7
IGeometryCreator.h
Go to the documentation of this file.
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 __I_GEOMETRY_CREATOR_H_INCLUDED__
6 #define __I_GEOMETRY_CREATOR_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "IMesh.h"
10 #include "IImage.h"
11 
12 namespace irr
13 {
14 namespace video
15 {
16  class IVideoDriver;
17  class SMaterial;
18 }
19 
20 namespace scene
21 {
22 
24  {
28 
31  // as this mesh sets them to 0,1 values. We can't do that when creating the mesh as it
32  // depends on texture resolution which we don't know at that point.
34  };
35 
37 
39 {
40 public:
41 
43 
49 
51 
60  virtual IMesh* createHillPlaneMesh(
61  const core::dimension2d<f32>& tileSize,
62  const core::dimension2d<u32>& tileCount,
63  video::SMaterial* material, f32 hillHeight,
64  const core::dimension2d<f32>& countHills,
65  const core::dimension2d<f32>& textureRepeatCount) const =0;
66 
68 
76  const core::dimension2d<f32>& tileSize,
77  const core::dimension2d<u32>& tileCount=core::dimension2du(1,1),
78  video::SMaterial* material=0,
79  const core::dimension2df& textureRepeatCount=core::dimension2df(1.f,1.f)) const
80  {
81  return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount);
82  }
83 
85 
91  virtual IMesh* createGeoplaneMesh(f32 radius = 5.f,
92  u32 rows = 16, u32 columns = 16) const =0;
93 
95 
111  video::IImage* heightmap,
112  const core::dimension2d<f32>& stretchSize,
113  f32 maxHeight, video::IVideoDriver* driver,
114  const core::dimension2d<u32>& defaultVertexBlockSize,
115  bool debugBorders=false) const =0;
116 
118 
131  virtual IMesh* createArrowMesh(const u32 tesselationCylinder = 4,
132  const u32 tesselationCone = 8, const f32 height = 1.f,
133  const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f,
134  const f32 widthCone = 0.3f, const video::SColor colorCylinder = 0xFFFFFFFF,
135  const video::SColor colorCone = 0xFFFFFFFF) const =0;
136 
137 
139 
145  virtual IMesh* createSphereMesh(f32 radius = 5.f,
146  u32 polyCountX = 16, u32 polyCountY = 16) const =0;
147 
149 
166  virtual IMesh* createCylinderMesh(f32 radius, f32 length,
167  u32 tesselation,
168  const video::SColor& color=video::SColor(0xffffffff),
169  bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const =0;
170 
172 
181  virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation,
182  const video::SColor& colorTop=video::SColor(0xffffffff),
183  const video::SColor& colorBottom=video::SColor(0xffffffff),
184  f32 oblique=0.f) const =0;
185 
187 
196  virtual IMesh* createVolumeLightMesh(
197  const u32 subdivideU=32, const u32 subdivideV=32,
198  const video::SColor footColor = 0xffffffff,
199  const video::SColor tailColor = 0xffffffff,
200  const f32 lpDistance = 8.f,
201  const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const =0;
202 };
203 
204 
205 } // end namespace scene
206 } // end namespace irr
207 
208 #endif // __I_GEOMETRY_CREATOR_H_INCLUDED__
209 
virtual IMesh * createCubeMesh(const core::vector3df &size=core::vector3df(5.f, 5.f, 5.f), ECUBE_MESH_TYPE type=ECMT_1BUF_12VTX_NA) const =0
Creates a simple cube mesh.
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
virtual IMesh * createHillPlaneMesh(const core::dimension2d< f32 > &tileSize, const core::dimension2d< u32 > &tileCount, video::SMaterial *material, f32 hillHeight, const core::dimension2d< f32 > &countHills, const core::dimension2d< f32 > &textureRepeatCount) const =0
Create a pseudo-random mesh representing a hilly terrain.
GLenum GLenum GLuint texture
virtual IMesh * createSphereMesh(f32 radius=5.f, u32 polyCountX=16, u32 polyCountY=16) const =0
Create a sphere mesh.
IMesh * createPlaneMesh(const core::dimension2d< f32 > &tileSize, const core::dimension2d< u32 > &tileCount=core::dimension2du(1, 1), video::SMaterial *material=0, const core::dimension2df &textureRepeatCount=core::dimension2df(1.f, 1.f)) const
Create a simple rectangular textured plane mesh.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
GLsizeiptr size
Specifies a 2 dimensional size.
Definition: dimension2d.h:20
Interface for software image data.
Definition: IImage.h:25
virtual IMesh * createVolumeLightMesh(const u32 subdivideU=32, const u32 subdivideV=32, const video::SColor footColor=0xffffffff, const video::SColor tailColor=0xffffffff, const f32 lpDistance=8.f, const core::vector3df &lightDim=core::vector3df(1.f, 1.2f, 1.f)) const =0
Create a volume light mesh.
virtual IMesh * createTerrainMesh(video::IImage *texture, video::IImage *heightmap, const core::dimension2d< f32 > &stretchSize, f32 maxHeight, video::IVideoDriver *driver, const core::dimension2d< u32 > &defaultVertexBlockSize, bool debugBorders=false) const =0
Create a terrain mesh from an image representing a heightfield.
Class which holds the geometry of an object.
Definition: IMesh.h:71
virtual IMesh * createGeoplaneMesh(f32 radius=5.f, u32 rows=16, u32 columns=16) const =0
Create a geoplane.
Helper class for creating geometry on the fly.
virtual IMesh * createConeMesh(f32 radius, f32 length, u32 tesselation, const video::SColor &colorTop=video::SColor(0xffffffff), const video::SColor &colorBottom=video::SColor(0xffffffff), f32 oblique=0.f) const =0
Create a cone mesh.
GLfloat f
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition: IVideoDriver.h:151
Class representing a 32 bit ARGB color.
Definition: SColor.h:316
virtual IMesh * createArrowMesh(const u32 tesselationCylinder=4, const u32 tesselationCone=8, const f32 height=1.f, const f32 cylinderHeight=0.6f, const f32 widthCylinder=0.05f, const f32 widthCone=0.3f, const video::SColor colorCylinder=0xFFFFFFFF, const video::SColor colorCone=0xFFFFFFFF) const =0
Create an arrow mesh, composed of a cylinder and a cone.
virtual IMesh * createCylinderMesh(f32 radius, f32 length, u32 tesselation, const video::SColor &color=video::SColor(0xffffffff), bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const =0
Create a cylinder mesh.
GLuint color
Base class of most objects of the Irrlicht Engine.
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571
GLuint GLsizei GLsizei * length
Struct for holding parameters for a material renderer.
Definition: SMaterial.h:304
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572