Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
ITerrainSceneNode.hpp
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 duckcpp/duckcpp.hpp
4
5// The code for the TerrainSceneNode is based on the terrain renderer by
6// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their
7// code available for Duckcpp and allowed it to be distributed under this
8// licence. I only modified some parts. A lot of thanks go to them.
9
10#ifndef DCPP_I_TERRAIN_SCENE_NODE_H
11#define DCPP_I_TERRAIN_SCENE_NODE_H
12
13#include <duckcpp/core/engine/ETerrainElements.hpp>
14#include <duckcpp/core/engine/ISceneNode.hpp>
15#include <duckcpp/core/engine/IDynamicMeshBuffer.hpp>
16#include <duckcpp/core/engine/irrArray.hpp>
17
18namespace dcpp
19{
20namespace io
21{
22 class IReadFile;
23} // end namespace io
24namespace scene
25{
26 class IMesh;
27
29
50 {
51 public:
54 const dcpp::nub::vector3df& position = dcpp::nub::vector3df(0.0f, 0.0f, 0.0f),
55 const dcpp::nub::vector3df& rotation = dcpp::nub::vector3df(0.0f, 0.0f, 0.0f),
56 const dcpp::nub::vector3df& scale = dcpp::nub::vector3df(1.0f, 1.0f, 1.0f) )
57 : ISceneNode (parent, mgr, id, position, rotation, scale) {}
58
60
61 virtual const dcpp::nub::aabbox3df& getBoundingBox() const =0;
62
64
65 virtual const dcpp::nub::aabbox3df& getBoundingBox(dcpp::int32_kt patchX, dcpp::int32_kt patchZ) const =0;
66
68
69 virtual dcpp::uint32_kt getIndexCount() const =0;
70
72
73 virtual IMesh* getMesh() =0;
74
77
78
80
82 virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, dcpp::int32_kt LOD=0) const =0;
83
85
94 dcpp::int32_kt patchX, dcpp::int32_kt patchZ, dcpp::int32_kt LOD=0) =0;
95
97
101
103
108 virtual void setLODOfPatch(dcpp::int32_kt patchX, dcpp::int32_kt patchZ, dcpp::int32_kt LOD=0) =0;
109
111 virtual const dcpp::nub::vector3df& getTerrainCenter() const =0;
112
115
117
120
122
125
127
128 virtual void setDynamicSelectorUpdate(bool bVal) =0;
129
131
137 virtual bool overrideLODDistance(dcpp::int32_kt LOD, dcpp::float64_kt newDistance) =0;
138
140
149 virtual void scaleTexture(dcpp::float32_kt scale = 1.0f, dcpp::float32_kt scale2=0.0f) =0;
150
152
158 dcpp::video::SColor vertexColor=dcpp::video::SColor(255,255,255,255),
159 dcpp::int32_kt smoothFactor=0) =0;
160
162
172 virtual bool loadHeightMapRAW(dcpp::io::IReadFile* file, dcpp::int32_kt bitsPerPixel=16,
173 bool signedData=false, bool floatVals=false, dcpp::int32_kt width=0,
174 dcpp::video::SColor vertexColor=dcpp::video::SColor(255,255,255,255),
175 dcpp::int32_kt smoothFactor=0) =0;
176
178
181 virtual void setFixedBorderLOD(dcpp::int32_kt borderLOD=0) = 0;
182
183 };
184
185} // end namespace scene
186} // end namespace dcpp
187
188
189#endif // DCPP_I_TERRAIN_SCENE_NODE_H
Interface providing read access to a file.
Definition IReadFile.hpp:19
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
3d vector template class with lots of operators and methods.
Definition vector3d.hpp:32
Definition IDynamicMeshBuffer.hpp:19
Class for holding a mesh with a single material.
Definition IMeshBuffer.hpp:41
Class which holds the geometry of an object.
Definition IMesh.hpp:72
The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff.
Definition ISceneManager.hpp:160
Scene node interface.
Definition ISceneNode.hpp:43
A scene node for displaying terrain using the geo mip map algorithm.
Definition ITerrainSceneNode.hpp:50
virtual dcpp::float32_kt getHeight(dcpp::float32_kt x, dcpp::float32_kt y) const =0
Get height of a point of the terrain.
virtual IMeshBuffer * getRenderBuffer()=0
Get pointer to the buffer used by the terrain (most users will not need this)
virtual dcpp::int32_kt getIndicesForPatch(dcpp::nub::array< dcpp::uint32_kt > &indices, dcpp::int32_kt patchX, dcpp::int32_kt patchZ, dcpp::int32_kt LOD=0)=0
Gets the indices for a specified patch at a specified Level of Detail.
virtual void setLODOfPatch(dcpp::int32_kt patchX, dcpp::int32_kt patchZ, dcpp::int32_kt LOD=0)=0
Manually sets the LOD of a patch.
ITerrainSceneNode(ISceneNode *parent, ISceneManager *mgr, dcpp::int32_kt id, const dcpp::nub::vector3df &position=dcpp::nub::vector3df(0.0f, 0.0f, 0.0f), const dcpp::nub::vector3df &rotation=dcpp::nub::vector3df(0.0f, 0.0f, 0.0f), const dcpp::nub::vector3df &scale=dcpp::nub::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Definition ITerrainSceneNode.hpp:53
virtual void scaleTexture(dcpp::float32_kt scale=1.0f, dcpp::float32_kt scale2=0.0f)=0
Scales the base texture, similar to makePlanarTextureMapping.
virtual void getMeshBufferForLOD(IDynamicMeshBuffer &mb, dcpp::int32_kt LOD=0) const =0
Gets the meshbuffer data based on a specified level of detail.
virtual bool overrideLODDistance(dcpp::int32_kt LOD, dcpp::float64_kt newDistance)=0
Override the default generation of distance thresholds.
virtual const dcpp::nub::vector3df & getTerrainCenter() const =0
Get center of terrain.
virtual bool loadHeightMap(dcpp::io::IReadFile *file, dcpp::video::SColor vertexColor=dcpp::video::SColor(255, 255, 255, 255), dcpp::int32_kt smoothFactor=0)=0
Initializes the terrain data. Loads the vertices from the heightMapFile.
virtual bool loadHeightMapRAW(dcpp::io::IReadFile *file, dcpp::int32_kt bitsPerPixel=16, bool signedData=false, bool floatVals=false, dcpp::int32_kt width=0, dcpp::video::SColor vertexColor=dcpp::video::SColor(255, 255, 255, 255), dcpp::int32_kt smoothFactor=0)=0
Initializes the terrain data. Loads the vertices from the heightMapFile.
virtual void setCameraRotationDelta(dcpp::float32_kt delta)=0
Sets the rotation camera threshold.
virtual const dcpp::nub::aabbox3df & getBoundingBox(dcpp::int32_kt patchX, dcpp::int32_kt patchZ) const =0
Get the bounding box of a patch.
virtual dcpp::int32_kt getCurrentLODOfPatches(dcpp::nub::array< dcpp::int32_kt > &LODs) const =0
Populates an array with the CurrentLOD of each patch.
virtual void setDynamicSelectorUpdate(bool bVal)=0
Sets whether or not the node should dynamically update its associated selector when the geomipmap dat...
virtual dcpp::uint32_kt getIndexCount() const =0
Get the number of indices currently in the meshbuffer.
virtual void setCameraMovementDelta(dcpp::float32_kt delta)=0
Sets the movement camera threshold.
virtual IMesh * getMesh()=0
Get pointer to the mesh.
virtual const dcpp::nub::aabbox3df & getBoundingBox() const =0
Get the bounding box of the terrain.
virtual void setFixedBorderLOD(dcpp::int32_kt borderLOD=0)=0
Force node to use a fixed LOD level at the borders of the terrain.
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
double float64_kt
64 bit floating point variable.
Definition irrTypes.hpp:112
unsigned int uint32_kt
32 bit unsigned variable.
Definition irrTypes.hpp:64
float float32_kt
32 bit floating point variable.
Definition irrTypes.hpp:108
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72

Duckcpp    @cppfx.xyz