diff options
author | prep <prep@lindenlab.com> | 2011-03-30 14:05:23 -0400 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-03-30 14:05:23 -0400 |
commit | dd71a9faacbf52ab5a741c86924149251fadc009 (patch) | |
tree | 9e2486a3ec6ff494f296b3c2e52c14081706745e | |
parent | 73bf43b5933846e786d7e97310488fc72b06d645 (diff) |
Fix for SH-1177 - Allowable range for an alternate pivot is -64 to 64
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 4d7c079a6f..3cb756a006 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -111,6 +111,8 @@ 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); @@ -1913,8 +1915,19 @@ void LLModelLoader::handlePivotPoint( daeElement* pRoot ) if ( pTranslate ) { extractTranslation( pTranslate, workingTransform ); - mPreview->setModelPivot( workingTransform.getTranslation() ); - mPreview->setHasPivot( true ); + 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 ); + } } } } |