My Project
MetaHeightmap.h
1 #pragma once
2 #include "MetaObject.h"
3 #include "ShapeAABB.h"
4 
5 namespace ParaEngine
6 {
7 
9  class MetaHeightmap : public MetaObject
10  {
11  public:
14  {
15  public:
17  TerrainRegion(const CShapeAABB& aabb) : m_aabb(aabb) {};
18 
20  float getHeightAt(float x, float z);
21  Vector3 getCenter() const;
22 
23  const CShapeAABB& getBoundingBox() const {return m_aabb;};
24  private:
25  CShapeAABB m_aabb;
26  };
27 
31  MetaHeightmap(MetaWorldFragment *wf, const TerrainRegion& t, float groundThreshold);
32 
34  virtual void updateDataGrid(DataGrid* dataGrid);
36  float getFallofRange() const {return mFallofRange; }
39  void setFallofRange(float fallof) {mFallofRange = fallof; }
40  virtual CShapeAABB getAABB() const;
41 
42  protected:
43  // the parent terrain tile to which this meta height map is bound.
44  TerrainRegion mTerrainTile;
45 
46  float mFallofRange, mGroundThreshold, mGradient;
47  };
48 }
Abstract class defining the interface for meta objects to be used with MetaObjectDataGrid.
Definition: MetaObject.h:13
A MetaWorldFragment is the basic building block of the world.
Definition: MetaWorldFragment.h:17
virtual CShapeAABB getAABB() const
Checks for overlap with an AABB.
Definition: MetaHeightmap.cpp:82
different physics engine has different winding order.
Definition: EventBinding.h:32
Class providing a 3d grid of data values and methods for accessing and modifying it.
Definition: DataGrid.h:14
float getHeightAt(float x, float z)
in world coordinate.
Definition: MetaHeightmap.cpp:87
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
AABB-related code.
Definition: ShapeAABB.h:11
a meta height map is associated with a region in the global height map based terrain.
Definition: MetaHeightmap.h:9
void setFallofRange(float fallof)
Sets the fallof range.
Definition: MetaHeightmap.h:39
virtual void updateDataGrid(DataGrid *dataGrid)
Adds this meta height map to the data grid.
Definition: MetaHeightmap.cpp:23
a region in global height map based terrain.
Definition: MetaHeightmap.h:13
TerrainRegion(const CShapeAABB &aabb)
bounding box in world space
Definition: MetaHeightmap.h:17
MetaHeightmap(MetaWorldFragment *wf, const TerrainRegion &t, float groundThreshold)
Definition: MetaHeightmap.cpp:16
float getFallofRange() const
Returns the fallof range of the MetaHeightmap.
Definition: MetaHeightmap.h:36