summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2011-03-24 09:48:34 -0400
committerprep <prep@lindenlab.com>2011-03-24 09:48:34 -0400
commitd2bb490702921b5ca9fdcd562c67844e2d4802e1 (patch)
tree23757871fd89a981d9e6691668d78ec6b3f52a48 /indra/newview
parent3ad81bb4a642d25018b773d2ef005380664d8170 (diff)
Crash fix for SH-1176 and WIP for pelvis z offset
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp20
-rwxr-xr-xindra/newview/llmeshrepository.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp20
-rw-r--r--indra/newview/llvoavatar.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_model_preview.xml2
5 files changed, 36 insertions, 9 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6145c6c16d..2587ab69c3 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1873,8 +1873,7 @@ void LLModelLoader::loadModelCallback()
{
if (mPreview)
{
- mPreview->loadModelCallback(mLod);
- mPreview->mModelLoader = NULL;
+ mPreview->loadModelCallback(mLod);
}
while (!isStopped())
@@ -2494,8 +2493,13 @@ U32 LLModelPreview::calcResourceCost()
U32 num_hulls = 0;
F32 debug_scale = mFMP ? mFMP->childGetValue("import_scale").asReal() : 1.f;
- mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 32.0f;
-
+ mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 8.0f;
+
+ //if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() )
+ //{
+ // gAgentAvatarp->setPelvisOffset( mPelvisZOffset );
+ //}
+
F32 streaming_cost = 0.f;
F32 physics_cost = 0.f;
for (U32 i = 0; i < mUploadData.size(); ++i)
@@ -2990,8 +2994,12 @@ void LLModelPreview::loadModelCallback(S32 lod)
void LLModelPreview::resetPreviewTarget()
{
- mPreviewTarget = (mModelLoader->mExtents[0] + mModelLoader->mExtents[1]) * 0.5f;
- mPreviewScale = (mModelLoader->mExtents[1] - mModelLoader->mExtents[0]) * 0.5f;
+ if ( mModelLoader )
+ {
+ mPreviewTarget = (mModelLoader->mExtents[0] + mModelLoader->mExtents[1]) * 0.5f;
+ mPreviewScale = (mModelLoader->mExtents[1] - mModelLoader->mExtents[0]) * 0.5f;
+ }
+
setPreviewTarget(mPreviewScale.magVec()*2.f);
}
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a227627bc1..60cbdcc98b 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1179,7 +1179,7 @@ bool LLMeshRepoThread::decompositionReceived(const LLUUID& mesh_id, U8* data, S3
LLSD decomp;
if (data_size > 0)
- {
+ {
std::string res_str((char*) data, data_size);
std::istringstream stream(res_str);
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 5f0e4bcded..7468281f65 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1333,7 +1333,17 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- return mDrawable->getPositionAgent();
+ if ( !mHasPelvisOffset )
+ {
+ return mDrawable->getPositionAgent();
+ }
+ else
+ {
+ //Apply a pelvis fixup (as defined by the avs skin)
+ LLVector3 pos = mDrawable->getPositionAgent();
+ pos[VZ] += mPelvisFixup;
+ return pos;
+ }
}
else
{
@@ -3810,6 +3820,14 @@ void LLVOAvatar::postPelvisSetRecalc( void )
updateHeadOffset();
}
//------------------------------------------------------------------------
+// pelisPoke
+//------------------------------------------------------------------------
+void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount )
+{
+ mHasPelvisOffset = true;
+ mPelvisFixup = pelvisFixupAmount;
+}
+//------------------------------------------------------------------------
// updateVisibility()
//------------------------------------------------------------------------
void LLVOAvatar::updateVisibility()
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 7209b9f1e5..1552532a97 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -295,6 +295,7 @@ public:
void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
bool hasPelvisOffset( void ) { return mHasPelvisOffset; }
void postPelvisSetRecalc( void );
+ void setPelvisOffset( F32 pelvixFixupAmount );
bool mHasPelvisOffset;
LLVector3 mPelvisOffset;
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index e79dfcbc7d..5a726d1821 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -393,7 +393,7 @@
Pelvis Offset:
</text>
- <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="0.00" max_val="32.0" name="pelvis_offset"/>
+ <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="0.00" max_val="8.0" name="pelvis_offset"/>
</panel>
</tab_container>