Browse Source

more compiler compliant cleanups plus a full set of tsMesh::foo to tsmesh::mFoo class var conversions for consistency

Azaezel 7 years ago
parent
commit
c98f257cae

+ 2 - 2
Engine/source/environment/VolumetricFog.cpp

@@ -424,10 +424,10 @@ bool VolumetricFog::LoadShape()
                for (U32 k = 0; k < mesh->mIndices.size(); k++)
                   det_size[i].indices->push_back(mesh->mIndices[k]);
 
-               U32 primitivesSize = mesh->primitives.size();
+               U32 primitivesSize = mesh->mPrimitives.size();
                for (U32 k = 0; k < primitivesSize; k++)
                {
-                  const TSDrawPrimitive & draw = mesh->primitives[k];
+                  const TSDrawPrimitive & draw = mesh->mPrimitives[k];
                   GFXPrimitiveType drawType = GFXdrawTypes[draw.matIndex >> 30];
                   switch (drawType)
                   {

+ 3 - 3
Engine/source/gui/editor/guiShapeEdPreview.cpp

@@ -1244,9 +1244,9 @@ void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state)
             continue;
 
          // Count the number of draw calls and materials
-         mNumDrawCalls += mesh->primitives.size();
-         for ( S32 iPrim = 0; iPrim < mesh->primitives.size(); iPrim++ )
-            usedMaterials.push_back_unique( mesh->primitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask );
+         mNumDrawCalls += mesh->mPrimitives.size();
+         for ( S32 iPrim = 0; iPrim < mesh->mPrimitives.size(); iPrim++ )
+            usedMaterials.push_back_unique( mesh->mPrimitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask );
 
          // For skinned meshes, count the number of bones and weights
          if ( mesh->getMeshType() == TSMesh::SkinMeshType )

+ 8 - 8
Engine/source/ts/loader/appMesh.cpp

@@ -147,13 +147,13 @@ TSMesh* AppMesh::constructTSMesh()
    }
 
    // Copy mesh elements
-   tsmesh->verts = points;
-   tsmesh->norms = normals;
-   tsmesh->tverts = uvs;
-   tsmesh->primitives = primitives;
+   tsmesh->mVerts = points;
+   tsmesh->mNorms = normals;
+   tsmesh->mTverts = uvs;
+   tsmesh->mPrimitives = primitives;
    tsmesh->mIndices = indices;
-   tsmesh->colors = colors;
-   tsmesh->tverts2 = uv2s;
+   tsmesh->mColors = colors;
+   tsmesh->mTverts2 = uv2s;
 
    // Finish initializing the shape
    tsmesh->setFlags(flags);
@@ -162,8 +162,8 @@ TSMesh* AppMesh::constructTSMesh()
    tsmesh->numFrames = numFrames;
    tsmesh->numMatFrames = numMatFrames;
    tsmesh->vertsPerFrame = vertsPerFrame;
-   tsmesh->createTangents(tsmesh->verts, tsmesh->norms);
-   tsmesh->encodedNorms.set(NULL,0);
+   tsmesh->createTangents(tsmesh->mVerts, tsmesh->mNorms);
+   tsmesh->mEncodedNorms.set(NULL,0);
 
    return tsmesh;
 }

+ 1 - 1
Engine/source/ts/loader/tsShapeLoader.cpp

@@ -1172,7 +1172,7 @@ void TSShapeLoader::install()
       {
          TSMesh *mesh = shape->meshes[obj.startMeshIndex + iMesh];
 
-         if (mesh && !mesh->primitives.size())
+         if (mesh && !mesh->mPrimitives.size())
          {
             S32 oldMeshCount = obj.numMeshes;
             destructInPlace(mesh);

+ 6 - 6
Engine/source/ts/tsCollision.cpp

@@ -1364,9 +1364,9 @@ void TSMesh::prepOpcodeCollision()
    // Figure out how many triangles we have...
    U32 triCount = 0;
    const U32 base = 0;
-   for ( U32 i = 0; i < primitives.size(); i++ )
+   for ( U32 i = 0; i < mPrimitives.size(); i++ )
    {
-      TSDrawPrimitive & draw = primitives[i];
+      TSDrawPrimitive & draw = mPrimitives[i];
       const U32 start = draw.start;
 
       AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" );
@@ -1396,7 +1396,7 @@ void TSMesh::prepOpcodeCollision()
    }
 
    // Just do the first trilist for now.
-   mi->SetNbVertices( mVertexData.isReady() ? mNumVerts : verts.size() );
+   mi->SetNbVertices( mVertexData.isReady() ? mNumVerts : mVerts.size() );
    mi->SetNbTriangles( triCount );
 
    // Stuff everything into appropriate arrays.
@@ -1407,9 +1407,9 @@ void TSMesh::prepOpcodeCollision()
    mOpPoints = pts;
 
    // add the polys...
-   for ( U32 i = 0; i < primitives.size(); i++ )
+   for ( U32 i = 0; i < mPrimitives.size(); i++ )
    {
-      TSDrawPrimitive & draw = primitives[i];
+      TSDrawPrimitive & draw = mPrimitives[i];
       const U32 start = draw.start;
 
       AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" );
@@ -1467,7 +1467,7 @@ void TSMesh::prepOpcodeCollision()
       }
       else
       {
-         pts[i].Set( verts[i].x, verts[i].y, verts[i].z );
+         pts[i].Set( mVerts[i].x, mVerts[i].y, mVerts[i].z );
       }
    }
 

+ 177 - 177
Engine/source/ts/tsMesh.cpp

@@ -122,7 +122,7 @@ void TSMesh::innerRender( TSVertexBufferHandle &vb, GFXPrimitiveBufferHandle &pb
    GFX->setVertexBuffer( vb );
    GFX->setPrimitiveBuffer( pb );
    
-   for( U32 p = 0; p < primitives.size(); p++ )
+   for( U32 p = 0; p < mPrimitives.size(); p++ )
       GFX->drawPrimitive( p );
 }
 
@@ -223,9 +223,9 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata,
    // NOTICE: SFXBB is removed and refraction is disabled!
    //coreRI->backBuffTex = GFX->getSfxBackBuffer();
 
-   for ( S32 i = 0; i < primitives.size(); i++ )
+   for ( S32 i = 0; i < mPrimitives.size(); i++ )
    {
-      const TSDrawPrimitive &draw = primitives[i];
+      const TSDrawPrimitive &draw = mPrimitives[i];
 
       // We need to have a material.
       if ( draw.matIndex & TSDrawPrimitive::NoMaterial )
@@ -253,7 +253,7 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata,
 #ifndef TORQUE_OS_MAC
 
       // Get the instancing material if this mesh qualifies.
-      if ( meshType != SkinMeshType && pb->mPrimitiveArray[i].numVertices < smMaxInstancingVerts )
+      if (mMeshType != SkinMeshType && pb->mPrimitiveArray[i].numVertices < smMaxInstancingVerts )
          if (matInst && !matInst->getFeatures().hasFeature(MFT_HardwareSkinning))
             matInst = InstancingMaterialHook::getInstancingMat( matInst );
 
@@ -293,13 +293,13 @@ const Point3F * TSMesh::getNormals( S32 firstVert )
    if ( getFlags( UseEncodedNormals ) )
    {
       gNormalStore.setSize( vertsPerFrame );
-      for ( S32 i = 0; i < encodedNorms.size(); i++ )
-         gNormalStore[i] = decodeNormal( encodedNorms[ i + firstVert ] );
+      for ( S32 i = 0; i < mEncodedNorms.size(); i++ )
+         gNormalStore[i] = decodeNormal(mEncodedNorms[ i + firstVert ] );
 
       return gNormalStore.address();
    }
 
-   return &norms[firstVert];
+   return &mNorms[firstVert];
 }
 
 //-----------------------------------------------------
@@ -352,28 +352,28 @@ bool TSMesh::buildPolyList( S32 frame, AbstractPolyList *polyList, U32 &surfaceK
             {
                // Don't use vertex() method as we want to retain the original indices
                OptimizedPolyList::VertIndex vert;
-               vert.vertIdx   = opList->insertPoint( verts[ i + firstVert ] );
-               vert.normalIdx = opList->insertNormal( norms[ i + firstVert ] );
-               vert.uv0Idx    = opList->insertUV0( tverts[ i + firstVert ] );
+               vert.vertIdx   = opList->insertPoint( mVerts[ i + firstVert ] );
+               vert.normalIdx = opList->insertNormal( mNorms[ i + firstVert ] );
+               vert.uv0Idx    = opList->insertUV0( mTverts[ i + firstVert ] );
                if ( hasTVert2 )
-                  vert.uv1Idx = opList->insertUV1( tverts2[ i + firstVert ] );
+                  vert.uv1Idx = opList->insertUV1(mTverts[ i + firstVert ] );
 
                opList->mVertexList.push_back( vert );
             }
          }
          else
          {
-            base = polyList->addPointAndNormal( verts[firstVert], norms[firstVert] );
+            base = polyList->addPointAndNormal( mVerts[firstVert], mNorms[firstVert] );
             for ( i = 1; i < vertsPerFrame; i++ )
-               polyList->addPointAndNormal( verts[ i + firstVert ], norms[ i + firstVert ] );
+               polyList->addPointAndNormal(mVerts[ i + firstVert ], mNorms[ i + firstVert ] );
          }
       }
    }
 
    // add the polys...
-   for ( i = 0; i < primitives.size(); i++ )
+   for ( i = 0; i < mPrimitives.size(); i++ )
    {
-      TSDrawPrimitive & draw = primitives[i];
+      TSDrawPrimitive & draw = mPrimitives[i];
       U32 start = draw.start;
 
       AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" );
@@ -440,9 +440,9 @@ bool TSMesh::getFeatures( S32 frame, const MatrixF& mat, const VectorF&, ConvexF
    }
 
    // add the polys...
-   for ( i = 0; i < primitives.size(); i++ )
+   for ( i = 0; i < mPrimitives.size(); i++ )
    {
-      TSDrawPrimitive & draw = primitives[i];
+      TSDrawPrimitive & draw = mPrimitives[i];
       U32 start = draw.start;
 
       AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" );
@@ -627,7 +627,7 @@ void TSMesh::support( S32 frame, const Point3F &v, F32 *currMaxDP, Point3F *curr
 
 bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList* materials )
 {
-   if ( planeNormals.empty() )
+   if ( mPlaneNormals.empty() )
       buildConvexHull(); // if haven't done it yet...
 
    // Keep track of startTime and endTime.  They start out at just under 0 and just over 1, respectively.
@@ -657,15 +657,15 @@ bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, Ray
    S32 * pplane = &curPlane;
    bool * pfound = &found;
 
-   S32 startPlane = frame * planesPerFrame;
-   for ( S32  i = startPlane; i < startPlane + planesPerFrame; i++ )
+   S32 startPlane = frame * mPlanesPerFrame;
+   for ( S32  i = startPlane; i < startPlane + mPlanesPerFrame; i++ )
    {
       // if start & end outside, no collision
       // if start & end inside, continue
       // if start outside, end inside, or visa versa, find intersection of line with plane
       //    then update intersection of line with hull (using startTime and endTime)
-      F32 dot1 = mDot( planeNormals[i], start ) - planeConstants[i];
-      F32 dot2 = mDot( planeNormals[i], end) - planeConstants[i];
+      F32 dot1 = mDot(mPlaneNormals[i], start ) - mPlaneConstants[i];
+      F32 dot2 = mDot(mPlaneNormals[i], end) - mPlaneConstants[i];
       if ( dot1 * dot2 > 0.0f )
       {
          // same side of the plane...which side -- dot==0 considered inside
@@ -747,10 +747,10 @@ bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, Ray
    // setup rayInfo
    if ( found && rayInfo )
    {
-      curMaterial       = planeMaterials[ curPlane - startPlane ];
+      curMaterial       = mPlaneMaterials[ curPlane - startPlane ];
 
       rayInfo->t        = (F32)startNum/(F32)startDen; // finally divide...
-      rayInfo->normal   = planeNormals[curPlane];
+      rayInfo->normal   = mPlaneNormals[curPlane];
 
       if (materials && materials->size() > 0)
          rayInfo->material = materials->getMaterialInst( curMaterial );
@@ -785,9 +785,9 @@ bool TSMesh::castRayRendered( S32 frame, const Point3F & start, const Point3F &
    BaseMatInstance* bestMaterial = NULL;
 	Point3F dir = end - start;
 
-   for ( S32 i = 0; i < primitives.size(); i++ )
+   for ( S32 i = 0; i < mPrimitives.size(); i++ )
    {
-      TSDrawPrimitive & draw = primitives[i];
+      TSDrawPrimitive & draw = mPrimitives[i];
       U32 drawStart = draw.start;
 
       AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::castRayRendered (1)" );
@@ -927,35 +927,35 @@ bool TSMesh::addToHull( U32 idx0, U32 idx1, U32 idx2 )
 
    normal.normalize();
    F32 k = mDot( normal, mVertexData.getBase(idx0).vert() );
-   for ( S32 i = 0; i < planeNormals.size(); i++ ) 
+   for ( S32 i = 0; i < mPlaneNormals.size(); i++ )
    {
-      if ( mDot( planeNormals[i], normal ) > 0.99f && mFabs( k-planeConstants[i] ) < 0.01f )
+      if ( mDot(mPlaneNormals[i], normal ) > 0.99f && mFabs( k- mPlaneConstants[i] ) < 0.01f )
          return false;          // this is a repeat...
    }
    // new plane, add it to the list...
-   planeNormals.push_back( normal );
-   planeConstants.push_back( k );
+   mPlaneNormals.push_back( normal );
+   mPlaneConstants.push_back( k );
    return true;
 }
 
 bool TSMesh::buildConvexHull()
 {
    // already done, return without error
-   if ( planeNormals.size() )
+   if (mPlaneNormals.size() )
       return true;
 
    bool error = false;
 
    // should probably only have 1 frame, but just in case...
-   planesPerFrame = 0;
+   mPlanesPerFrame = 0;
    S32 frame, i, j;
    for ( frame = 0; frame < numFrames; frame++ )
    {
       S32 firstVert  = vertsPerFrame * frame;
-      S32 firstPlane = planeNormals.size();
-      for ( i = 0; i < primitives.size(); i++ )
+      S32 firstPlane = mPlaneNormals.size();
+      for ( i = 0; i < mPrimitives.size(); i++ )
       {
-         TSDrawPrimitive & draw = primitives[i];
+         TSDrawPrimitive & draw = mPrimitives[i];
          U32 start = draw.start;
 
          AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildConvexHull (1)" );
@@ -967,7 +967,7 @@ bool TSMesh::buildConvexHull()
                if ( addToHull(   mIndices[start + j + 0] + firstVert, 
                                  mIndices[start + j + 1] + firstVert, 
                                  mIndices[start + j + 2] + firstVert ) && frame == 0 )
-                  planeMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask );
+				   mPlaneMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask );
          }
          else
          {
@@ -984,51 +984,51 @@ bool TSMesh::buildConvexHull()
                nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1 );
                idx2 = mIndices[start + j] + firstVert;
                if ( addToHull( idx0, idx1, idx2 ) && frame == 0 )
-                  planeMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask );
+				   mPlaneMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask );
             }
          }
       }
       // make sure all the verts on this frame are inside all the planes
       for ( i = 0; i < vertsPerFrame; i++ )
-         for ( j = firstPlane; j < planeNormals.size(); j++ )
-            if ( mDot( mVertexData.getBase(firstVert + i).vert(), planeNormals[j] ) - planeConstants[j] < 0.01 ) // .01 == a little slack
+         for ( j = firstPlane; j < mPlaneNormals.size(); j++ )
+            if ( mDot( mVertexData.getBase(firstVert + i).vert(), mPlaneNormals[j] ) - mPlaneConstants[j] < 0.01 ) // .01 == a little slack
                error = true;
 
       if ( frame == 0 )
-         planesPerFrame = planeNormals.size();
+		  mPlanesPerFrame = mPlaneNormals.size();
 
-      if ( (frame + 1) * planesPerFrame != planeNormals.size() )
+      if ( (frame + 1) * mPlanesPerFrame != mPlaneNormals.size() )
       {
          // eek, not all frames have same number of planes...
-         while ( (frame + 1) * planesPerFrame > planeNormals.size() )
+         while ( (frame + 1) * mPlanesPerFrame > mPlaneNormals.size() )
          {
             // we're short, duplicate last plane till we match
-            U32 sz = planeNormals.size();
-            planeNormals.increment();
-            planeNormals.last() = planeNormals[sz-1];
-            planeConstants.increment();
-            planeConstants.last() = planeConstants[sz-1];
+            U32 sz = mPlaneNormals.size();
+			mPlaneNormals.increment();
+			mPlaneNormals.last() = mPlaneNormals[sz-1];
+			mPlaneConstants.increment();
+			mPlaneConstants.last() = mPlaneConstants[sz-1];
          }
-         while ( (frame + 1) * planesPerFrame < planeNormals.size() )
+         while ( (frame + 1) * mPlanesPerFrame < mPlaneNormals.size() )
          {
             // harsh -- last frame has more than other frames
             // duplicate last plane in each frame
             for ( S32 k = frame - 1; k >= 0; k-- )
             {
-               planeNormals.insert( k * planesPerFrame + planesPerFrame );
-               planeNormals[k * planesPerFrame + planesPerFrame] = planeNormals[k * planesPerFrame + planesPerFrame - 1];
-               planeConstants.insert( k * planesPerFrame + planesPerFrame );
-               planeConstants[k * planesPerFrame + planesPerFrame] = planeConstants[k * planesPerFrame + planesPerFrame - 1];
+				mPlaneNormals.insert( k * mPlanesPerFrame + mPlanesPerFrame );
+				mPlaneNormals[k * mPlanesPerFrame + mPlanesPerFrame] = mPlaneNormals[k * mPlanesPerFrame + mPlanesPerFrame - 1];
+				mPlaneConstants.insert( k * mPlanesPerFrame + mPlanesPerFrame );
+				mPlaneConstants[k * mPlanesPerFrame + mPlanesPerFrame] = mPlaneConstants[k * mPlanesPerFrame + mPlanesPerFrame - 1];
                if ( k == 0 )
                {
-                  planeMaterials.increment();
-                  planeMaterials.last() = planeMaterials[planeMaterials.size() - 2];
+				   mPlaneMaterials.increment();
+				   mPlaneMaterials.last() = mPlaneMaterials[mPlaneMaterials.size() - 2];
                }
             }
-            planesPerFrame++;
+			mPlanesPerFrame++;
          }
       }
-      AssertFatal( (frame + 1) * planesPerFrame == planeNormals.size(),"TSMesh::buildConvexHull (3)" );
+      AssertFatal( (frame + 1) * mPlanesPerFrame == mPlaneNormals.size(),"TSMesh::buildConvexHull (3)" );
    }
    return !error;
 }
@@ -1051,7 +1051,7 @@ void TSMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 frame,
 
    AssertFatal(!mVertexData.isReady()  || (mVertexData.isReady() && mNumVerts == mVertexData.size() && mNumVerts == vertsPerFrame), "vertex number mismatch");
 
-   if(verts.size() == 0 && mVertexData.isReady() && mVertexData.size() > 0)
+   if(mVerts.size() == 0 && mVertexData.isReady() && mVertexData.size() > 0)
    {
       baseVert = &mVertexData.getBase(0).vert();
       stride = mVertexData.vertSize();
@@ -1066,11 +1066,11 @@ void TSMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 frame,
    }
    else
    {
-      baseVert = verts.address();
+      baseVert = mVerts.address();
       stride = sizeof(Point3F);
 
       if ( frame < 0 )
-         numVerts = verts.size();
+         numVerts = mVerts.size();
       else
       {
          baseVert += frame * vertsPerFrame;
@@ -1131,22 +1131,22 @@ void TSMesh::computeBounds( const Point3F *v, S32 numVerts, S32 stride, const Ma
 S32 TSMesh::getNumPolys() const
 {
    S32 count = 0;
-   for ( S32 i = 0; i < primitives.size(); i++ )
+   for ( S32 i = 0; i < mPrimitives.size(); i++ )
    {
-      switch (primitives[i].matIndex & TSDrawPrimitive::TypeMask)
+      switch (mPrimitives[i].matIndex & TSDrawPrimitive::TypeMask)
       {
          case TSDrawPrimitive::Triangles:
-            count += primitives[i].numElements / 3;
+            count += mPrimitives[i].numElements / 3;
             break;
 
          case TSDrawPrimitive::Fan:
-            count += primitives[i].numElements - 2;
+            count += mPrimitives[i].numElements - 2;
             break;
 
          case TSDrawPrimitive::Strip:
             // Don't count degenerate triangles
-            for ( S32 j = primitives[i].start;
-                  j < primitives[i].start+primitives[i].numElements-2;
+            for ( S32 j = mPrimitives[i].start;
+                  j < mPrimitives[i].start+ mPrimitives[i].numElements-2;
                   j++ )
             {
                if ((mIndices[j] != mIndices[j+1]) &&
@@ -1162,11 +1162,11 @@ S32 TSMesh::getNumPolys() const
 
 //-----------------------------------------------------
 
-TSMesh::TSMesh() : meshType( StandardMeshType )
+TSMesh::TSMesh() : mMeshType( StandardMeshType )
 {
-   VECTOR_SET_ASSOCIATION( planeNormals );
-   VECTOR_SET_ASSOCIATION( planeConstants );
-   VECTOR_SET_ASSOCIATION( planeMaterials );
+   VECTOR_SET_ASSOCIATION(mPlaneNormals );
+   VECTOR_SET_ASSOCIATION(mPlaneConstants );
+   VECTOR_SET_ASSOCIATION(mPlaneMaterials );
    mParentMesh = -1;
 
    mOptTree = NULL;
@@ -1181,7 +1181,7 @@ TSMesh::TSMesh() : meshType( StandardMeshType )
    mVertSize = 0;
    mVertOffset = 0;
 
-   parentMeshObject = NULL;
+   mParentMeshObject = NULL;
 }
 
 //-----------------------------------------------------
@@ -1326,8 +1326,8 @@ void TSSkinMesh::createSkinBatchData()
    }
    else
    {
-      batchData.initialNorms = norms;
-      batchData.initialVerts = verts;
+      batchData.initialNorms = mNorms;
+      batchData.initialVerts = mVerts;
    }
 
    // Build the batch operations
@@ -1546,10 +1546,10 @@ void TSSkinMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 fra
 {
    TORQUE_UNUSED(frame);
 
-   if (verts.size() != 0)
+   if (mVerts.size() != 0)
    {
       // Use unskinned verts
-      TSMesh::computeBounds( verts.address(), verts.size(), sizeof(Point3F), transform, bounds, center, radius );
+      TSMesh::computeBounds(mVerts.address(), mVerts.size(), sizeof(Point3F), transform, bounds, center, radius );
    }
    else if (frame <= 0 && batchData.initialVerts.size() > 0)
    {
@@ -2368,10 +2368,10 @@ void TSMesh::dumpPrimitives(U32 startVertex, U32 startIndex, GFXPrimitive *piArr
    // go through and create PrimitiveInfo array
    GFXPrimitive pInfo;
 
-   U32 primitivesSize = primitives.size();
+   U32 primitivesSize = mPrimitives.size();
    for (U32 i = 0; i < primitivesSize; i++)
    {
-      const TSDrawPrimitive & draw = primitives[i];
+      const TSDrawPrimitive & draw = mPrimitives[i];
 
       GFXPrimitiveType drawType = getDrawType(draw.matIndex >> 30);
 
@@ -2436,21 +2436,21 @@ void TSMesh::assemble( bool skip )
 
    S32 numVerts = tsalloc.get32();
    S32 *ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smVertsList.address(), skip );
-   verts.set( (Point3F*)ptr32, numVerts );
+   mVerts.set( (Point3F*)ptr32, numVerts );
 
    S32 numTVerts = tsalloc.get32();
    ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVertsList.address(), skip );
-   tverts.set( (Point2F*)ptr32, numTVerts );
+   mTverts.set( (Point2F*)ptr32, numTVerts );
 
    if ( TSShape::smReadVersion > 25 )
    {
       numTVerts = tsalloc.get32();
       ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVerts2List.address(), skip );
-      tverts2.set( (Point2F*)ptr32, numTVerts );
+      mTverts2.set( (Point2F*)ptr32, numTVerts );
 
       S32 numVColors = tsalloc.get32();
       ptr32 = getSharedData32(mParentMesh, numVColors, (S32**)smColorsList.address(), skip );
-      colors.set( (ColorI*)ptr32, numVColors );
+      mColors.set( (ColorI*)ptr32, numVColors );
    }
 
    S8 *ptr8;
@@ -2459,27 +2459,27 @@ void TSMesh::assemble( bool skip )
       // we have encoded normals and we want to use them...
       if (mParentMesh < 0 )
          tsalloc.getPointer32( numVerts * 3 ); // adva  nce past norms, don't use
-      norms.set( NULL, 0 );
+      mNorms.set( NULL, 0 );
 
       ptr8 = getSharedData8(mParentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip );
-      encodedNorms.set( ptr8, numVerts );
+      mEncodedNorms.set( ptr8, numVerts );
    }
    else if ( TSShape::smReadVersion > 21 )
    {
       // we have encoded normals but we don't want to use them...
       ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip );
-      norms.set( (Point3F*)ptr32, numVerts );
+      mNorms.set( (Point3F*)ptr32, numVerts );
 
       if (mParentMesh < 0 )
          tsalloc.getPointer8( numVerts ); // advance past encoded normls, don't use
-      encodedNorms.set( NULL, 0 );
+      mEncodedNorms.set( NULL, 0 );
    }
    else
    {
       // no encoded normals...
       ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip );
-      norms.set( (Point3F*)ptr32, numVerts );
-      encodedNorms.set( NULL, 0 );
+      mNorms.set( (Point3F*)ptr32, numVerts );
+      mEncodedNorms.set( NULL, 0 );
    }
 
    // copy the primitives and indices...how we do this depends on what
@@ -2553,7 +2553,7 @@ void TSMesh::assemble( bool skip )
    AssertFatal(chkPrim==szPrimOut && chkInd==szIndOut,"TSMesh::primitive conversion");
 
    // store output
-   primitives.set(primOut, szPrimOut);
+   mPrimitives.set(primOut, szPrimOut);
    mIndices.set(indOut, szIndOut);
 
    // delete temporary arrays if necessary
@@ -2569,7 +2569,7 @@ void TSMesh::assemble( bool skip )
 
    vertsPerFrame = tsalloc.get32();
    U32 flags = (U32)tsalloc.get32();
-   if ( encodedNorms.size() )
+   if ( mEncodedNorms.size() )
       flags |= UseEncodedNormals;
    
    setFlags( flags );
@@ -2577,9 +2577,9 @@ void TSMesh::assemble( bool skip )
    // Set color & tvert2 flags if we have an old version
    if (TSShape::smReadVersion < 27)
    {
-      if (colors.size() > 0) setFlags(HasColor);
-      if (tverts2.size() > 0) setFlags(HasTVert2);
-      mNumVerts = verts.size();
+      if (mColors.size() > 0) setFlags(HasColor);
+      if (mTverts2.size() > 0) setFlags(HasTVert2);
+      mNumVerts = mVerts.size();
    }
 
    tsalloc.checkGuard();
@@ -2587,7 +2587,7 @@ void TSMesh::assemble( bool skip )
    if ( tsalloc.allocShape32( 0 ) && TSShape::smReadVersion < 19 )
       computeBounds(); // only do this if we copied the data...
 
-   createTangents(verts, norms);
+   createTangents(mVerts, mNorms);
 }
 
 void TSMesh::disassemble()
@@ -2636,39 +2636,39 @@ void TSMesh::disassemble()
    else
    {
       // verts...
-      tsalloc.set32(verts.size());
+      tsalloc.set32(mVerts.size());
       if (mParentMesh < 0)
-         tsalloc.copyToBuffer32((S32*)verts.address(), 3 * verts.size()); // if no parent mesh, then save off our verts
+         tsalloc.copyToBuffer32((S32*)mVerts.address(), 3 * mVerts.size()); // if no parent mesh, then save off our verts
 
       // tverts...
-      tsalloc.set32(tverts.size());
+      tsalloc.set32(mTverts.size());
       if (mParentMesh < 0)
-         tsalloc.copyToBuffer32((S32*)tverts.address(), 2 * tverts.size()); // if no parent mesh, then save off our tverts
+         tsalloc.copyToBuffer32((S32*)mTverts.address(), 2 * mTverts.size()); // if no parent mesh, then save off our tverts
 
       if (TSShape::smVersion > 25)
       {
          // tverts2...
-         tsalloc.set32(tverts2.size());
+         tsalloc.set32(mTverts2.size());
          if (mParentMesh < 0)
-            tsalloc.copyToBuffer32((S32*)tverts2.address(), 2 * tverts2.size()); // if no parent mesh, then save off our tverts
+            tsalloc.copyToBuffer32((S32*)mTverts2.address(), 2 * mTverts2.size()); // if no parent mesh, then save off our tverts
 
                                                                                  // colors
-         tsalloc.set32(colors.size());
+         tsalloc.set32(mColors.size());
          if (mParentMesh < 0)
-            tsalloc.copyToBuffer32((S32*)colors.address(), colors.size()); // if no parent mesh, then save off our tverts
+            tsalloc.copyToBuffer32((S32*)mColors.address(), mColors.size()); // if no parent mesh, then save off our tverts
       }
 
       // norms...
       if (mParentMesh < 0) // if no parent mesh, then save off our norms
-         tsalloc.copyToBuffer32((S32*)norms.address(), 3 * norms.size()); // norms.size()==verts.size() or error...
+         tsalloc.copyToBuffer32((S32*)mNorms.address(), 3 * mNorms.size()); // norms.size()==verts.size() or error...
 
                                                                           // encoded norms...
       if (mParentMesh < 0)
       {
          // if no parent mesh, compute encoded normals and copy over
-         for (S32 i = 0; i < norms.size(); i++)
+         for (S32 i = 0; i < mNorms.size(); i++)
          {
-            U8 normIdx = encodedNorms.size() ? encodedNorms[i] : encodeNormal(norms[i]);
+            U8 normIdx = mEncodedNorms.size() ? mEncodedNorms[i] : encodeNormal(mNorms[i]);
             tsalloc.copyToBuffer8((S8*)&normIdx, 1);
          }
       }
@@ -2677,14 +2677,14 @@ void TSMesh::disassemble()
    // optimize triangle draw order during disassemble
    {
       FrameTemp<TriListOpt::IndexType> tmpIdxs(mIndices.size());
-      for ( S32 i = 0; i < primitives.size(); i++ )
+      for ( S32 i = 0; i < mPrimitives.size(); i++ )
       {
-         const TSDrawPrimitive& prim = primitives[i];
+         const TSDrawPrimitive& prim = mPrimitives[i];
 
          // only optimize triangle lists (strips and fans are assumed to be already optimized)
          if ( (prim.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles )
          {
-            TriListOpt::OptimizeTriangleOrdering(verts.size(), prim.numElements,
+            TriListOpt::OptimizeTriangleOrdering(mVerts.size(), prim.numElements,
 				mIndices.address() + prim.start, tmpIdxs.address());
             dCopyArray(mIndices.address() + prim.start, tmpIdxs.address(),
                prim.numElements);
@@ -2695,8 +2695,8 @@ void TSMesh::disassemble()
    if (TSShape::smVersion > 25)
    {
       // primitives...
-      tsalloc.set32( primitives.size() );
-      tsalloc.copyToBuffer32((S32*)primitives.address(),3*primitives.size());
+      tsalloc.set32(mPrimitives.size() );
+      tsalloc.copyToBuffer32((S32*)mPrimitives.address(),3* mPrimitives.size());
 
       // indices...
       tsalloc.set32(mIndices.size());
@@ -2705,15 +2705,15 @@ void TSMesh::disassemble()
    else
    {
       // primitives
-      tsalloc.set32( primitives.size() );
-      for (S32 i=0; i<primitives.size(); i++)
+      tsalloc.set32(mPrimitives.size() );
+      for (S32 i=0; i<mPrimitives.size(); i++)
       {
-         S16 start = (S16)primitives[i].start;
-         S16 numElements = (S16)primitives[i].numElements;
+         S16 start = (S16)mPrimitives[i].start;
+         S16 numElements = (S16)mPrimitives[i].numElements;
 
          tsalloc.copyToBuffer16(&start, 1);
          tsalloc.copyToBuffer16(&numElements, 1);
-         tsalloc.copyToBuffer32(&(primitives[i].matIndex), 1);
+         tsalloc.copyToBuffer32(&(mPrimitives[i].matIndex), 1);
       }
 
       // indices
@@ -2772,7 +2772,7 @@ void TSSkinMesh::assemble( bool skip )
          batchData.initialNorms.set(NULL, 0);
 
          ptr8 = getSharedData8(mParentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip);
-         encodedNorms.set(ptr8, numVerts);
+         mEncodedNorms.set(ptr8, numVerts);
          // Note: we don't set the encoded normals flag because we handle them in updateSkin and
          //       hide the fact that we are using them from base class (TSMesh)
       }
@@ -2785,33 +2785,33 @@ void TSSkinMesh::assemble( bool skip )
          if (mParentMesh < 0)
             tsalloc.getPointer8(numVerts); // advance past encoded normls, don't use
 
-         encodedNorms.set(NULL, 0);
+		 mEncodedNorms.set(NULL, 0);
       }
       else
       {
          // no encoded normals...
          ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip);
          batchData.initialNorms.set((Point3F*)ptr32, numVerts);
-         encodedNorms.set(NULL, 0);
+		 mEncodedNorms.set(NULL, 0);
       }
 
       // Sometimes we'll have a mesh with 0 verts but initialVerts is set,
       // so set these accordingly
-      if (verts.size() == 0)
+      if (mVerts.size() == 0)
       {
-         verts = batchData.initialVerts;
+		  mVerts = batchData.initialVerts;
       }
 
-      if (norms.size() == 0)
+      if (mNorms.size() == 0)
       {
-         norms = batchData.initialNorms;
+		  mNorms = batchData.initialNorms;
       }
    }
    else
    {
       // Set from the mesh data
-      batchData.initialVerts = verts;
-      batchData.initialNorms = norms;
+      batchData.initialVerts = mVerts;
+      batchData.initialNorms = mNorms;
    }
 
    sz = tsalloc.get32();
@@ -2885,15 +2885,15 @@ void TSSkinMesh::disassemble()
       // if we have no parent mesh, then save off our verts & norms
       if (mParentMesh < 0)
       {
-         tsalloc.copyToBuffer32((S32*)verts.address(), 3 * verts.size());
+         tsalloc.copyToBuffer32((S32*)mVerts.address(), 3 * mVerts.size());
 
          // no longer do this here...let tsmesh handle this
-         tsalloc.copyToBuffer32((S32*)norms.address(), 3 * norms.size());
+         tsalloc.copyToBuffer32((S32*)mNorms.address(), 3 * mNorms.size());
 
          // if no parent mesh, compute encoded normals and copy over
-         for (S32 i = 0; i < norms.size(); i++)
+         for (S32 i = 0; i < mNorms.size(); i++)
          {
-            U8 normIdx = encodedNorms.size() ? encodedNorms[i] : encodeNormal(norms[i]);
+            U8 normIdx = mEncodedNorms.size() ? mEncodedNorms[i] : encodeNormal(mNorms[i]);
             tsalloc.copyToBuffer8((S8*)&normIdx, 1);
          }
       }
@@ -2939,7 +2939,7 @@ void TSSkinMesh::disassemble()
 
 TSSkinMesh::TSSkinMesh()
 {
-   meshType = SkinMeshType;
+   mMeshType = SkinMeshType;
    batchData.initialized = false;
    maxBones = -1;
 }
@@ -2958,9 +2958,9 @@ inline void TSMesh::findTangent( U32 index1,
    const Point3F &v2 = _verts[index2];
    const Point3F &v3 = _verts[index3];
 
-   const Point2F &w1 = tverts[index1];
-   const Point2F &w2 = tverts[index2];
-   const Point2F &w3 = tverts[index3];
+   const Point2F &w1 = mTverts[index1];
+   const Point2F &w2 = mTverts[index2];
+   const Point2F &w3 = mTverts[index3];
 
    F32 x1 = v2.x - v1.x;
    F32 x2 = v3.x - v1.x;
@@ -3025,11 +3025,11 @@ void TSMesh::createTangents(const Vector<Point3F> &_verts, const Vector<Point3F>
    Point3F *tan1 = tan0.address() + numVerts;
    dMemset( tan0.address(), 0, sizeof(Point3F) * 2 * numVerts );
    
-   U32   numPrimatives = primitives.size();
+   U32   numPrimatives = mPrimitives.size();
 
    for (S32 i = 0; i < numPrimatives; i++ )
    {
-      const TSDrawPrimitive & draw = primitives[i];
+      const TSDrawPrimitive & draw = mPrimitives[i];
       GFXPrimitiveType drawType = getDrawType( draw.matIndex >> 30 );
 
       U32 p1Index = 0;
@@ -3066,7 +3066,7 @@ void TSMesh::createTangents(const Vector<Point3F> &_verts, const Vector<Point3F>
       }
    }
 
-   tangents.setSize( numVerts );
+   mTangents.setSize( numVerts );
 
    // fill out final info from accumulated basis data
    for( U32 i = 0; i < numVerts; i++ )
@@ -3077,12 +3077,12 @@ void TSMesh::createTangents(const Vector<Point3F> &_verts, const Vector<Point3F>
 
       Point3F tempPt = t - n * mDot( n, t );
       tempPt.normalize();
-      tangents[i] = tempPt;
+	  mTangents[i] = tempPt;
 
       Point3F cp;
       mCross( n, t, &cp );
       
-      tangents[i].w = (mDot( cp, b ) < 0.0f) ? -1.0f : 1.0f;
+	  mTangents[i].w = (mDot( cp, b ) < 0.0f) ? -1.0f : 1.0f;
    }
 }
 
@@ -3090,7 +3090,7 @@ void TSMesh::convertToVertexData()
 {
    if (!mVertexData.isReady())
    {
-      _convertToVertexData(mVertexData, verts, norms);
+      _convertToVertexData(mVertexData, mVerts, mNorms);
    }
 }
 
@@ -3111,39 +3111,39 @@ void TSSkinMesh::convertToVertexData()
 
 void TSMesh::copySourceVertexDataFrom(const TSMesh* srcMesh)
 {
-   verts = srcMesh->verts;
-   tverts = srcMesh->tverts;
-   norms = srcMesh->norms;
-   colors = srcMesh->colors;
-   tverts2 = srcMesh->tverts2;
+   mVerts = srcMesh->mVerts;
+   mTverts = srcMesh->mTverts;
+   mNorms = srcMesh->mNorms;
+   mColors = srcMesh->mColors;
+   mTverts2 = srcMesh->mTverts2;
 
-   if (verts.size() == 0)
+   if (mVerts.size() == 0)
    {
       bool hasTVert2 = srcMesh->getHasTVert2();
       bool hasColor = srcMesh->getHasColor();
 
-      verts.setSize(srcMesh->mNumVerts);
-      tverts.setSize(srcMesh->mNumVerts);
-      norms.setSize(srcMesh->mNumVerts);
+	  mVerts.setSize(srcMesh->mNumVerts);
+      mTverts.setSize(srcMesh->mNumVerts);
+      mNorms.setSize(srcMesh->mNumVerts);
 
       if (hasColor)
-         colors.setSize(mNumVerts);
+         mColors.setSize(mNumVerts);
       if (hasTVert2)
-         tverts2.setSize(mNumVerts);
+         mTverts2.setSize(mNumVerts);
 
       // Fill arrays
       for (U32 i = 0; i < mNumVerts; i++)
       {
          const __TSMeshVertexBase &cv = srcMesh->mVertexData.getBase(i);
          const __TSMeshVertex_3xUVColor &cvc = srcMesh->mVertexData.getColor(i);
-         verts[i] = cv.vert();
-         tverts[i] = cv.tvert();
-         norms[i] = cv.normal();
+         mVerts[i] = cv.vert();
+         mTverts[i] = cv.tvert();
+         mNorms[i] = cv.normal();
 
          if (hasColor)
-            cvc.color().getColor(&colors[i]);
+            cvc.color().getColor(&mColors[i]);
          if (hasTVert2)
-            tverts2[i] = cvc.tvert2();
+            mTverts2[i] = cvc.tvert2();
       }
    }
 }
@@ -3173,21 +3173,21 @@ void TSSkinMesh::copySourceVertexDataFrom(const TSMesh* srcMesh)
 
 U32 TSMesh::getNumVerts()
 {
-   return mVertexData.isReady() ? mNumVerts : verts.size();
+   return mVertexData.isReady() ? mNumVerts : mVerts.size();
 }
 
 void TSMesh::_convertToVertexData(TSMeshVertexArray &outArray, const Vector<Point3F> &_verts, const Vector<Point3F> &_norms)
 {
    // Update tangents list
-   createTangents(verts, norms);
+   createTangents(mVerts, mNorms);
 
    AssertFatal(_verts.size() == mNumVerts, "vert count mismatch");
-   AssertFatal(!getHasColor() || colors.size() == _verts.size(), "Vector of color elements should be the same size as other vectors");
-   AssertFatal(!getHasTVert2() || tverts2.size() == _verts.size(), "Vector of tvert2 elements should be the same size as other vectors");
+   AssertFatal(!getHasColor() || mColors.size() == _verts.size(), "Vector of color elements should be the same size as other vectors");
+   AssertFatal(!getHasTVert2() || mTverts2.size() == _verts.size(), "Vector of tvert2 elements should be the same size as other vectors");
 
    AssertFatal(!outArray.isReady(), "Mesh already converted to aligned data! Re-check code!");
    AssertFatal(_verts.size() == _norms.size() &&
-      _verts.size() == tangents.size(),
+      _verts.size() == mTangents.size(),
       "Vectors: verts, norms, tangents must all be the same size");
    AssertFatal(mVertSize == outArray.vertSize(), "Size inconsistency");
 
@@ -3206,18 +3206,18 @@ void TSMesh::_convertToVertexData(TSMeshVertexArray &outArray, const Vector<Poin
       __TSMeshVertexBase &v = outArray.getBase(i);
       v.vert(_verts[i]);
       v.normal(_norms[i]);
-      v.tangent(tangents[i]);
+      v.tangent(mTangents[i]);
 
-      if (i < tverts.size())
-         v.tvert(tverts[i]);
+      if (i < mTverts.size())
+         v.tvert(mTverts[i]);
 
       if (hasTVert2 || hasColor)
       {
          __TSMeshVertex_3xUVColor &vc = outArray.getColor(i);
-         if (hasTVert2 && i < tverts2.size())
-            vc.tvert2(tverts2[i]);
-         if (hasColor && i < colors.size())
-            vc.color(colors[i]);
+         if (hasTVert2 && i < mTverts2.size())
+            vc.tvert2(mTverts2[i]);
+         if (hasColor && i < mColors.size())
+            vc.color(mColors[i]);
       }
 
       // NOTE: skin verts are set later on for the skinned mesh, otherwise we'll set the default (i.e. 0) if we need one for a rigid mesh
@@ -3231,7 +3231,7 @@ void TSMesh::_convertToVertexData(TSMeshVertexArray &outArray, const Vector<Poin
 
 void TSMesh::makeEditable()
 {
-   bool hasVerts = verts.size() != 0;
+   bool hasVerts = mVerts.size() != 0;
 
    if(mVertexData.isReady() && !hasVerts)
    {
@@ -3282,7 +3282,7 @@ void TSSkinMesh::addWeightsFromVertexBuffer()
 
 void TSSkinMesh::makeEditable()
 {
-   bool hasVerts = verts.size() != 0;
+   bool hasVerts = mVerts.size() != 0;
 
    // Reconstruct bone mapping
    if (mVertexData.isReady() && !hasVerts)
@@ -3307,36 +3307,36 @@ void TSSkinMesh::makeEditable()
 
 void TSMesh::clearEditable()
 {
-   if (verts.size() == 0)
+   if (mVerts.size() == 0)
       return;
 
-   if (colors.empty())
+   if (mColors.empty())
       clearFlags(HasColor);
    else
       setFlags(HasColor);
 
-   if (tverts2.empty())
+   if (mTverts2.empty())
       clearFlags(HasTVert2);
    else
       setFlags(HasTVert2);
 
-   verts.free_memory();
-   norms.free_memory();
-   tangents.free_memory();
-   tverts.free_memory();
-   tverts2.free_memory();
-   colors.free_memory();
+   mVerts.free_memory();
+   mNorms.free_memory();
+   mTangents.free_memory();
+   mTverts.free_memory();
+   mTverts2.free_memory();
+   mColors.free_memory();
 }
 
 void TSMesh::updateMeshFlags()
 {
    // Make sure flags are correct
-   if (colors.empty())
+   if (mColors.empty())
       clearFlags(HasColor);
    else
       setFlags(HasColor);
 
-   if (tverts2.empty())
+   if (mTverts2.empty())
       clearFlags(HasTVert2);
    else
       setFlags(HasTVert2);

+ 22 - 22
Engine/source/ts/tsMesh.h

@@ -251,7 +251,7 @@ public:
 
 protected:
 
-   U32 meshType;
+   U32 mMeshType;
    Box3F mBounds;
    Point3F mCenter;
    F32 mRadius;
@@ -259,7 +259,7 @@ protected:
 
    const GFXVertexFormat *mVertexFormat;
 
-   TSMesh *parentMeshObject; ///< Current parent object instance
+   TSMesh *mParentMeshObject; ///< Current parent object instance
 
    U32 mPrimBufferOffset;
 
@@ -299,12 +299,12 @@ protected:
       FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals|HasColor|HasTVert2
    };
 
-   U32 getMeshType() const { return meshType & TypeMask; }
-   U32 getHasColor() const { return colors.size() > 0 || meshType & HasColor; }
-   U32 getHasTVert2() const { return tverts2.size() > 0 || meshType & HasTVert2; }
-   void setFlags(U32 flag) { meshType |= flag; }
-   void clearFlags(U32 flag) { meshType &= ~flag; }
-   U32 getFlags( U32 flag = 0xFFFFFFFF ) const { return meshType & flag; }
+   U32 getMeshType() const { return mMeshType & TypeMask; }
+   U32 getHasColor() const { return mColors.size() > 0 || mMeshType & HasColor; }
+   U32 getHasTVert2() const { return mTverts2.size() > 0 || mMeshType & HasTVert2; }
+   void setFlags(U32 flag) { mMeshType |= flag; }
+   void clearFlags(U32 flag) { mMeshType &= ~flag; }
+   U32 getFlags( U32 flag = 0xFFFFFFFF ) const { return mMeshType & flag; }
 
    const Point3F* getNormals( S32 firstVert );
 
@@ -319,34 +319,34 @@ protected:
    /// @name Vertex data
    /// @{
 
-   FreeableVector<Point3F> verts;
-   FreeableVector<Point3F> norms;
-   FreeableVector<Point2F> tverts;
-   FreeableVector<Point4F> tangents;
+   FreeableVector<Point3F> mVerts;
+   FreeableVector<Point3F> mNorms;
+   FreeableVector<Point2F> mTverts;
+   FreeableVector<Point4F> mTangents;
    
    // Optional second texture uvs.
-   FreeableVector<Point2F> tverts2;
+   FreeableVector<Point2F> mTverts2;
 
    // Optional vertex colors data.
-   FreeableVector<ColorI> colors;
+   FreeableVector<ColorI> mColors;
    /// @}
 
-   Vector<TSDrawPrimitive> primitives;
-   Vector<U8> encodedNorms;
+   Vector<TSDrawPrimitive> mPrimitives;
+   Vector<U8> mEncodedNorms;
    Vector<U32> mIndices;
 
    /// billboard data
-   Point3F billboardAxis;
+   Point3F mBillboardAxis;
 
    /// @name Convex Hull Data
    /// Convex hulls are convex (no angles >= 180º) meshes used for collision
    /// @{
 
-   Vector<Point3F> planeNormals;
-   Vector<F32>     planeConstants;
-   Vector<U32>     planeMaterials;
-   S32 planesPerFrame;
-   U32 mergeBufferStart;
+   Vector<Point3F> mPlaneNormals;
+   Vector<F32>     mPlaneConstants;
+   Vector<U32>     mPlaneMaterials;
+   S32 mPlanesPerFrame;
+   U32 mMergeBufferStart;
    /// @}
 
    /// @name Render Methods

+ 34 - 34
Engine/source/ts/tsMeshFit.cpp

@@ -246,9 +246,9 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh )
 {
    // Add indices
    S32 indicesBase = mIndices.size();
-   for ( S32 i = 0; i < mesh->primitives.size(); i++ )
+   for ( S32 i = 0; i < mesh->mPrimitives.size(); i++ )
    {
-      const TSDrawPrimitive& draw = mesh->primitives[i];
+      const TSDrawPrimitive& draw = mesh->mPrimitives[i];
       if ( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles )
       {
          mIndices.merge( &mesh->mIndices[draw.start], draw.numElements );
@@ -282,7 +282,7 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh )
    S32 count, stride;
    U8* pVert;
 
-   if ( mesh->mVertexData.isReady() && mesh->verts.size() == 0 )
+   if ( mesh->mVertexData.isReady() && mesh->mVerts.size() == 0 )
    {
       count = mesh->mVertexData.size();
       stride = mesh->mVertexData.vertSize();
@@ -290,9 +290,9 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh )
    }
    else
    {
-      count = mesh->verts.size();
+      count = mesh->mVerts.size();
       stride = sizeof(Point3F);
-      pVert = (U8*)mesh->verts.address();
+      pVert = (U8*)mesh->mVerts.address();
    }
 
    MatrixF objMat;
@@ -337,12 +337,12 @@ TSMesh* MeshFit::createTriMesh( F32* verts, S32 numVerts, U32* indices, S32 numT
       mesh->mIndices.push_back( indices[i*3 + 1] );
    }
 
-   mesh->verts.set( verts, numVerts );
+   mesh->mVerts.set( verts, numVerts );
 
    // Compute mesh normals
-   mesh->norms.setSize( mesh->verts.size() );
-   for (S32 iNorm = 0; iNorm < mesh->norms.size(); iNorm++)
-      mesh->norms[iNorm] = Point3F::Zero;
+   mesh->mNorms.setSize( mesh->mVerts.size() );
+   for (S32 iNorm = 0; iNorm < mesh->mNorms.size(); iNorm++)
+      mesh->mNorms[iNorm] = Point3F::Zero;
 
    // Sum triangle normals for each vertex
    for (S32 iInd = 0; iInd < mesh->mIndices.size(); iInd += 3)
@@ -352,38 +352,38 @@ TSMesh* MeshFit::createTriMesh( F32* verts, S32 numVerts, U32* indices, S32 numT
       S32 idx1 = mesh->mIndices[iInd + 1];
       S32 idx2 = mesh->mIndices[iInd + 2];
 
-      const Point3F& v0 = mesh->verts[idx0];
-      const Point3F& v1 = mesh->verts[idx1];
-      const Point3F& v2 = mesh->verts[idx2];
+      const Point3F& v0 = mesh->mVerts[idx0];
+      const Point3F& v1 = mesh->mVerts[idx1];
+      const Point3F& v2 = mesh->mVerts[idx2];
 
       Point3F n;
       mCross(v2 - v0, v1 - v0, &n);
       n.normalize();    // remove this to use 'weighted' normals (large triangles will have more effect)
 
-      mesh->norms[idx0] += n;
-      mesh->norms[idx1] += n;
-      mesh->norms[idx2] += n;
+      mesh->mNorms[idx0] += n;
+      mesh->mNorms[idx1] += n;
+      mesh->mNorms[idx2] += n;
    }
 
    // Normalize the vertex normals (this takes care of averaging the triangle normals)
-   for (S32 iNorm = 0; iNorm < mesh->norms.size(); iNorm++)
-      mesh->norms[iNorm].normalize();
+   for (S32 iNorm = 0; iNorm < mesh->mNorms.size(); iNorm++)
+      mesh->mNorms[iNorm].normalize();
 
    // Set some dummy UVs
-   mesh->tverts.setSize( numVerts );
-   for ( S32 j = 0; j < mesh->tverts.size(); j++ )
-      mesh->tverts[j].set( 0, 0 );
+   mesh->mTverts.setSize( numVerts );
+   for ( S32 j = 0; j < mesh->mTverts.size(); j++ )
+      mesh->mTverts[j].set( 0, 0 );
 
    // Add a single triangle-list primitive
-   mesh->primitives.increment();
-   mesh->primitives.last().start = 0;
-   mesh->primitives.last().numElements = mesh->mIndices.size();
-   mesh->primitives.last().matIndex =  TSDrawPrimitive::Triangles |
+   mesh->mPrimitives.increment();
+   mesh->mPrimitives.last().start = 0;
+   mesh->mPrimitives.last().numElements = mesh->mIndices.size();
+   mesh->mPrimitives.last().matIndex =  TSDrawPrimitive::Triangles |
                                        TSDrawPrimitive::Indexed |
                                        TSDrawPrimitive::NoMaterial;
 
-   mesh->createTangents( mesh->verts, mesh->norms );
-   mesh->encodedNorms.set( NULL,0 );
+   mesh->createTangents( mesh->mVerts, mesh->mNorms);
+   mesh->mEncodedNorms.set( NULL,0 );
 
    return mesh;
 }
@@ -404,13 +404,13 @@ void MeshFit::addBox( const Point3F& sides, const MatrixF& mat )
    if ( !mesh )
       return;
 
-   if (mesh->verts.size() > 0)
+   if (mesh->mVerts.size() > 0)
    {
-      for (S32 i = 0; i < mesh->verts.size(); i++)
+      for (S32 i = 0; i < mesh->mVerts.size(); i++)
       {
-         Point3F v = mesh->verts[i];
+         Point3F v = mesh->mVerts[i];
          v.convolve(sides);
-         mesh->verts[i] = v;
+         mesh->mVerts[i] = v;
       }
 
       mesh->mVertexData.setReady(false);
@@ -799,7 +799,7 @@ DefineTSShapeConstructorMethod( addPrimitive, bool, ( const char* meshName, cons
    MatrixF mat( txfm.getMatrix() );
 
    // Transform the mesh vertices
-   if ( mesh->mVertexData.isReady() && mesh->verts.size() == 0 )
+   if ( mesh->mVertexData.isReady() && mesh->mVerts.size() == 0 )
    {
       for (S32 i = 0; i < mesh->mVertexData.size(); i++)
       {
@@ -811,10 +811,10 @@ DefineTSShapeConstructorMethod( addPrimitive, bool, ( const char* meshName, cons
    }
    else
    {
-      for (S32 i = 0; i < mesh->verts.size(); i++)
+      for (S32 i = 0; i < mesh->mVerts.size(); i++)
       {
-         Point3F v(mesh->verts[i]);
-         mat.mulP( v, &mesh->verts[i] );
+         Point3F v(mesh->mVerts[i]);
+         mat.mulP( v, &mesh->mVerts[i] );
       }
    }
 

+ 24 - 24
Engine/source/ts/tsShape.cpp

@@ -592,11 +592,11 @@ void TSShape::initObjects()
 
       if (mesh->mParentMesh >= 0 && mesh->mParentMesh < meshes.size())
       {
-         mesh->parentMeshObject = meshes[mesh->mParentMesh];
+         mesh->mParentMeshObject = meshes[mesh->mParentMesh];
       }
       else
       {
-         mesh->parentMeshObject = NULL;
+         mesh->mParentMeshObject = NULL;
       }
 
       mesh->mVertexFormat = &mVertexFormat;
@@ -623,7 +623,7 @@ void TSShape::initVertexBuffers()
          continue;
 
       destIndices += mesh->mIndices.size();
-      destPrims += mesh->primitives.size();
+      destPrims += mesh->mPrimitives.size();
    }
 
    // For HW skinning we can just use the static buffer
@@ -660,14 +660,14 @@ void TSShape::initVertexBuffers()
       AssertFatal(mesh->mVertOffset / mVertexSize == vertStart, "offset mismatch");
 
       vertStart += mesh->mNumVerts;
-      primStart += mesh->primitives.size();
+      primStart += mesh->mPrimitives.size();
       indStart += mesh->mIndices.size();
 
       mesh->mVB = mShapeVertexBuffer;
       mesh->mPB = mShapeVertexIndices;
 
       // Advance
-      piInput += mesh->primitives.size();
+      piInput += mesh->mPrimitives.size();
       ibIndices += mesh->mIndices.size();
 
       if (TSSkinMesh::smDebugSkinVerts && mesh->getMeshType() == TSMesh::SkinMeshType)
@@ -906,12 +906,12 @@ void TSShape::initVertexFeatures()
       mesh->mVertexData.setReady(true);
 
 #ifdef TORQUE_DEBUG
-      AssertFatal(mesh->mNumVerts == mesh->verts.size(), "vert mismatch");
+      AssertFatal(mesh->mNumVerts == mesh->mVerts.size(), "vert mismatch");
       for (U32 i = 0; i < mesh->mNumVerts; i++)
       {
-         Point3F v1 = mesh->verts[i];
+         Point3F v1 = mesh->mVerts[i];
          Point3F v2 = mesh->mVertexData.getBase(i).vert();
-         AssertFatal(mesh->verts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch");
+         AssertFatal(mesh->mVerts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch");
       }
 
       if (mesh->getMeshType() == TSMesh::SkinMeshType)
@@ -987,11 +987,11 @@ void TSShape::initMaterialList()
             if (!mesh)
                continue;
 
-            for (k=0; k<mesh->primitives.size(); k++)
+            for (k=0; k<mesh->mPrimitives.size(); k++)
             {
-               if (mesh->primitives[k].matIndex & TSDrawPrimitive::NoMaterial)
+               if (mesh->mPrimitives[k].matIndex & TSDrawPrimitive::NoMaterial)
                   continue;
-               S32 flags = materialList->getFlags(mesh->primitives[k].matIndex & TSDrawPrimitive::MaterialMask);
+               S32 flags = materialList->getFlags(mesh->mPrimitives[k].matIndex & TSDrawPrimitive::MaterialMask);
                if (flags & TSMaterialList::AuxiliaryMap)
                   continue;
                if (flags & TSMaterialList::Translucent)
@@ -1001,7 +1001,7 @@ void TSShape::initMaterialList()
                   break;
                }
             }
-            if (k!=mesh->primitives.size())
+            if (k!=mesh->mPrimitives.size())
                break;
          }
          if (j!=obj.numMeshes)
@@ -1521,15 +1521,15 @@ void TSShape::assembleShape()
       // fill in location of verts, tverts, and normals for detail levels
       if (mesh && meshType!=TSMesh::DecalMeshType)
       {
-         TSMesh::smVertsList[i]  = mesh->verts.address();
-         TSMesh::smTVertsList[i] = mesh->tverts.address();
+         TSMesh::smVertsList[i]  = mesh->mVerts.address();
+         TSMesh::smTVertsList[i] = mesh->mTverts.address();
          if (smReadVersion >= 26)
          {
-            TSMesh::smTVerts2List[i] = mesh->tverts2.address();
-            TSMesh::smColorsList[i] = mesh->colors.address();
+            TSMesh::smTVerts2List[i] = mesh->mTverts2.address();
+            TSMesh::smColorsList[i] = mesh->mColors.address();
          }
-         TSMesh::smNormsList[i]  = mesh->norms.address();
-         TSMesh::smEncodedNormsList[i] = mesh->encodedNorms.address();
+         TSMesh::smNormsList[i]  = mesh->mNorms.address();
+         TSMesh::smEncodedNormsList[i] = mesh->mEncodedNorms.address();
          TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now
          if (meshType==TSMesh::SkinMeshType)
          {
@@ -1617,9 +1617,9 @@ void TSShape::assembleShape()
          if (skin)
          {
             TSMesh::smVertsList[i]  = skin->batchData.initialVerts.address();
-            TSMesh::smTVertsList[i] = skin->tverts.address();
+            TSMesh::smTVertsList[i] = skin->mTverts.address();
             TSMesh::smNormsList[i]  = skin->batchData.initialNorms.address();
-            TSMesh::smEncodedNormsList[i]  = skin->encodedNorms.address();
+            TSMesh::smEncodedNormsList[i]  = skin->mEncodedNorms.address();
             TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now
             TSSkinMesh::smInitTransformList[i] = skin->batchData.initialTransforms.address();
             TSSkinMesh::smVertexIndexList[i] = skin->vertexIndex.address();
@@ -1805,15 +1805,15 @@ bool TSShape::canWriteOldFormat() const
          continue;
 
       // Cannot use old format if using the new functionality (COLORs, 2nd UV set)
-      if (meshes[i]->tverts2.size() || meshes[i]->colors.size())
+      if (meshes[i]->mTverts2.size() || meshes[i]->mColors.size())
          return false;
 
       // Cannot use old format if any primitive has too many triangles
       // (ie. cannot fit in a S16)
-      for (S32 j = 0; j < meshes[i]->primitives.size(); j++)
+      for (S32 j = 0; j < meshes[i]->mPrimitives.size(); j++)
       {
-         if ((meshes[i]->primitives[j].start +
-               meshes[i]->primitives[j].numElements) >= (1 << 15))
+         if ((meshes[i]->mPrimitives[j].start +
+               meshes[i]->mPrimitives[j].numElements) >= (1 << 15))
          {
             return false;
          }

+ 4 - 4
Engine/source/ts/tsShapeConstruct.cpp

@@ -1340,7 +1340,7 @@ DefineTSShapeConstructorMethod( getMeshMaterial, const char*, ( const char* name
    GET_MESH( getMeshMaterial, mesh, name, "" );
 
    // Return the name of the first material attached to this mesh
-   S32 matIndex = mesh->primitives[0].matIndex & TSDrawPrimitive::MaterialMask;
+   S32 matIndex = mesh->mPrimitives[0].matIndex & TSDrawPrimitive::MaterialMask;
    if ((matIndex >= 0) && (matIndex < mShape->materialList->size()))
       return mShape->materialList->getMaterialName( matIndex );
    else
@@ -1377,10 +1377,10 @@ DefineTSShapeConstructorMethod( setMeshMaterial, bool, ( const char* meshName, c
    }
 
    // Set this material for all primitives in the mesh
-   for ( S32 i = 0; i < mesh->primitives.size(); i++ )
+   for ( S32 i = 0; i < mesh->mPrimitives.size(); i++ )
    {
-      U32 matType = mesh->primitives[i].matIndex & ( TSDrawPrimitive::TypeMask | TSDrawPrimitive::Indexed );
-      mesh->primitives[i].matIndex = ( matType | matIndex );
+      U32 matType = mesh->mPrimitives[i].matIndex & ( TSDrawPrimitive::TypeMask | TSDrawPrimitive::Indexed );
+      mesh->mPrimitives[i].matIndex = ( matType | matIndex );
    }
 
    ADD_TO_CHANGE_SET();

+ 8 - 8
Engine/source/ts/tsShapeEdit.cpp

@@ -938,7 +938,7 @@ TSMesh* TSShape::copyMesh( const TSMesh* srcMesh ) const
 
    // Copy mesh elements
    mesh->mIndices = srcMesh->mIndices;
-   mesh->primitives = srcMesh->primitives;
+   mesh->mPrimitives = srcMesh->mPrimitives;
    mesh->numFrames = srcMesh->numFrames;
    mesh->numMatFrames = srcMesh->numMatFrames;
    mesh->vertsPerFrame = srcMesh->vertsPerFrame;
@@ -948,8 +948,8 @@ TSMesh* TSShape::copyMesh( const TSMesh* srcMesh ) const
    // Copy vertex data in an *unpacked* form
    mesh->copySourceVertexDataFrom(srcMesh);
 
-   mesh->createTangents(mesh->verts, mesh->norms);
-   mesh->encodedNorms.set(NULL, 0);
+   mesh->createTangents(mesh->mVerts, mesh->mNorms);
+   mesh->mEncodedNorms.set(NULL, 0);
 
    mesh->computeBounds();
 
@@ -1108,12 +1108,12 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String
    // Copy materials used by the source mesh (only if from a different shape)
    if (srcShape != this)
    {
-      for (S32 i = 0; i < mesh->primitives.size(); i++)
+      for (S32 i = 0; i < mesh->mPrimitives.size(); i++)
       {
-         if (!(mesh->primitives[i].matIndex & TSDrawPrimitive::NoMaterial))
+         if (!(mesh->mPrimitives[i].matIndex & TSDrawPrimitive::NoMaterial))
          {
-            S32 drawType = (mesh->primitives[i].matIndex & (~TSDrawPrimitive::MaterialMask));
-            S32 srcMatIndex = mesh->primitives[i].matIndex & TSDrawPrimitive::MaterialMask;
+            S32 drawType = (mesh->mPrimitives[i].matIndex & (~TSDrawPrimitive::MaterialMask));
+            S32 srcMatIndex = mesh->mPrimitives[i].matIndex & TSDrawPrimitive::MaterialMask;
             const String& matName = srcShape->materialList->getMaterialName(srcMatIndex);
 
             // Add the material if it does not already exist
@@ -1124,7 +1124,7 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String
                materialList->push_back(matName, srcShape->materialList->getFlags(srcMatIndex));
             }
 
-            mesh->primitives[i].matIndex = drawType | destMatIndex;
+            mesh->mPrimitives[i].matIndex = drawType | destMatIndex;
          }
       }
    }

+ 3 - 3
Engine/source/ts/tsSortedMesh.cpp

@@ -86,10 +86,10 @@ S32 TSSortedMesh::getNumPolys()
       Cluster & cluster = clusters[cIdx];
       for (S32 i=cluster.startPrimitive; i<cluster.endPrimitive; i++)
       {
-         if (primitives[i].matIndex & TSDrawPrimitive::Triangles)
-            count += primitives[i].numElements / 3;
+         if (mPrimitives[i].matIndex & TSDrawPrimitive::Triangles)
+            count += mPrimitives[i].numElements / 3;
          else
-            count += primitives[i].numElements - 2;
+            count += mPrimitives[i].numElements - 2;
       }
       cIdx = cluster.frontCluster; // always use frontCluster...we assume about the same no matter what
    }

+ 1 - 1
Engine/source/ts/tsSortedMesh.h

@@ -71,7 +71,7 @@ public:
    void disassemble();
 
    TSSortedMesh() {
-      meshType = SortedMeshType;
+      mMeshType = SortedMeshType;
    }
 };