Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
vtDynTerrainGeom Class Referenceabstract

#include <DynTerrain.h>

Inheritance diagram for vtDynTerrainGeom:
vtDynGeom vtHeightFieldGrid3d vtGeode vtHeightField3d NodeExtension vtHeightField BruteTerrain DemeterTerrain SMTerrain SRTerrain TVTerrain

Public Member Functions

virtual DTErr Init (const vtElevationGrid *pGrid, float fZScale)=0
 
virtual void Init2 ()
 
DTErr BasicInit (const vtElevationGrid *pGrid)
 
virtual void SetVerticalExag (float fExag)
 
virtual float GetVerticalExag () const =0
 
virtual void SetPolygonTarget (int iPolygonCount)
 
int GetPolygonTarget ()
 
int GetNumDrawnTriangles ()
 
void SetDetailMaterial (vtMaterial *pApp, float fTiling, float fDistance)
 
void EnableDetail (bool bOn)
 
bool GetDetail ()
 
void SetupTexGen (float fTiling)
 
void DisableTexGen ()
 
void DoCalcBoundBox (FBox3 &box)
 
void DoCull (const vtCamera *pCam)
 
bool FindAltitudeOnEarth (const DPoint2 &p, float &fAltitude, bool bTrue=false) const
 
bool FindAltitudeAtPoint (const FPoint3 &p3, float &fAltitude, bool bTrue=false, int iCultureFlags=0, FPoint3 *vNormal=NULL) const
 
virtual void DoCulling (const vtCamera *pCam)=0
 
virtual void SetElevation (int i, int j, float fValue, bool bTrue=false)
 
void SetCull (bool bOnOff)
 
void CullOnce ()
 
void PreRender () const
 
void PostRender () const
 
- Public Member Functions inherited from vtDynGeom
int IsVisible (const FSphere &sphere) const
 
int IsVisible (const FPoint3 &point0, const FPoint3 &point1, const FPoint3 &point2, const float fTolerance=0.0f) const
 
int IsVisible (const FPoint3 &point, float radius)
 
bool IsVisible (const FPoint3 &point) const
 
void ApplyMaterial (vtMaterial *mat)
 
virtual void DoRender ()=0
 
- Public Member Functions inherited from vtGeode
vtGeodeCloneGeode ()
 
void CloneFromGeode (const vtGeode *rhs)
 
void AddMesh (vtMesh *pMesh, int iMatIdx)
 
void RemoveMesh (vtMesh *pMesh)
 
void AddTextMesh (vtTextMesh *pMesh, int iMatIdx)
 
uint GetNumMeshes () const
 
vtMeshGetMesh (int i) const
 
vtTextMeshGetTextMesh (int i) const
 
virtual void SetMaterials (const class vtMaterialArray *mats)
 
const vtMaterialArrayGetMaterials () const
 
vtMaterialGetMaterial (int idx)
 
void SetMeshMatIndex (vtMesh *pMesh, int iMatIdx)
 
- Public Member Functions inherited from NodeExtension
void SetEnabled (bool bOn)
 
bool GetEnabled () const
 
void SetCastShadow (bool b)
 Set this node to cast a shadow, if it is under a vtShadow node. Default is false.
 
bool GetCastShadow ()
 Get whether this node casts a shadow.
 
void GetBoundSphere (FSphere &sphere, bool bGlobal=false)
 Get the Bounding Sphere of the node.
 
void SetOsgNode (osg::Node *n)
 
- Public Member Functions inherited from vtHeightFieldGrid3d
void Initialize (const LinearUnits units, const DRECT &earthextents, float fMinHeight, float fMaxHeight, int cols, int rows)
 
virtual void SetEarthExtents (const DRECT &ext)
 
bool CastRayToSurface (const FPoint3 &point, const FPoint3 &dir, FPoint3 &result) const
 
bool LineOfSight (const FPoint3 &point1, const FPoint3 &point2) const
 
DPoint2 GetSpacing () const
 
FPoint2 GetWorldSpacing () const
 
void GetDimensions (int &nColumns, int &nRows) const
 
int NumColumns ()
 
int NumRows ()
 
void EarthToGrid (const DPoint2 &epos, IPoint2 &ipos)
 
void WorldToGrid (const FPoint3 &pos, IPoint2 &ipos)
 
float GetInterpolatedElevation (double findex_x, double findex_y) const
 
int FindNumUnknown ()
 
virtual float GetElevation (int iX, int iZ, bool bTrue=false) const =0
 
virtual void GetWorldLocation (int i, int j, FPoint3 &loc, bool bTrue=false) const =0
 
bool ColorDibFromElevation (vtBitmapBase *pBM, const ColorMap *cmap, int iGranularity, const RGBAi &nodata, bool progress_callback(int)=NULL)
 
bool ColorDibFromTable (vtBitmapBase *pBM, std::vector< RGBi > &table, float fMin, float fMax, const RGBAi &nodata, bool progress_callback(int)=NULL)
 
void ShadeDibFromElevation (vtBitmapBase *pBM, const FPoint3 &light_dir, float fLightFactor, float fAmbient=0.1f, float fGamma=1.0f, bool bTrue=false, bool progress_callback(int)=NULL)
 
void ShadeQuick (vtBitmapBase *pBM, float light_factor, bool bTrue=false, bool progress_callback(int)=NULL)
 
void ShadowCastDib (vtBitmapBase *pBM, const FPoint3 &ight_dir, float fLightFactor, float fAmbient, bool progress_callback(int)=NULL)
 
- Public Member Functions inherited from vtHeightField3d
void Initialize (const LinearUnits units, const DRECT &earthextents, float fMinHeight, float fMaxHeight)
 
int PointIsAboveTerrain (const FPoint3 &p) const
 
bool ConvertEarthToSurfacePoint (const DPoint2 &epos, FPoint3 &p3, int iCultureFlags=0, bool bTrue=false)
 
bool ContainsWorldPoint (float x, float z)
 
void GetCenter (FPoint3 &center)
 
void SetCulture (CultureExtension *ext)
 
- Public Member Functions inherited from vtHeightField
void Initialize (const DRECT &extents, float fMinHeight, float fMaxHeight)
 
bool ContainsEarthPoint (const DPoint2 &p, bool bInclusive=false) const
 
DRECTGetEarthExtents ()
 
const DRECTGetEarthExtents () const
 
void GetHeightExtents (float &fMinHeight, float &fMaxHeight) const
 

Public Attributes

int m_iTotalTriangles
 
int m_iDrawnTriangles
 
- Public Attributes inherited from vtDynGeom
FPlane m_cullPlanes [6]
 
- Public Attributes inherited from vtGeode
osg::ref_ptr< const
vtMaterialArray
m_pMaterialArray
 
- Public Attributes inherited from NodeExtension
osg::Node * m_pNode
 
bool m_bCastShadow
 

Protected Attributes

float * m_fXLookup
 
float * m_fZLookup
 
int m_iPolygonTarget
 
bool m_bCulleveryframe
 
bool m_bCullonce
 
float m_fDetailTiling
 
float m_fDetailDistance
 
bool m_bDetailTexture
 
vtMaterialm_pDetailMat
 
- Protected Attributes inherited from vtDynGeom
OsgDynMeshm_pDynMesh
 
- Protected Attributes inherited from vtHeightFieldGrid3d
int m_iColumns
 
int m_iRows
 
float m_fXStep
 
float m_fZStep
 
double m_dXStep
 
double m_dYStep
 
- Protected Attributes inherited from vtHeightField3d
float m_fDiagonalLength
 
CultureExtensionm_pCulture
 
- Protected Attributes inherited from vtHeightField
float m_fMinHeight
 
float m_fMaxHeight
 
DRECT m_EarthExtents
 

Additional Inherited Members

- Protected Member Functions inherited from vtHeightField3d
void UpdateWorldExtents ()
 

Detailed Description

This class provides a framework for implementing any kind of dynamic geometry for a heightfield terrain grid. It is the parent class which contains common fuctionality used by each of the terrain CLOD implementations.

Member Function Documentation

DTErr vtDynTerrainGeom::BasicInit ( const vtElevationGrid pGrid)

Sets up the vtDynTerrainGeom object. The units, extents, height range, grid dimensions and other properties are copied from the supplied elevation grid.

This is generally called from the Init() method of a subclass.

bool vtDynTerrainGeom::FindAltitudeAtPoint ( const FPoint3 p3,
float &  fAltitude,
bool  bTrue = false,
int  iCultureFlags = 0,
FPoint3 vNormal = NULL 
) const
virtual

Given a point in world coordinates, determine the elevation at that point.

Parameters
p3The point to test. Only the X and Z values are used.
fAltitudeThe resulting elevation at that point, by reference.
bTrueTrue to test true elevation. False to test the displayed elevation (possibly exaggerated.)
iCultureFlagsPass 0 to test only the heightfield itself, non-zero to test any culture objects which may be sitting on the heightfield. Values include:
  • CE_STRUCTURES Test structures on the ground.
  • CE_ROADS Test roads on the ground.
  • CE_ALL Test everything on the ground.
vNormalIf you supply a pointer to a vector, it will be set to the upward-pointing surface normal at the ground point.
Returns
true if successful, false if there was nothing found at that point.

Implements vtHeightField3d.

int vtDynTerrainGeom::GetNumDrawnTriangles ( )

Return the number of triangles that were rendered by this dynamic terrain last frame.

int vtDynTerrainGeom::GetPolygonTarget ( )

Get the polygon target, which is the number of polygons (generally triangles) which the CLOD algorithm will try to maintain.

void vtDynTerrainGeom::SetPolygonTarget ( int  iCount)
virtual

Set the polygon target, which is the number of polygons (generally triangles) which the CLOD algorithm will try to maintain.

Reimplemented in SRTerrain.


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