2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2021-08-27 17:55:04 +02:00
|
|
|
#ifndef IRR_C_GEOMETRY_CREATOR_H_INCLUDED
|
|
|
|
#define IRR_C_GEOMETRY_CREATOR_H_INCLUDED
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
#include "IGeometryCreator.h"
|
2023-08-15 00:01:22 +02:00
|
|
|
#include "CMeshBuffer.h"
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! class for creating geometry on the fly
|
|
|
|
class CGeometryCreator : public IGeometryCreator
|
|
|
|
{
|
|
|
|
void addToBuffer(const video::S3DVertex& v, SMeshBuffer* Buffer) const;
|
|
|
|
public:
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual IMesh* createCubeMesh(const core::vector3df& size, ECUBE_MESH_TYPE type) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
virtual IMesh* createHillPlaneMesh(
|
|
|
|
const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
|
|
|
|
video::SMaterial* material, f32 hillHeight, const core::dimension2d<f32>& countHills,
|
2021-08-27 14:55:10 +02:00
|
|
|
const core::dimension2d<f32>& textureRepeatCount) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual IMesh* createGeoplaneMesh(f32 radius, u32 rows, u32 columns) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
virtual IMesh* createTerrainMesh(video::IImage* texture,
|
|
|
|
video::IImage* heightmap, const core::dimension2d<f32>& stretchSize,
|
|
|
|
f32 maxHeight, video::IVideoDriver* driver,
|
|
|
|
const core::dimension2d<u32>& defaultVertexBlockSize,
|
2021-08-27 14:55:10 +02:00
|
|
|
bool debugBorders=false) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2023-03-31 15:12:47 +02:00
|
|
|
virtual IMesh* createArrowMesh(const u32 tessellationCylinder,
|
|
|
|
const u32 tessellationCone, const f32 height,
|
2019-12-12 17:32:41 +01:00
|
|
|
const f32 cylinderHeight, const f32 width0,
|
|
|
|
const f32 width1, const video::SColor vtxColor0,
|
2021-08-27 14:55:10 +02:00
|
|
|
const video::SColor vtxColor1) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual IMesh* createSphereMesh(f32 radius, u32 polyCountX, u32 polyCountY) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2023-03-31 15:12:47 +02:00
|
|
|
virtual IMesh* createCylinderMesh(f32 radius, f32 length, u32 tessellation,
|
2019-12-12 17:32:41 +01:00
|
|
|
const video::SColor& color=0xffffffff,
|
2021-08-27 14:55:10 +02:00
|
|
|
bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2023-03-31 15:12:47 +02:00
|
|
|
virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tessellation,
|
2019-12-12 17:32:41 +01:00
|
|
|
const video::SColor& colorTop=0xffffffff,
|
|
|
|
const video::SColor& colorBottom=0xffffffff,
|
2021-08-27 14:55:10 +02:00
|
|
|
f32 oblique=0.f) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2021-06-25 18:19:11 +02:00
|
|
|
virtual IMesh* createTorusMesh(f32 majorRadius, f32 minorRadius,
|
2021-06-28 16:33:08 +02:00
|
|
|
u32 majorSegments, u32 minorSegments,
|
2021-08-27 14:55:10 +02:00
|
|
|
f32 angleStart, f32 angleEnd, int capEnds) const IRR_OVERRIDE;
|
2021-06-25 18:19:11 +02:00
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
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,
|
2021-08-27 14:55:10 +02:00
|
|
|
const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|