NL3D::CMeshGeom::CCornerTmp Struct Reference

Inheritance diagram for NL3D::CMeshGeom::CCornerTmp:

NL3D::CMesh::CCorner

Detailed Description

Just for build process. NB: we must store palette info by corner (not by vertex) because Matrix Block grouping may insert vertex discontinuities. eg: a vertex use Matrix18. After Matrix grouping (16matrix max), Matrix18 could be Matrix2 for a group of face, but Matrix13 for an other!!

Definition at line 542 of file mesh.h.

Public Member Functions

 CCornerTmp ()
bool operator< (const CCornerTmp &c) const
CCornerTmpoperator= (const CMesh::CCorner &o)
void serial (NLMISC::IStream &f) throw (NLMISC::EStream)

Data Fields

CRGBA Color
CVector Normal
 The vertex Id.

CPaletteSkin Palette
CRGBA Specular
NLMISC::CUVW Uvws [CVertexBuffer::MaxStage]
sint VBId
sint32 Vertex
float Weights [4]

Static Public Attributes

sint Flags = 0


Constructor & Destructor Documentation

NL3D::CMeshGeom::CCornerTmp::CCornerTmp  )  [inline]
 

Definition at line 556 of file mesh.h.

References NL3D::CPaletteSkin::MatrixId, NL3D_MESH_SKINNING_MAX_MATRIX, Palette, sint, and VBId.

00557                 {
00558                         VBId= 0;
00559                         for(sint i=0;i<NL3D_MESH_SKINNING_MAX_MATRIX;i++)
00560                         {
00561                                 Palette.MatrixId[i]=0;
00562                                 Weights[i]=0;
00563                         }
00564                 }


Member Function Documentation

bool NL3D::CMeshGeom::CCornerTmp::operator< const CCornerTmp c  )  const
 

Definition at line 77 of file mesh.cpp.

References NL3D::CMesh::CCorner::Color, NL3D::CPaletteSkin::MatrixId, NL3D_MESH_SKINNING_MAX_MATRIX, NL3D::CMesh::CCorner::Normal, Palette, sint, NL3D::CMesh::CCorner::Specular, NL3D::CMesh::CCorner::Uvws, NL3D::CMesh::CCorner::Vertex, and Weights.

00078 {
00079         sint    i;
00080 
00081         // Vert first.
00082         if(Vertex!=c.Vertex)
00083                 return Vertex<c.Vertex;
00084 
00085         // Order: normal, uvs, color0, color1, skinning.
00086         if((CCornerTmp::Flags & CVertexBuffer::NormalFlag) && Normal!=c.Normal)
00087                 return Normal<c.Normal;
00088         for(i=0; i<CVertexBuffer::MaxStage; i++)
00089         {
00090                 if((CCornerTmp::Flags & (CVertexBuffer::TexCoord0Flag<<i)) && Uvws[i]!=c.Uvws[i])
00091                         return Uvws[i]<c.Uvws[i];
00092         }
00093         if((CCornerTmp::Flags & CVertexBuffer::PrimaryColorFlag) && Color!=c.Color)
00094                 return Color<c.Color;
00095         if((CCornerTmp::Flags & CVertexBuffer::SecondaryColorFlag) && Specular!=c.Specular)
00096                 return Specular<c.Specular;
00097 
00098         if ((CCornerTmp::Flags & CVertexBuffer::PaletteSkinFlag)==CVertexBuffer::PaletteSkinFlag)
00099         {
00100                 for(i=0;i<NL3D_MESH_SKINNING_MAX_MATRIX;i++)
00101                 {
00102                         if(Palette.MatrixId[i] != c.Palette.MatrixId[i])
00103                                 return Palette.MatrixId[i] < c.Palette.MatrixId[i];
00104                         if(Weights[i] != c.Weights[i])
00105                                 return Weights[i] < c.Weights[i];
00106                 }
00107         }
00108 
00109 
00110         // All are equal!!
00111         return false;
00112 }

CCornerTmp& NL3D::CMeshGeom::CCornerTmp::operator= const CMesh::CCorner o  )  [inline]
 

Definition at line 567 of file mesh.h.

References NL3D::CMesh::CCorner::Color, NL3D::CMesh::CCorner::Normal, sint, NL3D::CMesh::CCorner::Specular, NL3D::CMesh::CCorner::Uvws, and NL3D::CMesh::CCorner::Vertex.

00568                 {
00569                         Vertex= o.Vertex;
00570                         Normal= o.Normal;
00571                         for(sint i=0;i<=CVertexBuffer::MaxStage;i++)
00572                         {
00573                                 Uvws[i]= o.Uvws[i];
00574                         }                       
00575                         Color= o.Color;
00576                         Specular= o.Specular;
00577 
00578                         return *this;
00579                 }

void NL3D::CMesh::CCorner::serial NLMISC::IStream f  )  throw (NLMISC::EStream) [inherited]
 

Definition at line 2201 of file mesh.cpp.

References nlassert.

02202 {
02203         nlassert(0); // not used
02204         f.serial(Vertex);
02205         f.serial(Normal);
02206         for(int i=0;i<CVertexBuffer::MaxStage;++i) f.serial(Uvws[i]);
02207         f.serial(Color);
02208         f.serial(Specular);
02209 }


Field Documentation

CRGBA NL3D::CMesh::CCorner::Color [inherited]
 

Definition at line 90 of file mesh.h.

Referenced by NL3D::CMRMBuilder::buildBlendShapes(), NL3D::CMRMBuilder::buildMrmBaseMesh(), operator<(), and operator=().

sint NL3D::CMeshGeom::CCornerTmp::Flags = 0 [static]
 

Definition at line 73 of file mesh.cpp.

CVector NL3D::CMesh::CCorner::Normal [inherited]
 

The vertex Id.

Definition at line 88 of file mesh.h.

Referenced by NL3D::CMRMBuilder::buildBlendShapes(), NL3D::CMRMBuilder::buildMrmBaseMesh(), operator<(), and operator=().

CPaletteSkin NL3D::CMeshGeom::CCornerTmp::Palette
 

Definition at line 544 of file mesh.h.

Referenced by NL3D::CMeshGeom::buildSkin(), CCornerTmp(), and operator<().

CRGBA NL3D::CMesh::CCorner::Specular [inherited]
 

Definition at line 91 of file mesh.h.

Referenced by NL3D::CMRMBuilder::buildBlendShapes(), NL3D::CMRMBuilder::buildMrmBaseMesh(), operator<(), and operator=().

NLMISC::CUVW NL3D::CMesh::CCorner::Uvws[CVertexBuffer::MaxStage] [inherited]
 

Definition at line 89 of file mesh.h.

Referenced by NL3D::CMRMBuilder::buildBlendShapes(), NL3D::CMRMBuilder::buildMrmBaseMesh(), NL3D::CMesh::CCorner::CCorner(), operator<(), and operator=().

sint NL3D::CMeshGeom::CCornerTmp::VBId [mutable]
 

Definition at line 550 of file mesh.h.

Referenced by NL3D::CMeshGeom::build(), and CCornerTmp().

sint32 NL3D::CMesh::CCorner::Vertex [inherited]
 

Definition at line 87 of file mesh.h.

Referenced by NL3D::CMeshGeom::build(), NL3D::CMeshGeom::CFaceTmp::buildBoneUse(), NL3D::CMeshGeom::buildSkin(), NL3D::CMesh::CCorner::CCorner(), operator<(), and operator=().

float NL3D::CMeshGeom::CCornerTmp::Weights[ 4 ]
 

Definition at line 545 of file mesh.h.

Referenced by NL3D::CMeshGeom::buildSkin(), and operator<().


The documentation for this struct was generated from the following files:
Generated on Tue Mar 16 06:52:08 2004 for NeL by doxygen 1.3.6