NL3D::CMeshMRMGeom::CLod Class Reference


Detailed Description

A LOD of the MRM.

Definition at line 377 of file mesh_mrm.h.

Public Member Functions

void buildSkinVertexBlocks ()
 CLod ()
void optimizeTriangleOrder ()
void serial (NLMISC::IStream &f)

Data Fields

std::vector< CMRMWedgeGeomGeomorphs
 List of geomorph, for this LOD.

std::vector< uint32InfluencedVertices [NL3D_MESH_SKINNING_MAX_MATRIX]
std::vector< uint32MatrixInfluences
 Skinning: list of Matrix which influence this Lod. So we know what matrix to compute.

uint32 NWedges
 The number of vertex in The VB this Lod needs.

bool OriginalSkinRestored
 Skinning: does the VBuffer part of this Lod contains original skin vertices.

std::vector< CRdrPassRdrPass
 List of rdr pass, for this LOD.

std::vector< CVertexBlockSkinVertexBlocks


Constructor & Destructor Documentation

NL3D::CMeshMRMGeom::CLod::CLod  )  [inline]
 

Definition at line 402 of file mesh_mrm.h.

References OriginalSkinRestored.

00403                 {
00404                         // By default, this is supposed false.
00405                         OriginalSkinRestored= false;
00406                 }


Member Function Documentation

void NL3D::CMeshMRMGeom::CLod::buildSkinVertexBlocks  ) 
 

Definition at line 105 of file mesh_mrm.cpp.

References index, InfluencedVertices, NL3D_MESH_SKINNING_MAX_MATRIX, NL3D::CMeshMRMGeom::CVertexBlock::NVertices, NWedges, SkinVertexBlocks, uint, uint32, and NL3D::CMeshMRMGeom::CVertexBlock::VertexStart.

00106 {
00107         contReset(SkinVertexBlocks);
00108 
00109 
00110         // The list of vertices. true if used by this lod.
00111         vector<bool>            vertexMap;
00112         vertexMap.resize(NWedges, false);
00113 
00114 
00115         // from InfluencedVertices, aknoledge what vertices are used.
00116         uint    i;
00117         for(i=0;i<NL3D_MESH_SKINNING_MAX_MATRIX;i++)
00118         {
00119                 uint            nInf= InfluencedVertices[i].size();
00120                 if( nInf==0 )
00121                         continue;
00122                 uint32          *infPtr= &(InfluencedVertices[i][0]);
00123 
00124                 //  for all InfluencedVertices only.
00125                 for(;nInf>0;nInf--, infPtr++)
00126                 {
00127                         uint    index= *infPtr;
00128                         vertexMap[index]= true;
00129                 }
00130         }
00131 
00132         // For all vertices, test if they are used, and build the according SkinVertexBlocks;
00133         CVertexBlock    *vBlock= NULL;
00134         for(i=0; i<vertexMap.size();i++)
00135         {
00136                 if(vertexMap[i])
00137                 {
00138                         // preceding block?
00139                         if(vBlock)
00140                         {
00141                                 // yes, extend it.
00142                                 vBlock->NVertices++;
00143                         }
00144                         else
00145                         {
00146                                 // no, append a new one.
00147                                 SkinVertexBlocks.push_back(CVertexBlock());
00148                                 vBlock= &SkinVertexBlocks[SkinVertexBlocks.size()-1];
00149                                 vBlock->VertexStart= i;
00150                                 vBlock->NVertices= 1;
00151                         }
00152                 }
00153                 else
00154                 {
00155                         // Finish the preceding block (if any).
00156                         vBlock= NULL;
00157                 }
00158         }
00159 
00160 }

void NL3D::CMeshMRMGeom::CLod::optimizeTriangleOrder  ) 
 

Definition at line 164 of file mesh_mrm.cpp.

References NL3D::CStripifier::optimizeTriangles(), NL3D::CMeshMRMGeom::CRdrPass::PBlock, and uint.

00165 {
00166         CStripifier             stripifier;
00167 
00168         // for all rdrpass
00169         for(uint  rp=0; rp<RdrPass.size(); rp++ )
00170         {
00171                 // stripify list of triangles of this pass.
00172                 CRdrPass        &pass= RdrPass[rp];
00173                 stripifier.optimizeTriangles(pass.PBlock, pass.PBlock);
00174         }
00175 
00176 }

void NL3D::CMeshMRMGeom::CLod::serial NLMISC::IStream f  ) 
 


Field Documentation

std::vector<CMRMWedgeGeom> NL3D::CMeshMRMGeom::CLod::Geomorphs
 

List of geomorph, for this LOD.

Definition at line 383 of file mesh_mrm.h.

Referenced by NL3D::CMRMBuilder::buildMeshBuildMrm(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshMRMGeom::renderSkin(), and NL3D::CMeshMRMGeom::updateRawSkinNormal().

std::vector<uint32> NL3D::CMeshMRMGeom::CLod::InfluencedVertices[NL3D_MESH_SKINNING_MAX_MATRIX]
 

Skinning: list of influenced vertices to compute, for this lod only. There is 4 array, 0th is for vertices which have only one matrix. 1st if for vertices which have only 2 matrix ....

Definition at line 390 of file mesh_mrm.h.

Referenced by NL3D::CMeshMRMGeom::applySkin(), NL3D::CMRMBuilder::buildMeshBuildMrm(), buildSkinVertexBlocks(), NL3D::CMeshMRMGeom::restoreOriginalSkinPart(), and NL3D::CMeshMRMGeom::updateRawSkinNormal().

std::vector<uint32> NL3D::CMeshMRMGeom::CLod::MatrixInfluences
 

Skinning: list of Matrix which influence this Lod. So we know what matrix to compute.

Definition at line 392 of file mesh_mrm.h.

Referenced by NL3D::CMeshMRMGeom::applyArrayShadowSkin(), NL3D::CMeshMRMGeom::applySkin(), and NL3D::CMRMBuilder::buildMeshBuildMrm().

uint32 NL3D::CMeshMRMGeom::CLod::NWedges
 

The number of vertex in The VB this Lod needs.

Definition at line 381 of file mesh_mrm.h.

Referenced by NL3D::CMRMBuilder::buildMeshBuildMrm(), buildSkinVertexBlocks(), and NL3D::CMeshMRMGeom::renderSkinGroupGeom().

bool NL3D::CMeshMRMGeom::CLod::OriginalSkinRestored
 

Skinning: does the VBuffer part of this Lod contains original skin vertices.

Definition at line 394 of file mesh_mrm.h.

Referenced by CLod(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshMRMGeom::renderSkin(), and NL3D::CMeshMRMGeom::restoreOriginalSkinPart().

std::vector<CRdrPass> NL3D::CMeshMRMGeom::CLod::RdrPass
 

List of rdr pass, for this LOD.

Definition at line 385 of file mesh_mrm.h.

Referenced by NL3D::CMeshMRMGeom::build(), NL3D::CMRMBuilder::buildMeshBuildMrm(), NL3D::CMeshMRMGeom::computeMeshVBHeap(), NL3D::CMeshMRMGeom::profileSceneRender(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshMRMGeom::renderPass(), NL3D::CMeshMRMGeom::renderSkin(), NL3D::CMeshMRMGeom::renderSkinGroupGeom(), NL3D::CMeshMRMGeom::renderSkinGroupPrimitives(), NL3D::CMeshMRMGeom::renderSkinGroupSpecularRdrPass(), NL3D::CMeshMRMGeom::updateRawSkinNormal(), and NL3D::CMeshMRMGeom::updateShiftedTriangleCache().

std::vector<CVertexBlock> NL3D::CMeshMRMGeom::CLod::SkinVertexBlocks
 

Skinning: list of vertex blocks to copy from RAM to AGP, for this Lod only. NB: it is constructed from InfluencedVertices. Only usefull if skinned.

Definition at line 398 of file mesh_mrm.h.

Referenced by buildSkinVertexBlocks().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 06:53:19 2004 for NeL by doxygen 1.3.6