NL3D::CTessVertex Class Reference

#include <tessellation.h>


Detailed Description

A Landscape Vertex
Author:
Lionel Berenguier

Nevrax France

Date:
2000

Definition at line 97 of file tessellation.h.

Public Member Functions

void computeGeomPos ()
 CTessVertex ()

Data Fields

CVector EndPos
float MaxFaceSize
float MaxNearLimit
CVector Pos
CVector StartPos


Constructor & Destructor Documentation

NL3D::CTessVertex::CTessVertex  )  [inline]
 

Definition at line 107 of file tessellation.h.

References MaxFaceSize, and MaxNearLimit.

00108         {
00109                 // init to 0, so max always() works.
00110                 MaxFaceSize= 0;
00111                 MaxNearLimit= 0;
00112         }


Member Function Documentation

void NL3D::CTessVertex::computeGeomPos  ) 
 

Definition at line 113 of file tessellation.cpp.

References NLMISC::clamp(), EndPos, MaxFaceSize, MaxNearLimit, NLMISC::sqr(), and StartPos.

Referenced by NL3D::CPatch::computeGeomorphVertexList(), and NL3D::CTessFace::computeTesselatedPos().

00114 {
00115         // Compute Basic ErrorMetric.
00116         float   sqrDist= (StartPos - CLandscapeGlobals::RefineCenter).sqrnorm();
00117         float   pgeom= MaxFaceSize * CLandscapeGlobals::OORefineThreshold / sqrDist;
00118 
00119         // Compute ErrorMetric modified by TileNear transition, only if TileNear transition.
00120         if( sqrDist< CLandscapeGlobals::TileDistFarSqr )
00121         {
00122                 // Soft optim: do it only if necessary, ie result of max(errorMetric, errorMetricModified) is foreseeable here.
00123                 if(pgeom < MaxNearLimit)
00124                 {
00125                         float   f= (CLandscapeGlobals::TileDistFarSqr - sqrDist) * CLandscapeGlobals::OOTileDistDeltaSqr;
00126                         clamp(f, 0, 1);
00127                         // ^4 gives better smooth result
00128                         f= sqr(f);
00129                         f= sqr(f);
00130                         // interpolate the errorMetric
00131                         pgeom= MaxNearLimit*f + pgeom*(1-f);
00132                 }
00133         }
00134 
00135         // Interpolate StartPos to EndPos, between 1 and 2.
00136         if(pgeom<=1.0f)
00137                 Pos= StartPos;
00138         else if(pgeom>=2.0f)
00139                 Pos= EndPos;
00140         else
00141         {
00142                 float           f= pgeom - 1.0f;
00143                 Pos= f * (EndPos-StartPos) + StartPos;
00144         }
00145 }


Field Documentation

CVector NL3D::CTessVertex::EndPos
 

Definition at line 102 of file tessellation.h.

Referenced by NL3D::CZoneLighter::addTriangles(), NL3D::CInstanceLighter::addTriangles(), NL3D::CPatch::appendFaceToRenderList(), NL3D::CLandscape::appendToShadowPolyReceiver(), NL3D::CTessFace::averageTesselationVertices(), NL3D::CPatch::averageTesselationVertices(), NL3D::CPatch::bind(), NL3D::CZoneLighter::buildZoneInformation(), NL3D::CPatch::computeContinousVertex(), computeGeomPos(), NL3D::CTessFace::computeSplitPoint(), NL3D::CTessFace::computeTileErrorMetric(), NL3D::CPatch::computeVertexButCorner(), NL3D::CPatch::extendTessBlockWithEndPos(), NL3D::CPatch::fillFar0VertexVB(), NL3D::CPatch::fillFar1VertexVB(), NL3D::CPatch::fillTileVertexVB(), NL3D::CPatch::makeRoots(), NL3D::CTessFace::refreshTesselationGeometry(), NL3D::CPatch::refreshTesselationGeometry(), NL3D::CTessFace::split(), NL3D::CTessFace::splitRectangular(), NL3D::CTessFace::updateBindAndSplit(), NL3D::CTessFace::updateRefineMerge(), and NL3D::CTessFace::updateRefineSplit().

float NL3D::CTessVertex::MaxFaceSize
 

Definition at line 104 of file tessellation.h.

Referenced by computeGeomPos(), CTessVertex(), NL3D::CPatch::fillFar0VertexVB(), NL3D::CPatch::fillFar1VertexVB(), NL3D::CPatch::fillTileVertexVB(), NL3D::CPatch::makeRoots(), NL3D::CTessFace::split(), NL3D::CTessFace::splitRectangular(), and NL3D::CTessFace::unbind().

float NL3D::CTessVertex::MaxNearLimit
 

Definition at line 105 of file tessellation.h.

Referenced by computeGeomPos(), CTessVertex(), NL3D::CPatch::fillFar0VertexVB(), NL3D::CPatch::fillFar1VertexVB(), NL3D::CPatch::fillTileVertexVB(), NL3D::CPatch::makeRoots(), NL3D::CTessFace::split(), NL3D::CTessFace::splitRectangular(), and NL3D::CTessFace::unbind().

CVector NL3D::CTessVertex::Pos
 

Definition at line 101 of file tessellation.h.

Referenced by NL3D::CPatch::averageTesselationVertices(), NL3D::CPatch::bind(), NL3D::CPatch::computeGeomorphAlphaFar1VertexListVB(), NL3D::CPatch::computeGeomorphFar0VertexListVB(), NL3D::CPatch::computeGeomorphTileVertexListVB(), NL3D::CTessFace::computeTesselatedPos(), NL3D::CPatch::fillFar0VertexVB(), NL3D::CPatch::fillFar1VertexVB(), NL3D::CPatch::fillTileVertexVB(), NL3D::CPatch::makeRoots(), NL3D::CTessFace::refreshTesselationGeometry(), NL3D::CPatch::refreshTesselationGeometry(), NL3D::CTessFace::split(), NL3D::CTessFace::splitRectangular(), and NL3D::CTessFace::updateBindAndSplit().

CVector NL3D::CTessVertex::StartPos
 

Definition at line 102 of file tessellation.h.

Referenced by NL3D::CPatch::appendFaceToRenderList(), NL3D::CPatch::averageTesselationVertices(), NL3D::CPatch::bind(), computeGeomPos(), NL3D::CPatch::fillFar0VertexVB(), NL3D::CPatch::fillFar1VertexVB(), NL3D::CPatch::fillTileVertexVB(), NL3D::CPatch::makeRoots(), NL3D::CPatch::refreshTesselationGeometry(), NL3D::CTessFace::split(), NL3D::CTessFace::splitRectangular(), and NL3D::CTessFace::updateBindAndSplit().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 07:49:09 2004 for NeL by doxygen 1.3.6