diff options
author | prep <prep@lindenlab.com> | 2011-05-05 11:30:22 -0400 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-05-05 11:30:22 -0400 |
commit | a6a842614722e4cec8628925367dcf77e230ba9f (patch) | |
tree | 6040d781293a7cb1c47c5b4b3373e634e93b4adc /indra/newview | |
parent | a776a11ea6aee0c99f9517c8f217ed07f12fa487 (diff) |
merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 95 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 4 |
2 files changed, 1 insertions, 98 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9b6a2c5503..e8da1aa42c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -112,8 +112,6 @@ const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; const S32 PREVIEW_TEXTURE_HEIGHT = 300; -const F32 MAXIMUM_PIVOT_OFFSET = 64.0f; - void drawBoxOutline(const LLVector3& pos, const LLVector3& size); @@ -1772,8 +1770,6 @@ bool LLModelLoader::doLoadModel() processElement(scene); - handlePivotPoint( root ); - return true; } @@ -1963,49 +1959,6 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode ) } } } -//----------------------------------------------------------------------------- -// handlePivotPoint() -//----------------------------------------------------------------------------- -void LLModelLoader::handlePivotPoint( daeElement* pRoot ) -{ - //Import an optional pivot point - a pivot point is just a node in the visual scene named "AssetPivot" - //If no assetpivot is found then the asset will use the SL default - daeElement* pScene = pRoot->getDescendant("visual_scene"); - if ( pScene ) - { - daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren(); - S32 childCount = children.getCount(); - for (S32 i = 0; i < childCount; ++i) - { - domNode* pNode = daeSafeCast<domNode>(children[i]); - if ( pNode && isNodeAPivotPoint( pNode ) ) - { - LLMatrix4 workingTransform; - daeSIDResolver nodeResolver( pNode, "./translate" ); - domTranslate* pTranslate = daeSafeCast<domTranslate>( nodeResolver.getElement() ); - //Translation via SID was successful - //todo#extract via element as well - if ( pTranslate ) - { - extractTranslation( pTranslate, workingTransform ); - LLVector3 pivotTrans = workingTransform.getTranslation(); - if ( pivotTrans[VX] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VX] < -MAXIMUM_PIVOT_OFFSET || - pivotTrans[VY] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VY] < -MAXIMUM_PIVOT_OFFSET || - pivotTrans[VZ] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VZ] < -MAXIMUM_PIVOT_OFFSET ) - { - llwarns<<"Asset Pivot Node contains an offset that is too large - values should be within (-"<<MAXIMUM_PIVOT_OFFSET<<","<<MAXIMUM_PIVOT_OFFSET<<")."<<llendl; - mPreview->setHasPivot( false ); - } - else - { - mPreview->setModelPivot( pivotTrans ); - mPreview->setHasPivot( true ); - } - } - } - } - } -} //----------------------------------------------------------------------------- // critiqueRigForUploadApplicability() @@ -2205,27 +2158,7 @@ bool LLModelLoader::isNodeAJoint( domNode* pNode ) return false; } -//----------------------------------------------------------------------------- -// isNodeAPivotPoint() -//----------------------------------------------------------------------------- -bool LLModelLoader::isNodeAPivotPoint( domNode* pNode ) -{ - bool result = false; - - if ( pNode && pNode->getName() ) - { - std::string name = pNode->getName(); - if ( name == "AssetPivot" ) - { - result = true; - } - else - { - result = false; - } - } - return result; -} + //----------------------------------------------------------------------------- // extractTranslation() //----------------------------------------------------------------------------- @@ -2852,27 +2785,6 @@ void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost)); } -void LLModelPreview::alterModelsPivot( void ) -{ - for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter) - { - if ( *iter ) - { - (*iter)->offsetMesh( mModelPivot ); - } - } - - for ( int i=0;i<LLModel::NUM_LODS;++i ) - { - for (LLModelLoader::model_list::iterator iter = mModel[i].begin(); iter != mModel[i].end(); ++iter) - { - if ( *iter ) - { - (*iter)->offsetMesh( mModelPivot ); - } - } - } -} void LLModelPreview::rebuildUploadData() { @@ -4971,11 +4883,6 @@ void LLFloaterModelPreview::onUpload(void* user_data) LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data; - if ( mp && mp->mModelPreview->mHasPivot ) - { - mp->mModelPreview->alterModelsPivot(); - } - mp->mModelPreview->rebuildUploadData(); bool upload_skinweights = mp->childGetValue("upload_skin").asBoolean(); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 92104c01f4..4d8b46807f 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -120,9 +120,6 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); - void handlePivotPoint( daeElement* pRoot ); - bool isNodeAPivotPoint( domNode* pNode ); - void setLoadState(U32 state); void buildJointToNodeMappingFromScene( daeElement* pRoot ); @@ -298,7 +295,6 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); - void alterModelsPivot( void ); void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); |