diff options
Diffstat (limited to 'indra/newview/llflexibleobject.cpp')
-rwxr-xr-x | indra/newview/llflexibleobject.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index caad0afec0..98c0c0bf51 100755 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -294,6 +294,9 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons void LLVolumeImplFlexible::updateRenderRes() { + if (!mAttributes) + return; + LLDrawable* drawablep = mVO->mDrawable; S32 new_res = mAttributes->getSimulateLOD(); @@ -435,7 +438,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } - if(!mInitialized) + if(!mInitialized || !mAttributes) { //the object is not visible return ; @@ -689,30 +692,36 @@ void LLVolumeImplFlexible::doFlexibleUpdate() LLVector4(z_axis, 0.f), LLVector4(delta_pos, 1.f)); + LL_CHECK_MEMORY for (i=0; i<=num_render_sections; ++i) { new_point = &path->mPath[i]; LLVector3 pos = newSection[i].mPosition * rel_xform; LLQuaternion rot = mSection[i].mAxisRotation * newSection[i].mRotation * delta_rot; - - if (!mUpdated || (new_point->mPos-pos).magVec()/mVO->mDrawable->mDistanceWRTCamera > 0.001f) + + LLVector3 np(new_point->mPos.getF32ptr()); + + if (!mUpdated || (np-pos).magVec()/mVO->mDrawable->mDistanceWRTCamera > 0.001f) { - new_point->mPos = newSection[i].mPosition * rel_xform; + new_point->mPos.load3((newSection[i].mPosition * rel_xform).mV); mUpdated = FALSE; } - new_point->mRot = rot; - new_point->mScale = newSection[i].mScale; + new_point->mRot.loadu(LLMatrix3(rot)); + new_point->mScale.set(newSection[i].mScale.mV[0], newSection[i].mScale.mV[1], 0,1); new_point->mTexT = ((F32)i)/(num_render_sections); } - + LL_CHECK_MEMORY mLastSegmentRotation = parentSegmentRotation; } +static LLFastTimer::DeclareTimer FTM_FLEXI_PREBUILD("Flexi Prebuild"); + void LLVolumeImplFlexible::preRebuild() { if (!mUpdated) { + LLFastTimer t(FTM_FLEXI_PREBUILD); doFlexibleRebuild(); } } |