Fixed coloring bugs related to uninitialized variable
This commit is contained in:
parent
3c22f0f48f
commit
8e63862d7c
|
@ -421,7 +421,6 @@ SGNODE* WRL1FACESET::TranslateToSG( SGNODE* aParent, WRL1STATUS* sp )
|
|||
case BIND_PER_VERTEX:
|
||||
m_current.mat->GetColor( &pc1, idx );
|
||||
fp->AddColor( pc1 );
|
||||
++cidx;
|
||||
break;
|
||||
|
||||
case BIND_PER_FACE_INDEXED:
|
||||
|
|
|
@ -517,8 +517,8 @@ bool FACET::GetData( std::vector< WRLVEC3F >& aVertexList, std::vector< WRLVEC3F
|
|||
aNormalsList.push_back( tnorm );
|
||||
}
|
||||
|
||||
bool hasColor;
|
||||
bool perVC; // per-vertex colors?
|
||||
bool hasColor = false;
|
||||
bool perVC = false; // per-vertex colors?
|
||||
|
||||
if( !colors.empty() )
|
||||
{
|
||||
|
@ -560,10 +560,6 @@ bool FACET::GetData( std::vector< WRLVEC3F >& aVertexList, std::vector< WRLVEC3F
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hasColor = false;
|
||||
}
|
||||
|
||||
int lim = (int) vertices.size() - 1;
|
||||
|
||||
|
@ -674,7 +670,6 @@ void FACET::CollectVertices( std::vector< std::list< FACET* > >& aFacetList )
|
|||
|
||||
void FACET::Renormalize( float aMaxValue )
|
||||
{
|
||||
//return;
|
||||
if( vnweight.empty() || aMaxValue < LOWER_LIMIT )
|
||||
return;
|
||||
|
||||
|
@ -730,7 +725,7 @@ SGNODE* SHAPE::CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrd
|
|||
int maxIdx = 0;
|
||||
int tmi;
|
||||
float maxV = 0.0;
|
||||
float tV;
|
||||
float tV = 0.0;
|
||||
|
||||
while( sF != eF )
|
||||
{
|
||||
|
|
|
@ -79,7 +79,8 @@ public:
|
|||
* calculates the normal to the facet assuming a CCW orientation
|
||||
* and performs the calculation of the angle weighted vertex normals.
|
||||
*
|
||||
* @return is the max. magnitude of any component of a vector
|
||||
* @return is the max. magnitude of any component of the normal or zero
|
||||
* if there is a fault or the normal has already been calculated.
|
||||
*/
|
||||
float CalcFaceNormal();
|
||||
|
||||
|
|
Loading…
Reference in New Issue