SH-1632 - minor camera and far plane tweak. Also need SH-1665 for full solution (model needs to stay at the origin - currently it translates during scaling).

meow-7.2.2
prep linden 2011-06-10 10:35:55 -04:00
parent 3ede390b87
commit fd51f4d170
1 changed files with 80 additions and 80 deletions

View File

@ -2203,87 +2203,87 @@ bool LLModelLoader::isNodeAJoint( domNode* pNode )
//-----------------------------------------------------------------------------
// verifyCount
//-----------------------------------------------------------------------------
bool LLModelPreview::verifyCount( int expected, int result )
{
if ( expected != result )
{
llinfos<< "Error: (expected/got)"<<expected<<"/"<<result<<"verts"<<llendl;
return false;
}
return true;
}
bool LLModelPreview::verifyCount( int expected, int result )
{
if ( expected != result )
{
llinfos<< "Error: (expected/got)"<<expected<<"/"<<result<<"verts"<<llendl;
return false;
}
return true;
}
//-----------------------------------------------------------------------------
// verifyController
//-----------------------------------------------------------------------------
bool LLModelPreview::verifyController( domController* pController )
{
bool result = true;
domSkin* pSkin = pController->getSkin();
if ( pSkin )
{
xsAnyURI & uri = pSkin->getSource();
domElement* pElement = uri.getElement();
if ( !pElement )
{
llinfos<<"Can't resolve skin source"<<llendl;
return false;
}
daeString type_str = pElement->getTypeName();
if ( stricmp(type_str, "geometry") == 0 )
{
//Skin is reference directly by geometry and get the vertex count from skin
domSkin::domVertex_weights* pVertexWeights = pSkin->getVertex_weights();
U32 vertexWeightsCount = pVertexWeights->getCount();
domGeometry* pGeometry = (domGeometry*) (domElement*) uri.getElement();
domMesh* pMesh = pGeometry->getMesh();
if ( pMesh )
{
//Get vertex count from geometry
domVertices* pVertices = pMesh->getVertices();
if ( !pVertices )
{
llinfos<<"No vertices!"<<llendl;
return false;
}
if ( pVertices )
{
xsAnyURI src = pVertices->getInput_array()[0]->getSource();
domSource* pSource = (domSource*) (domElement*) src.getElement();
U32 verticesCount = pSource->getTechnique_common()->getAccessor()->getCount();
result = verifyCount( verticesCount, vertexWeightsCount );
if ( !result )
{
return result;
}
}
}
U32 vcountCount = (U32) pVertexWeights->getVcount()->getValue().getCount();
result = verifyCount( vcountCount, vertexWeightsCount );
if ( !result )
{
return result;
}
domInputLocalOffset_Array& inputs = pVertexWeights->getInput_array();
U32 sum = 0;
for (size_t i=0; i<vcountCount; i++)
{
sum += pVertexWeights->getVcount()->getValue()[i];
}
result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() );
}
}
return result;
}
bool LLModelPreview::verifyController( domController* pController )
{
bool result = true;
domSkin* pSkin = pController->getSkin();
if ( pSkin )
{
xsAnyURI & uri = pSkin->getSource();
domElement* pElement = uri.getElement();
if ( !pElement )
{
llinfos<<"Can't resolve skin source"<<llendl;
return false;
}
daeString type_str = pElement->getTypeName();
if ( stricmp(type_str, "geometry") == 0 )
{
//Skin is reference directly by geometry and get the vertex count from skin
domSkin::domVertex_weights* pVertexWeights = pSkin->getVertex_weights();
U32 vertexWeightsCount = pVertexWeights->getCount();
domGeometry* pGeometry = (domGeometry*) (domElement*) uri.getElement();
domMesh* pMesh = pGeometry->getMesh();
if ( pMesh )
{
//Get vertex count from geometry
domVertices* pVertices = pMesh->getVertices();
if ( !pVertices )
{
llinfos<<"No vertices!"<<llendl;
return false;
}
if ( pVertices )
{
xsAnyURI src = pVertices->getInput_array()[0]->getSource();
domSource* pSource = (domSource*) (domElement*) src.getElement();
U32 verticesCount = pSource->getTechnique_common()->getAccessor()->getCount();
result = verifyCount( verticesCount, vertexWeightsCount );
if ( !result )
{
return result;
}
}
}
U32 vcountCount = (U32) pVertexWeights->getVcount()->getValue().getCount();
result = verifyCount( vcountCount, vertexWeightsCount );
if ( !result )
{
return result;
}
domInputLocalOffset_Array& inputs = pVertexWeights->getInput_array();
U32 sum = 0;
for (size_t i=0; i<vcountCount; i++)
{
sum += pVertexWeights->getVcount()->getValue()[i];
}
result = verifyCount( sum * inputs.getCount(), (domInt) pVertexWeights->getV()->getValue().getCount() );
}
}
return result;
}
//-----------------------------------------------------------------------------
// extractTranslation()
@ -3372,7 +3372,7 @@ void LLModelPreview::resetPreviewTarget()
mPreviewScale = (mModelLoader->mExtents[1] - mModelLoader->mExtents[0]) * 0.5f;
}
setPreviewTarget(mPreviewScale.magVec()*2.f);
setPreviewTarget(mPreviewScale.magVec()*10.f);
}
void LLModelPreview::generateNormals()
@ -4590,7 +4590,7 @@ BOOL LLModelPreview::render()
LLVector3 target_pos = mPreviewTarget+offset;
F32 z_near = 0.001f;
F32 z_far = mCameraDistance+mPreviewScale.magVec()+mCameraOffset.magVec();
F32 z_far = mCameraDistance*10.0f+mPreviewScale.magVec()+mCameraOffset.magVec();
if (skin_weight)
{