#include <tess_block.h>
Nevrax France
Definition at line 59 of file tess_block.h.
|
|
Definition at line 42 of file tess_block.cpp. References _NextToModify, _PrecToModify, Clipped, EmptyFar1, FaceTileMaterialRefCount, Far0FaceVector, Far1FaceVector, FullFar1, LightMapRefCount, NL3D_TESSBLOCK_TILESIZE, RdrTileRoot, sint, TileMaterialRefCount, and VegetableBlock.
00043 {
00044 _Patch= NULL;
00045
00046 // init bounding info.
00047 Empty= true;
00048 // By default, the tessBlock is clipped.
00049 Clipped= true;
00050 FullFar1= false;
00051 EmptyFar1= false;
00052
00053 // init vert/face list.
00054 for(sint i=0;i<NL3D_TESSBLOCK_TILESIZE;i++)
00055 {
00056 RdrTileRoot[i]=NULL;
00057 }
00058
00059 // init LightMap.
00060 LightMapRefCount= 0;
00061
00062 Far0FaceVector= NULL;
00063 Far1FaceVector= NULL;
00064
00065 _PrecToModify= NULL;
00066 _NextToModify= NULL;
00067
00068 FaceTileMaterialRefCount= 0;
00069 TileMaterialRefCount= 0;
00070
00071 // Micro-vegetation.
00072 VegetableBlock= NULL;
00073 }
|
|
|
Definition at line 77 of file tess_block.cpp. References isInModifyList(), LightMapRefCount, nlassert, and removeFromModifyList().
00078 {
00079 if(isInModifyList())
00080 {
00081 removeFromModifyList();
00082 }
00083
00084 // LightMap should be released
00085 nlassert(LightMapRefCount==0);
00086 }
|
|
||||||||||||
|
Definition at line 354 of file tess_block.cpp. References _NextToModify, _PrecToModify, deleteFaceVectorFar0(), deleteFaceVectorFar1(), deleteFaceVectorTile(), and isInModifyList(). Referenced by NL3D::CPatch::dirtTessBlockFaceVector().
00355 {
00356 // If already appened, return.
00357 if(isInModifyList())
00358 return;
00359
00360 // append to root.
00361 _PrecToModify= &root;
00362 _NextToModify= root._NextToModify;
00363 if(root._NextToModify)
00364 root._NextToModify->_PrecToModify= this;
00365 root._NextToModify= this;
00366
00367 // Then delete All faceVector that may exist.
00368 deleteFaceVectorFar0(mgr);
00369 deleteFaceVectorFar1(mgr);
00370 deleteFaceVectorTile(mgr);
00371 }
|
|
|
Definition at line 146 of file tess_block.cpp. References NLMISC::CBSphere::clipBack(), Clipped, NL3D_TESSBLOCK_NUM_CLIP_PLANE, and sint. Referenced by NL3D::CPatch::preRender().
|
|
||||||||||||||||
|
Definition at line 160 of file tess_block.cpp. References NLMISC::CBSphere::Center, EmptyFar1, FullFar1, r, and NLMISC::CBSphere::Radius. Referenced by NL3D::CPatch::preRender().
|
|
|
Definition at line 198 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::createFaceVector(), Far0FaceVector, FarFaceList, nlassert, refillFaceVectorFar0(), and NL3D::CTessList< CTessFace >::size(). Referenced by NL3D::CPatch::createFaceVectorFar0OrTile(), and NL3D::CPatch::recreateTessBlockFaceVector().
00199 {
00200 nlassert(Far0FaceVector==NULL);
00201 // If size is not 0.
00202 if(FarFaceList.size()>0)
00203 {
00204 // Create a faceVector of the wanted triangles size.
00205 Far0FaceVector= mgr.createFaceVector(FarFaceList.size());
00206
00207 // init.
00208 refillFaceVectorFar0();
00209 }
00210
00211 }
|
|
|
Definition at line 242 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::createFaceVector(), Far1FaceVector, FarFaceList, nlassert, refillFaceVectorFar1(), and NL3D::CTessList< CTessFace >::size(). Referenced by NL3D::CPatch::createFaceVectorFar1(), and NL3D::CPatch::recreateTessBlockFaceVector().
00243 {
00244 nlassert(Far1FaceVector==NULL);
00245 // If size is not 0.
00246 if(FarFaceList.size()>0)
00247 {
00248 // Create a faceVector of the wanted triangles size.
00249 Far1FaceVector= mgr.createFaceVector(FarFaceList.size());
00250
00251 // init.
00252 refillFaceVectorFar1();
00253 }
00254 }
|
|
|
Definition at line 302 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::createFaceVector(), NL3D_MAX_TILE_FACE, NL3D_TESSBLOCK_TILESIZE, RdrTileRoot, refillFaceVectorTile(), NL3D::CTessList< T >::size(), NL3D::CTileMaterial::TileFaceList, uint, and uint32. Referenced by NL3D::CPatch::recreateTessBlockFaceVector().
00303 {
00304 // For all tiles existing, and for all facePass existing, create the faceVector.
00305 for(uint tileId=0; tileId<NL3D_TESSBLOCK_TILESIZE; tileId++)
00306 {
00307 // if tile exist.
00308 if(RdrTileRoot[tileId])
00309 {
00310 // For all Pass faces of the tile.
00311 for(uint facePass=0; facePass<NL3D_MAX_TILE_FACE; facePass++)
00312 {
00313 CTessList<CTileFace> &faceList= RdrTileRoot[tileId]->TileFaceList[facePass];
00314 uint32 *&faceVector= RdrTileRoot[tileId]->TileFaceVectors[facePass];
00315 // If some triangles create them.
00316 if(faceList.size()>0)
00317 {
00318 // Create a faceVector of the wanted triangles size.
00319 faceVector= mgr.createFaceVector(faceList.size());
00320 }
00321 }
00322 }
00323 }
00324
00325 // init.
00326 refillFaceVectorTile();
00327 }
|
|
|
Definition at line 213 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::deleteFaceVector(), and Far0FaceVector. Referenced by appendToModifyListAndDeleteFaceVector(), and NL3D::CPatch::deleteFaceVectorFar0OrTile().
00214 {
00215 if(Far0FaceVector)
00216 {
00217 mgr.deleteFaceVector(Far0FaceVector);
00218 Far0FaceVector= NULL;
00219 }
00220 }
|
|
|
Definition at line 256 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::deleteFaceVector(), and Far1FaceVector. Referenced by appendToModifyListAndDeleteFaceVector(), and NL3D::CPatch::deleteFaceVectorFar1().
00257 {
00258 if(Far1FaceVector)
00259 {
00260 mgr.deleteFaceVector(Far1FaceVector);
00261 Far1FaceVector= NULL;
00262 }
00263 }
|
|
|
Definition at line 329 of file tess_block.cpp. References NL3D::CLandscapeFaceVectorManager::deleteFaceVector(), NL3D_MAX_TILE_FACE, NL3D_TESSBLOCK_TILESIZE, RdrTileRoot, NL3D::CTileMaterial::TileFaceVectors, uint, and uint32. Referenced by appendToModifyListAndDeleteFaceVector().
00330 {
00331 // For all tiles existing, and for all facePass existing, delete the faceVector.
00332 for(uint tileId=0; tileId<NL3D_TESSBLOCK_TILESIZE; tileId++)
00333 {
00334 // if tile exist.
00335 if(RdrTileRoot[tileId])
00336 {
00337 // For all Pass faces of the tile.
00338 for(uint facePass=0; facePass<NL3D_MAX_TILE_FACE; facePass++)
00339 {
00340 uint32 *&faceVector= RdrTileRoot[tileId]->TileFaceVectors[facePass];
00341 // If the faceVector exist, delete it.
00342 if(faceVector)
00343 {
00344 mgr.deleteFaceVector(faceVector);
00345 faceVector= NULL;
00346 }
00347 }
00348 }
00349 }
00350 }
|
|
|
Definition at line 115 of file tess_block.cpp. References NLMISC::CAABBox::extend(), and NLMISC::CAABBox::include(). Referenced by extendSphereFirst().
|
|
|
Definition at line 122 of file tess_block.cpp. References NLMISC::CBSphere::Center, NLMISC::CAABBox::getCenter(), NLMISC::CAABBox::getRadius(), and NLMISC::CBSphere::Radius.
|
|
|
Definition at line 102 of file tess_block.cpp. References extendSphereAdd(), NLMISC::CAABBox::setCenter(), and NLMISC::CAABBox::setHalfSize().
00103 {
00104 if(Empty)
00105 {
00106 Empty= false;
00107 BBox.setCenter(vec);
00108 BBox.setHalfSize(CVector::Null);
00109 }
00110 else
00111 extendSphereAdd(vec);
00112 }
|
|
|
Definition at line 139 of file tess_block.cpp. References Clipped. Referenced by NL3D::CPatch::preRender(), and NL3D::CPatch::updateClipPatchVB().
00140 {
00141 Clipped= true;
00142 }
|
|
|
Definition at line 132 of file tess_block.h. References Clipped. Referenced by NL3D::CPatch::computeSoftwareGeomorphAndAlpha().
00132 {return Clipped;}
|
|
|
Definition at line 160 of file tess_block.h. References _NextToModify. Referenced by NL3D::CLandscape::averageTesselationVertices(), NL3D::CLandscape::clip(), and NL3D::CLandscape::updateTessBlocksFaceVector().
00160 {return _NextToModify;}
|
|
|
Definition at line 94 of file tess_block.cpp. Referenced by NL3D::CLandscape::updateTessBlocksFaceVector().
00095 {
00096 return _Patch;
00097 }
|
|
|
Definition at line 89 of file tess_block.cpp. Referenced by NL3D::CPatch::compile().
00090 {
00091 _Patch= patch;
00092 }
|
|
|
Definition at line 152 of file tess_block.h. References _PrecToModify. Referenced by appendToModifyListAndDeleteFaceVector(), NL3D::CPatch::dirtTessBlockFaceVector(), removeFromModifyList(), and ~CTessBlock().
00152 {return _PrecToModify!=NULL;}
|
|
|
Definition at line 177 of file tess_block.cpp. References NL3D::CTessList< CTessFace >::begin(), Far0FaceVector, FarFaceList, NL3D::CTessFace::FVBase, NL3D::CTessFace::FVLeft, NL3D::CTessFace::FVRight, NL3D::CTessFarVertex::Index0, NL3D::CTessNodeList::Next, nlassert, NL3D::CTessList< CTessFace >::size(), and uint32. Referenced by createFaceVectorFar0(), and NL3D::CPatch::preRender().
00178 {
00179 // If size is not 0.
00180 if(FarFaceList.size()>0)
00181 {
00182 nlassert(Far0FaceVector!=NULL);
00183
00184 // Fill this faceVector, with FarFaceList
00185 CTessFace *pFace;
00186 uint32 *dest= Far0FaceVector+1;
00187 for(pFace= FarFaceList.begin(); pFace; pFace= (CTessFace*)pFace->Next)
00188 {
00189 *(dest++)= pFace->FVBase->Index0;
00190 *(dest++)= pFace->FVLeft->Index0;
00191 *(dest++)= pFace->FVRight->Index0;
00192 }
00193 }
00194 }
|
|
|
Definition at line 223 of file tess_block.cpp. References NL3D::CTessList< CTessFace >::begin(), Far1FaceVector, FarFaceList, NL3D::CTessFace::FVBase, NL3D::CTessFace::FVLeft, NL3D::CTessFace::FVRight, NL3D::CTessFarVertex::Index1, NL3D::CTessNodeList::Next, nlassert, NL3D::CTessList< CTessFace >::size(), and uint32. Referenced by createFaceVectorFar1(), and NL3D::CPatch::preRender().
00224 {
00225 // If size is not 0.
00226 if(FarFaceList.size()>0)
00227 {
00228 nlassert(Far1FaceVector!=NULL);
00229 // Fill this faceVector, with FarFaceList
00230 CTessFace *pFace;
00231 uint32 *dest= Far1FaceVector+1;
00232 for(pFace= FarFaceList.begin(); pFace; pFace= (CTessFace*)pFace->Next)
00233 {
00234 *(dest++)= pFace->FVBase->Index1;
00235 *(dest++)= pFace->FVLeft->Index1;
00236 *(dest++)= pFace->FVRight->Index1;
00237 }
00238 }
00239 }
|
|
|
Definition at line 267 of file tess_block.cpp. References NL3D::CTessList< T >::begin(), NL3D::CTessNearVertex::Index, NL3D::CTessNodeList::Next, NL3D_MAX_TILE_FACE, NL3D_TESSBLOCK_TILESIZE, nlassert, RdrTileRoot, NL3D::CTessList< T >::size(), NL3D::CTileMaterial::TileFaceList, uint, uint32, and NL3D::CTileFace::V. Referenced by createFaceVectorTile(), and NL3D::CPatch::preRender().
00268 {
00269 // For all tiles existing, and for all facePass existing, fill the faceVector.
00270 for(uint tileId=0; tileId<NL3D_TESSBLOCK_TILESIZE; tileId++)
00271 {
00272 // if tile exist.
00273 if(RdrTileRoot[tileId])
00274 {
00275 // For all Pass faces of the tile.
00276 for(uint facePass=0; facePass<NL3D_MAX_TILE_FACE; facePass++)
00277 {
00278 CTessList<CTileFace> &faceList= RdrTileRoot[tileId]->TileFaceList[facePass];
00279 uint32 *faceVector= RdrTileRoot[tileId]->TileFaceVectors[facePass];
00280 // If some triangles create them.
00281 if(faceList.size()>0)
00282 {
00283 nlassert( faceVector!=NULL );
00284
00285 // Fill this faceVector, with the TileFaceList
00286 CTileFace *pFace;
00287 uint32 *dest= faceVector+1;
00288 for(pFace= faceList.begin(); pFace; pFace= (CTileFace*)pFace->Next)
00289 {
00290 *(dest++)= pFace->V[CTessFace::IdUvBase]->Index;
00291 *(dest++)= pFace->V[CTessFace::IdUvLeft]->Index;
00292 *(dest++)= pFace->V[CTessFace::IdUvRight]->Index;
00293 }
00294 }
00295 }
00296 }
00297 }
00298 }
|
|
|
Definition at line 373 of file tess_block.cpp. References _NextToModify, _PrecToModify, and isInModifyList(). Referenced by NL3D::CLandscape::updateTessBlocksFaceVector(), and ~CTessBlock().
00374 {
00375 // If already removed, return.
00376 // _PrecToModify must be !NULL
00377 if(!isInModifyList())
00378 return;
00379
00380 // unlink.
00381 _PrecToModify->_NextToModify= _NextToModify;
00382 if(_NextToModify)
00383 _NextToModify->_PrecToModify= _PrecToModify;
00384 _PrecToModify= NULL;
00385 _NextToModify= NULL;
00386 }
|
|
|
Definition at line 130 of file tess_block.cpp. References Clipped, EmptyFar1, and FullFar1. Referenced by NL3D::CPatch::CPatch(), and NL3D::CPatch::preRender().
|
|
|
|
|
Definition at line 134 of file tess_block.h. References Clipped, and FullFar1. Referenced by NL3D::CPatch::checkCreateVertexVBNear(), NL3D::CPatch::checkDeleteVertexVBNear(), NL3D::CPatch::checkFillVertexVBNear(), NL3D::CPatch::computeSoftwareGeomorphAndAlpha(), NL3D::CPatch::fillVB(), NL3D::CPatch::preRender(), and NL3D::CPatch::updateVBAlloc().
|
|
|
Definition at line 167 of file tess_block.h. Referenced by appendToModifyListAndDeleteFaceVector(), CTessBlock(), getNextToModify(), and removeFromModifyList(). |
|
|
Definition at line 163 of file tess_block.h. |
|
|
Definition at line 166 of file tess_block.h. Referenced by appendToModifyListAndDeleteFaceVector(), CTessBlock(), isInModifyList(), and removeFromModifyList(). |
|
|
Definition at line 73 of file tess_block.h. |
|
|
Definition at line 74 of file tess_block.h. |
|
|
Definition at line 78 of file tess_block.h. Referenced by clip(), CTessBlock(), forceClip(), getClipped(), resetClip(), visibleFar0(), visibleFar1(), and visibleTile(). |
|
|
Definition at line 37 of file tess_block.cpp. |
|
|
Definition at line 75 of file tess_block.h. |
|
|
Definition at line 80 of file tess_block.h. Referenced by clipFar(), CTessBlock(), resetClip(), and visibleFar1(). |
|
|
Definition at line 92 of file tess_block.h. Referenced by NL3D::CPatch::appendFaceToRenderList(), CTessBlock(), NL3D::CPatch::preRender(), and NL3D::CPatch::removeFaceFromRenderList(). |
|
|
Definition at line 67 of file tess_block.h. Referenced by createFaceVectorFar0(), CTessBlock(), deleteFaceVectorFar0(), refillFaceVectorFar0(), and NL3D::CPatch::renderFar0(). |
|
|
Definition at line 68 of file tess_block.h. Referenced by createFaceVectorFar1(), CTessBlock(), deleteFaceVectorFar1(), refillFaceVectorFar1(), and NL3D::CPatch::renderFar1(). |
|
|
Definition at line 89 of file tess_block.h. Referenced by NL3D::CPatch::appendFaceToRenderList(), createFaceVectorFar0(), createFaceVectorFar1(), refillFaceVectorFar0(), refillFaceVectorFar1(), NL3D::CPatch::removeFaceFromRenderList(), and NL3D::CPatch::resetMasterBlock(). |
|
|
|
Definition at line 79 of file tess_block.h. Referenced by clipFar(), CTessBlock(), resetClip(), visibleFar0(), and visibleTile(). |
|
|
Definition at line 98 of file tess_block.h. Referenced by NL3D::CPatch::getTileLightMap(), NL3D::CPatch::getTileLightMapUvInfo(), NL3D::CPatch::releaseTileLightMap(), and NL3D::CPatch::updateTessBlockLighting(). |
|
|
Definition at line 100 of file tess_block.h. Referenced by NL3D::CPatch::getTileLightMap(). |
|
|
Definition at line 99 of file tess_block.h. Referenced by CTessBlock(), NL3D::CPatch::getTileLightMap(), NL3D::CPatch::releaseTileLightMap(), NL3D::CPatch::updateTessBlockLighting(), and ~CTessBlock(). |
|
|
Definition at line 86 of file tess_block.h. Referenced by NL3D::CPatch::computeSoftwareGeomorphAndAlpha(), NL3D::CPatch::debugAllocationMarkIndices(), NL3D::CPatch::fillVB(), NL3D::CPatch::preRender(), NL3D::CPatch::resetMasterBlock(), and NL3D::CPatch::updateVBAlloc(). |
|
|
Definition at line 90 of file tess_block.h. Referenced by createFaceVectorTile(), CTessBlock(), deleteFaceVectorTile(), NL3D::CPatch::preRender(), and refillFaceVectorTile(). |
|
|
Definition at line 94 of file tess_block.h. Referenced by NL3D::CPatch::appendTileMaterialToRenderList(), CTessBlock(), NL3D::CPatch::getTileMaterialRefCount(), and NL3D::CPatch::removeTileMaterialFromRenderList(). |
|
|
Definition at line 104 of file tess_block.h. Referenced by CTessBlock(). |
1.3.6