From 1f00747cd2accbe1b243e5c23f6e74a061a22bfa Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 5 Oct 2010 16:55:19 -0500 Subject: Post review cleanup. --- indra/llprimitive/llmodel.cpp | 22 ++++++++++++++++++++++ indra/newview/llfloatermodelpreview.cpp | 5 +---- indra/newview/llmeshrepository.cpp | 7 +++++-- 3 files changed, 28 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index d1e89a1ba5..1cada567e9 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1728,3 +1728,25 @@ void LLModel::setPhysicsShape(const LLModel::physics_shape& shape) { mPhysicsShape = shape; + mHullCenter.resize(mPhysicsShape.size()); + mPhysicsPoints = 0; + mPhysicsCenter.clear(); + + for (U32 i = 0; i < shape.size(); ++i) + { + LLVector3 cur_center; + + for (U32 j = 0; j < shape[i].size(); ++j) + { + cur_center += shape[i][j]; + } + mPhysicsCenter += cur_center; + cur_center *= 1.f/shape[i].size(); + mHullCenter[i] = cur_center; + mPhysicsPoints += shape[i].size(); + } + + mPhysicsCenter *= 1.f/mPhysicsPoints; +} + + diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 69e641c074..d939d27fa9 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -643,7 +643,7 @@ void LLFloaterModelPreview::draw() else { const std::string idle("Idle."); - mDecompFloater->childSetText("status", std::string("Idle.")); + mDecompFloater->childSetText("status", idle); } } @@ -789,12 +789,9 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data) if (sInstance) { - LLCDResult ret = LLCD_OK; LLCDParam* param = (LLCDParam*) data; sInstance->mDecompParams[param->mName] = ctrl->getValue(); } - - } //static diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index bec2e208aa..eae5cf59f0 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2696,6 +2696,11 @@ void LLPhysicsDecomp::run() const LLCDParam* param = param_map[name]; + if (param == NULL) + { //couldn't find valid parameter + continue; + } + U32 ret = LLCD_OK; if (param->mType == LLCDParam::LLCD_FLOAT) @@ -2720,7 +2725,6 @@ void LLPhysicsDecomp::run() mCurRequest->setStatusMessage("Executing."); - S32 keep_going = 1; LLCDResult ret = LLCD_OK; if (LLConvexDecomposition::getInstance() != NULL) @@ -2728,7 +2732,6 @@ void LLPhysicsDecomp::run() ret = LLConvexDecomposition::getInstance()->executeStage(stage); } - keep_going = 0; if (ret) { llerrs << "Convex Decomposition thread valid but could not execute stage " << stage << llendl; -- cgit v1.2.3