arsa  2.7
Public Member Functions | List of all members
irr::scene::IGeometryCreator Class Referenceabstract

Helper class for creating geometry on the fly. More...

#include <IGeometryCreator.h>

Inheritance diagram for irr::scene::IGeometryCreator:
irr::IReferenceCounted

Public Member Functions

virtual IMeshcreateCubeMesh (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. More...
 
virtual IMeshcreateHillPlaneMesh (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. More...
 
IMeshcreatePlaneMesh (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. More...
 
virtual IMeshcreateGeoplaneMesh (f32 radius=5.f, u32 rows=16, u32 columns=16) const =0
 Create a geoplane. More...
 
virtual IMeshcreateTerrainMesh (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. More...
 
virtual IMeshcreateArrowMesh (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. More...
 
virtual IMeshcreateSphereMesh (f32 radius=5.f, u32 polyCountX=16, u32 polyCountY=16) const =0
 Create a sphere mesh. More...
 
virtual IMeshcreateCylinderMesh (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. More...
 
virtual IMeshcreateConeMesh (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. More...
 
virtual IMeshcreateVolumeLightMesh (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. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

Helper class for creating geometry on the fly.

You can get an instance of this class through ISceneManager::getGeometryCreator()

Definition at line 38 of file IGeometryCreator.h.

Member Function Documentation

◆ createArrowMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create an arrow mesh, composed of a cylinder and a cone.

Parameters
tesselationCylinderNumber of quads composing the cylinder.
tesselationConeNumber of triangles composing the cone's roof.
heightTotal height of the arrow
cylinderHeightTotal height of the cylinder, should be lesser than total height
widthCylinderDiameter of the cylinder
widthConeDiameter of the cone's base, should be not smaller than the cylinder's diameter
colorCylindercolor of the cylinder
colorConecolor of the cone
Returns
Generated mesh.

◆ createConeMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create a cone mesh.

Parameters
radiusRadius of the cone.
lengthLength of the cone.
tesselationNumber of quads around the circumference of the cone.
colorTopThe color of the top of the cone.
colorBottomThe color of the bottom of the cone.
oblique(to be documented)
Returns
Generated mesh.

◆ createCubeMesh()

virtual IMesh* irr::scene::IGeometryCreator::createCubeMesh ( const core::vector3df size = core::vector3df(5.f, 5.f, 5.f),
ECUBE_MESH_TYPE  type = ECMT_1BUF_12VTX_NA 
) const
pure virtual

Creates a simple cube mesh.

Parameters
sizeDimensions of the cube.
typeOne of ECUBE_MESH_TYPE. So you can chose between cubes with single material or independent materials per side.
Returns
Generated mesh.

◆ createCylinderMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create a cylinder mesh.

Parameters
radiusRadius of the cylinder.
lengthLength of the cylinder.
tesselationNumber of quads around the circumference of the cylinder.
colorThe color of the cylinder.
closeTopIf true, close the ends of the cylinder, otherwise leave them open.
obliqueX-offset (shear) of top compared to bottom.
normalTypeWhen 0 side normals are radial from origin. Note that origin is at the bottom. When 1 side normals are flat along top/bottom polygons. NOTE: To get normals which are perpendicular to the side of an oblique cylinder, don't use the oblique parameter. Instead set normalType to 1 and create a cylinder with oblique set to 0. Then use IMeshManipulator::transform with a shear matrix on the returned mesh. You get a shear matrix for an identical effect of this oblique parameter when you set the 4th element of an identity matrix to (oblique/length).
Returns
Generated mesh.

◆ createGeoplaneMesh()

virtual IMesh* irr::scene::IGeometryCreator::createGeoplaneMesh ( f32  radius = 5.f,
u32  rows = 16,
u32  columns = 16 
) const
pure virtual

Create a geoplane.

Parameters
radiusRadius of the plane
rowsHow many rows to place
columnsHow many columns to place
Returns
Generated mesh.

◆ createHillPlaneMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create a pseudo-random mesh representing a hilly terrain.

Parameters
tileSizeThe size of each tile.
tileCountThe number of tiles in each dimension.
materialThe material to apply to the mesh.
hillHeightThe maximum height of the hills.
countHillsThe number of hills along each dimension.
textureRepeatCountThe number of times to repeat the material texture along each dimension.
Returns
Generated mesh.

◆ createPlaneMesh()

IMesh* irr::scene::IGeometryCreator::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
inline

Create a simple rectangular textured plane mesh.

Parameters
tileSizeThe size of each tile.
tileCountThe number of tiles in each dimension.
materialThe material to apply to the mesh.
textureRepeatCountThe number of times to repeat the material texture along each dimension.
Returns
Generated mesh.

Definition at line 75 of file IGeometryCreator.h.

80  {
81  return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount);
82  }
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.
GLfloat f
dimension2d< f32 > dimension2df
Typedef for an f32 dimension.
Definition: dimension2d.h:210

◆ createSphereMesh()

virtual IMesh* irr::scene::IGeometryCreator::createSphereMesh ( f32  radius = 5.f,
u32  polyCountX = 16,
u32  polyCountY = 16 
) const
pure virtual

Create a sphere mesh.

Parameters
radiusRadius of the sphere
polyCountXNumber of quads used for the horizontal tiling
polyCountYNumber of quads used for the vertical tiling
Returns
Generated mesh.

◆ createTerrainMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create a terrain mesh from an image representing a heightfield.

Parameters
textureThe texture to apply to the terrain.
heightmapAn image that will be interpreted as a heightmap. The brightness (average color) of each pixel is interpreted as a height, with a 255 brightness pixel producing the maximum height.
stretchSizeThe size that each pixel will produce, i.e. a 512x512 heightmap and a stretchSize of (10.f, 20.f) will produce a mesh of size 5120.f x 10240.f
maxHeightThe maximum height of the terrain.
driverThe current video driver.
defaultVertexBlockSize(to be documented)
debugBorders(to be documented)
Returns
Generated mesh.

◆ createVolumeLightMesh()

virtual IMesh* irr::scene::IGeometryCreator::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
pure virtual

Create a volume light mesh.

Parameters
subdivideUHorizontal patch count.
subdivideVVertical patch count.
footColorColor at the bottom of the light.
tailColorColor at the mid of the light.
lpDistanceVirtual distance of the light point for normals.
lightDimDimensions of the light.
Returns
Generated mesh.

The documentation for this class was generated from the following file: