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

#include <NodeOSG.h>

Inheritance diagram for vtDynGeom:
vtGeode NodeExtension MyGeom vtDynTerrainGeom vtTiledGeom BruteTerrain DemeterTerrain SMTerrain SRTerrain TVTerrain

Public Member Functions

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
 
virtual void DoCalcBoundBox (FBox3 &box)=0
 
virtual void DoCull (const vtCamera *pCam)=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 Attributes

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

OsgDynMeshm_pDynMesh
 

Detailed Description

vtDynGeom extends the vtGeode class with the ability to have dynamic geometry which changes every frame. The most prominent use of this feature is to do Continuous Level of Detail (CLOD) for terrain.

To implement, you must create your own subclass and override the following methods:
  • DoRender()
  • DoCalcBoundBox()
  • DoCull()
Many helpful methods are provided to make doing your own view culling very easy:
  • IsVisible(sphere)
  • IsVisible(triangle)
  • IsVisible(point)
See Also
vtDynTerrainGeom

Member Function Documentation

int vtDynGeom::IsVisible ( const FSphere sphere) const

Test a sphere against the view volume.

Returns
VT_AllVisible if entirely inside the volume, VT_Visible if partly inside, otherwise 0.
int vtDynGeom::IsVisible ( const FPoint3 point0,
const FPoint3 point1,
const FPoint3 point2,
const float  fTolerance = 0.0f 
) const

Test a 3d triangle against the view volume.

Returns
VT_AllVisible if entirely inside the volume, VT_Visible if partly intersecting, otherwise 0.
int vtDynGeom::IsVisible ( const FPoint3 point,
float  radius 
)

Test a sphere against the view volume.

Returns
VT_AllVisible if entirely inside the volume, VT_Visible if partly intersecting, otherwise 0.
bool vtDynGeom::IsVisible ( const FPoint3 point) const

Test a single point against the view volume.

Returns
true if inside, false if outside.

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