Intermediary commit #2.
This commit is contained in:
@@ -49,6 +49,7 @@ public:
|
|||||||
enum EBoostLevel
|
enum EBoostLevel
|
||||||
{
|
{
|
||||||
BOOST_NONE = 0,
|
BOOST_NONE = 0,
|
||||||
|
BOOST_ALM , //acts like NONE when ALM is on, max discard when ALM is off
|
||||||
BOOST_AVATAR_BAKED ,
|
BOOST_AVATAR_BAKED ,
|
||||||
BOOST_AVATAR ,
|
BOOST_AVATAR ,
|
||||||
BOOST_CLOUDS ,
|
BOOST_CLOUDS ,
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ set(viewer_SOURCE_FILES
|
|||||||
llsavedsettingsglue.cpp
|
llsavedsettingsglue.cpp
|
||||||
llscrollingpanelparam.cpp
|
llscrollingpanelparam.cpp
|
||||||
llscrollingpanelparambase.cpp
|
llscrollingpanelparambase.cpp
|
||||||
|
llsculptidsize.cpp
|
||||||
llselectmgr.cpp
|
llselectmgr.cpp
|
||||||
llshareavatarhandler.cpp
|
llshareavatarhandler.cpp
|
||||||
llskinningutil.cpp
|
llskinningutil.cpp
|
||||||
@@ -976,6 +977,7 @@ set(viewer_HEADER_FILES
|
|||||||
llsavedsettingsglue.h
|
llsavedsettingsglue.h
|
||||||
llscrollingpanelparam.h
|
llscrollingpanelparam.h
|
||||||
llscrollingpanelparambase.h
|
llscrollingpanelparambase.h
|
||||||
|
llsculptidsize.h
|
||||||
llselectmgr.h
|
llselectmgr.h
|
||||||
llsimplestat.h
|
llsimplestat.h
|
||||||
llskinningutil.h
|
llskinningutil.h
|
||||||
|
|||||||
@@ -934,6 +934,16 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
|
|||||||
{
|
{
|
||||||
gSky.mVOGroundp->setRegion(regionp);
|
gSky.mVOGroundp->setRegion(regionp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (regionp->capabilitiesReceived())
|
||||||
|
{
|
||||||
|
regionp->requestSimulatorFeatures();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
regionp->setCapabilitiesReceivedCallback(boost::bind(&LLViewerRegion::requestSimulatorFeatures, regionp));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "material_codes.h"
|
#include "material_codes.h"
|
||||||
|
|
||||||
// viewer includes
|
// viewer includes
|
||||||
|
#include "llagent.h"
|
||||||
#include "llcriticaldamp.h"
|
#include "llcriticaldamp.h"
|
||||||
#include "llface.h"
|
#include "llface.h"
|
||||||
#include "lllightconstants.h"
|
#include "lllightconstants.h"
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
#include "llspatialpartition.h"
|
#include "llspatialpartition.h"
|
||||||
#include "llviewerobjectlist.h"
|
#include "llviewerobjectlist.h"
|
||||||
#include "llviewerwindow.h"
|
#include "llviewerwindow.h"
|
||||||
|
#include "lldrawpoolavatar.h"
|
||||||
|
|
||||||
const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f;
|
const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f;
|
||||||
const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f;
|
const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f;
|
||||||
@@ -113,6 +115,28 @@ void LLDrawable::init()
|
|||||||
initVisible(sCurVisible - 2);//invisible for the current frame and the last frame.
|
initVisible(sCurVisible - 2);//invisible for the current frame and the last frame.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLDrawable::unload()
|
||||||
|
{
|
||||||
|
LLVOVolume *pVVol = getVOVolume();
|
||||||
|
pVVol->setNoLOD();
|
||||||
|
|
||||||
|
for (S32 i = 0; i < getNumFaces(); i++)
|
||||||
|
{
|
||||||
|
LLFace* facep = getFace(i);
|
||||||
|
if (facep->isState(LLFace::RIGGED))
|
||||||
|
{
|
||||||
|
LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*)facep->getPool();
|
||||||
|
if (pool) {
|
||||||
|
pool->removeRiggedFace(facep);
|
||||||
|
}
|
||||||
|
facep->setVertexBuffer(NULL);
|
||||||
|
}
|
||||||
|
facep->clearState(LLFace::RIGGED);
|
||||||
|
}
|
||||||
|
|
||||||
|
pVVol->markForUpdate(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void LLDrawable::initClass()
|
void LLDrawable::initClass()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public:
|
|||||||
void markDead(); // Mark this drawable as dead
|
void markDead(); // Mark this drawable as dead
|
||||||
BOOL isDead() const { return isState(DEAD); }
|
BOOL isDead() const { return isState(DEAD); }
|
||||||
BOOL isNew() const { return !isState(BUILT); }
|
BOOL isNew() const { return !isState(BUILT); }
|
||||||
|
BOOL isUnload() const { return isState(FOR_UNLOAD); }
|
||||||
BOOL isLight() const;
|
BOOL isLight() const;
|
||||||
|
|
||||||
virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
|
virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
|
||||||
@@ -155,6 +155,7 @@ public:
|
|||||||
void mergeFaces(LLDrawable* src);
|
void mergeFaces(LLDrawable* src);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
void unload();
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
@@ -296,6 +297,7 @@ public:
|
|||||||
PARTITION_MOVE = 0x10000000,
|
PARTITION_MOVE = 0x10000000,
|
||||||
ANIMATED_CHILD = 0x20000000,
|
ANIMATED_CHILD = 0x20000000,
|
||||||
ACTIVE_CHILD = 0x40000000,
|
ACTIVE_CHILD = 0x40000000,
|
||||||
|
FOR_UNLOAD = 0x80000000, //should be unload from memory
|
||||||
} EDrawableFlags;
|
} EDrawableFlags;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
|
|||||||
}
|
}
|
||||||
LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
|
LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
|
||||||
|
|
||||||
if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull())
|
if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
#include "llviewershadermgr.h"
|
#include "llviewershadermgr.h"
|
||||||
#include "llviewertexture.h"
|
#include "llviewertexture.h"
|
||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
|
#include "llsculptidsize.h"
|
||||||
|
|
||||||
#define LL_MAX_INDICES_COUNT 1000000
|
#define LL_MAX_INDICES_COUNT 1000000
|
||||||
|
|
||||||
@@ -851,12 +852,6 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
|
|||||||
//get bounding box
|
//get bounding box
|
||||||
if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED))
|
if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED))
|
||||||
{
|
{
|
||||||
//VECTORIZE THIS
|
|
||||||
const LLMatrix4a& mat_vert = mat_vert_in;
|
|
||||||
//mat_vert.loadu(mat_vert_in);
|
|
||||||
|
|
||||||
LLVector4a min,max;
|
|
||||||
|
|
||||||
if (f >= volume.getNumVolumeFaces())
|
if (f >= volume.getNumVolumeFaces())
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Generating bounding box for invalid face index!" << LL_ENDL;
|
LL_WARNS() << "Generating bounding box for invalid face index!" << LL_ENDL;
|
||||||
@@ -864,77 +859,42 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const LLVolumeFace &face = volume.getVolumeFace(f);
|
const LLVolumeFace &face = volume.getVolumeFace(f);
|
||||||
min = face.mExtents[0];
|
|
||||||
max = face.mExtents[1];
|
|
||||||
|
|
||||||
llassert(less_than_max_mag(min));
|
|
||||||
llassert(less_than_max_mag(max));
|
|
||||||
|
|
||||||
//min, max are in volume space, convert to drawable render space
|
// MAINT-8264 - stray vertices, especially in low LODs, cause bounding box errors.
|
||||||
|
if (face.mNumVertices < 3)
|
||||||
//get 8 corners of bounding box
|
|
||||||
LLVector4Logical mask[6];
|
|
||||||
|
|
||||||
for (U32 i = 0; i < 6; ++i)
|
|
||||||
{
|
{
|
||||||
mask[i].clear();
|
LL_DEBUGS("RiggedBox") << "skipping face " << f << ", bad num vertices "
|
||||||
|
<< face.mNumVertices << " " << face.mNumIndices << " " << face.mWeights << LL_ENDL;
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mask[0].setElement<2>(); //001
|
//VECTORIZE THIS
|
||||||
mask[1].setElement<1>(); //010
|
LLMatrix4a mat_vert = mat_vert_in;
|
||||||
mask[2].setElement<1>(); //011
|
LLVector4a new_extents[2];
|
||||||
mask[2].setElement<2>();
|
|
||||||
mask[3].setElement<0>(); //100
|
|
||||||
mask[4].setElement<0>(); //101
|
|
||||||
mask[4].setElement<2>();
|
|
||||||
mask[5].setElement<0>(); //110
|
|
||||||
mask[5].setElement<1>();
|
|
||||||
|
|
||||||
LLVector4a v[8];
|
llassert(less_than_max_mag(face.mExtents[0]));
|
||||||
|
llassert(less_than_max_mag(face.mExtents[1]));
|
||||||
|
|
||||||
v[6] = min;
|
matMulBoundBox(mat_vert, face.mExtents, mExtents);
|
||||||
v[7] = max;
|
|
||||||
|
|
||||||
for (U32 i = 0; i < 6; ++i)
|
|
||||||
{
|
|
||||||
v[i].setSelectWithMask(mask[i], min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
LLVector4a tv[8];
|
|
||||||
|
|
||||||
//transform bounding box into drawable space
|
|
||||||
for (U32 i = 0; i < 8; ++i)
|
|
||||||
{
|
|
||||||
mat_vert.affineTransform(v[i], tv[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//find bounding box
|
|
||||||
LLVector4a& newMin = mExtents[0];
|
|
||||||
LLVector4a& newMax = mExtents[1];
|
|
||||||
|
|
||||||
newMin = newMax = tv[0];
|
|
||||||
|
|
||||||
for (U32 i = 1; i < 8; ++i)
|
|
||||||
{
|
|
||||||
newMin.setMin(newMin, tv[i]);
|
|
||||||
newMax.setMax(newMax, tv[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mDrawablep->isActive())
|
if (!mDrawablep->isActive())
|
||||||
{ // Shift position for region
|
{ // Shift position for region
|
||||||
LLVector4a offset;
|
LLVector4a offset;
|
||||||
offset.load3(mDrawablep->getRegion()->getOriginAgent().mV);
|
offset.load3(mDrawablep->getRegion()->getOriginAgent().mV);
|
||||||
newMin.add(offset);
|
mExtents[0].add(offset);
|
||||||
newMax.add(offset);
|
mExtents[1].add(offset);
|
||||||
|
LL_DEBUGS("RiggedBox") << "updating extents for face " << f
|
||||||
|
<< " not active, added offset " << offset << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVector4a t;
|
LLVector4a t;
|
||||||
t.setAdd(newMin,newMax);
|
t.setAdd(mExtents[0],mExtents[1]);
|
||||||
t.mul(0.5f);
|
t.mul(0.5f);
|
||||||
|
|
||||||
mCenterLocal.set(t.getF32ptr());
|
mCenterLocal.set(t.getF32ptr());
|
||||||
|
|
||||||
t.setSub(newMax,newMin);
|
t.setSub(mExtents[1],mExtents[0]);
|
||||||
mBoundingSphereRadius = t.getLength3().getF32()*0.5f;
|
mBoundingSphereRadius = t.getLength3().getF32()*0.5f;
|
||||||
|
|
||||||
updateCenterAgent();
|
updateCenterAgent();
|
||||||
@@ -2521,12 +2481,25 @@ LLViewerTexture* LLFace::getTexture(U32 ch) const
|
|||||||
|
|
||||||
void LLFace::setVertexBuffer(LLVertexBuffer* buffer)
|
void LLFace::setVertexBuffer(LLVertexBuffer* buffer)
|
||||||
{
|
{
|
||||||
|
if (buffer)
|
||||||
|
{
|
||||||
|
LLSculptIDSize::instance().inc(mDrawablep, buffer->getSize() + buffer->getIndicesSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mVertexBuffer)
|
||||||
|
{
|
||||||
|
LLSculptIDSize::instance().dec(mDrawablep);
|
||||||
|
}
|
||||||
mVertexBuffer = buffer;
|
mVertexBuffer = buffer;
|
||||||
llassert(verify());
|
llassert(verify());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFace::clearVertexBuffer()
|
void LLFace::clearVertexBuffer()
|
||||||
{
|
{
|
||||||
|
if (mVertexBuffer)
|
||||||
|
{
|
||||||
|
LLSculptIDSize::instance().dec(mDrawablep);
|
||||||
|
}
|
||||||
mVertexBuffer = NULL;
|
mVertexBuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1308,17 +1308,10 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicT
|
|||||||
mCameraPitch = 0.f;
|
mCameraPitch = 0.f;
|
||||||
mCameraZoom = 1.f;
|
mCameraZoom = 1.f;
|
||||||
|
|
||||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
|
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR);
|
||||||
mDummyAvatar->createDrawable(&gPipeline);
|
|
||||||
mDummyAvatar->mIsDummy = TRUE;
|
|
||||||
mDummyAvatar->mSpecialRenderMode = 1;
|
mDummyAvatar->mSpecialRenderMode = 1;
|
||||||
mDummyAvatar->setPositionAgent(LLVector3::zero);
|
|
||||||
mDummyAvatar->slamPosition();
|
|
||||||
mDummyAvatar->updateJointLODs();
|
|
||||||
mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
|
|
||||||
mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET);
|
mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET);
|
||||||
mDummyAvatar->hideSkirt();
|
mDummyAvatar->hideSkirt();
|
||||||
//gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance());
|
|
||||||
|
|
||||||
// stop extraneous animations
|
// stop extraneous animations
|
||||||
mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE );
|
mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE );
|
||||||
|
|||||||
@@ -621,15 +621,8 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDyna
|
|||||||
mCameraPitch = 0.f;
|
mCameraPitch = 0.f;
|
||||||
mCameraZoom = 1.f;
|
mCameraZoom = 1.f;
|
||||||
|
|
||||||
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
|
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR);
|
||||||
mDummyAvatar->createDrawable(&gPipeline);
|
|
||||||
mDummyAvatar->mIsDummy = TRUE;
|
|
||||||
mDummyAvatar->mSpecialRenderMode = 2;
|
mDummyAvatar->mSpecialRenderMode = 2;
|
||||||
mDummyAvatar->setPositionAgent(LLVector3::zero);
|
|
||||||
mDummyAvatar->slamPosition();
|
|
||||||
mDummyAvatar->updateJointLODs();
|
|
||||||
mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
|
|
||||||
// gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance());
|
|
||||||
|
|
||||||
mTextureName = 0;
|
mTextureName = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2918,7 +2918,7 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
|
|||||||
{
|
{
|
||||||
LLMutexLock lock(mHeaderMutex);
|
LLMutexLock lock(mHeaderMutex);
|
||||||
mesh_header_map::iterator iter = mMeshHeader.find(mesh_id);
|
mesh_header_map::iterator iter = mMeshHeader.find(mesh_id);
|
||||||
if (iter != mMeshHeader.end())
|
if (iter != mMeshHeader.end() && mMeshHeaderSize[mesh_id] > 0)
|
||||||
{
|
{
|
||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
@@ -2944,10 +2944,11 @@ void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3
|
|||||||
|
|
||||||
S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
|
S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
|
||||||
{
|
{
|
||||||
if (mThread)
|
if (mThread && mesh_id.notNull() && LLPrimitive::NO_LOD != lod)
|
||||||
{
|
{
|
||||||
|
LLMutexLock lock(mThread->mHeaderMutex);
|
||||||
LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id);
|
LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id);
|
||||||
if (iter != mThread->mMeshHeader.end())
|
if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0)
|
||||||
{
|
{
|
||||||
LLSD& header = iter->second;
|
LLSD& header = iter->second;
|
||||||
|
|
||||||
@@ -3087,7 +3088,7 @@ F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 max_area = 102932.f; //area of circle that encompasses region
|
F32 max_area = 102944.f; //area of circle that encompasses region (see MAINT-6559)
|
||||||
F32 min_area = 1.f;
|
F32 min_area = 1.f;
|
||||||
|
|
||||||
F32 high_area = llmin(F_PI*dmid*dmid, max_area);
|
F32 high_area = llmin(F_PI*dmid*dmid, max_area);
|
||||||
|
|||||||
154
indra/newview/llsculptidsize.cpp
Normal file
154
indra/newview/llsculptidsize.cpp
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/**
|
||||||
|
* @file llsculptidsize.cpp
|
||||||
|
* @brief LLSculptIDSize class implementation
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
#include "llsculptidsize.h"
|
||||||
|
#include "llvovolume.h"
|
||||||
|
#include "lldrawable.h"
|
||||||
|
#include "llvoavatar.h"
|
||||||
|
//boost
|
||||||
|
#include "boost/make_shared.hpp"
|
||||||
|
|
||||||
|
//...........
|
||||||
|
|
||||||
|
extern LLControlGroup gSavedSettings;
|
||||||
|
|
||||||
|
//...........
|
||||||
|
|
||||||
|
typedef std::pair<LLSculptIDSize::container_BY_SCULPT_ID_view::iterator, LLSculptIDSize::container_BY_SCULPT_ID_view::iterator> pair_iter_iter_BY_SCULPT_ID_t;
|
||||||
|
|
||||||
|
//...........
|
||||||
|
|
||||||
|
void _nothing_to_do_func(int) { /*nothing todo here because of the size it's a shared member*/ }
|
||||||
|
|
||||||
|
void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz)
|
||||||
|
{
|
||||||
|
llassert(sz >= 0);
|
||||||
|
|
||||||
|
if (!pdrawable) return;
|
||||||
|
LLVOVolume* vvol = pdrawable->getVOVolume();
|
||||||
|
if (!vvol) return;
|
||||||
|
if (!vvol->isAttachment()) return;
|
||||||
|
if (!vvol->getAvatar()) return;
|
||||||
|
if (vvol->getAvatar()->isSelf()) return;
|
||||||
|
LLVolume *vol = vvol->getVolume();
|
||||||
|
if (!vol) return;
|
||||||
|
|
||||||
|
const LLUUID &sculptId = vol->getParams().getSculptID();
|
||||||
|
if (sculptId.isNull()) return;
|
||||||
|
|
||||||
|
unsigned int total_size = 0;
|
||||||
|
|
||||||
|
pair_iter_iter_BY_SCULPT_ID_t itLU = mSizeInfo.get<tag_BY_SCULPT_ID>().equal_range(sculptId);
|
||||||
|
if (itLU.first == itLU.second)
|
||||||
|
{ //register
|
||||||
|
llassert(mSizeInfo.get<tag_BY_DRAWABLE>().end() == mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable));
|
||||||
|
mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, boost::make_shared<SizeSum>(sz), sculptId));
|
||||||
|
total_size = sz;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //update + register
|
||||||
|
Info &nfo = const_cast<Info &>(*itLU.first);
|
||||||
|
//calc new size
|
||||||
|
total_size = nfo.getSizeSum() + sz;
|
||||||
|
nfo.mSharedSizeSum->mSizeSum = total_size;
|
||||||
|
nfo.mSize = sz;
|
||||||
|
//update size for all LLDrwable in range of sculptId
|
||||||
|
for (pair_iter_iter_BY_SCULPT_ID_t::first_type it = itLU.first; it != itLU.second; ++it)
|
||||||
|
{
|
||||||
|
mSizeInfo.get<tag_BY_SIZE>().modify_key(mSizeInfo.project<tag_BY_SIZE>(it), boost::bind(&_nothing_to_do_func, _1));
|
||||||
|
}
|
||||||
|
|
||||||
|
//trying insert the LLDrawable
|
||||||
|
mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, nfo.mSharedSizeSum, sculptId));
|
||||||
|
}
|
||||||
|
|
||||||
|
static LLCachedControl<U32> render_auto_mute_byte_limit(gSavedSettings, "RenderAutoMuteByteLimit", 0U);
|
||||||
|
|
||||||
|
if (0 != render_auto_mute_byte_limit && total_size > render_auto_mute_byte_limit)
|
||||||
|
{
|
||||||
|
pair_iter_iter_BY_SCULPT_ID_t it_eqr = mSizeInfo.get<tag_BY_SCULPT_ID>().equal_range(sculptId);
|
||||||
|
for (; it_eqr.first != it_eqr.second; ++it_eqr.first)
|
||||||
|
{
|
||||||
|
const Info &i = *it_eqr.first;
|
||||||
|
LLVOVolume *pVVol = i.mDrawable->getVOVolume();
|
||||||
|
if (pVVol
|
||||||
|
&& !pVVol->isDead()
|
||||||
|
&& pVVol->isAttachment()
|
||||||
|
&& !pVVol->getAvatar()->isSelf()
|
||||||
|
&& LLVOVolume::NO_LOD != pVVol->getLOD()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addToUnloaded(sculptId);
|
||||||
|
//immediately
|
||||||
|
const_cast<LLDrawable*>(i.mDrawable)->unload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSculptIDSize::dec(const LLDrawable *pdrawable)
|
||||||
|
{
|
||||||
|
container_BY_DRAWABLE_view::iterator it = mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable);
|
||||||
|
if (mSizeInfo.get<tag_BY_DRAWABLE>().end() == it) return;
|
||||||
|
|
||||||
|
unsigned int size = it->getSizeSum() - it->getSize();
|
||||||
|
|
||||||
|
if (0 == size)
|
||||||
|
{
|
||||||
|
mSizeInfo.get<tag_BY_SCULPT_ID>().erase(it->getSculptId());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info &nfo = const_cast<Info &>(*it);
|
||||||
|
nfo.mSize = 0;
|
||||||
|
pair_iter_iter_BY_SCULPT_ID_t itLU = mSizeInfo.get<tag_BY_SCULPT_ID>().equal_range(it->getSculptId());
|
||||||
|
it->mSharedSizeSum->mSizeSum = size;
|
||||||
|
for (pair_iter_iter_BY_SCULPT_ID_t::first_type it = itLU.first; it != itLU.second; ++it)
|
||||||
|
{
|
||||||
|
mSizeInfo.get<tag_BY_SIZE>().modify_key(mSizeInfo.project<tag_BY_SIZE>(it), boost::bind(&_nothing_to_do_func, _1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSculptIDSize::rem(const LLUUID &sculptId)
|
||||||
|
{
|
||||||
|
mSizeInfo.get<tag_BY_SCULPT_ID>().erase(sculptId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSculptIDSize::resetSizeSum(const LLUUID &sculptId)
|
||||||
|
{
|
||||||
|
const pair_iter_iter_BY_SCULPT_ID_t itLU = mSizeInfo.get<tag_BY_SCULPT_ID>().equal_range(sculptId);
|
||||||
|
|
||||||
|
if (itLU.first != itLU.second) {
|
||||||
|
itLU.first->mSharedSizeSum->mSizeSum = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (pair_iter_iter_BY_SCULPT_ID_t::first_type it = itLU.first, itE = itLU.second; it != itE; ++it)
|
||||||
|
{
|
||||||
|
mSizeInfo.get<tag_BY_SIZE>().modify_key(mSizeInfo.project<tag_BY_SIZE>(it), boost::bind(&_nothing_to_do_func, _1));
|
||||||
|
}
|
||||||
|
}
|
||||||
134
indra/newview/llsculptidsize.h
Normal file
134
indra/newview/llsculptidsize.h
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
/**
|
||||||
|
* @file llsculptidsize.h
|
||||||
|
* @brief LLSculptIDSize class definition
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LL_LLSCULPTIDSIZE_H
|
||||||
|
#define LL_LLSCULPTIDSIZE_H
|
||||||
|
|
||||||
|
#include "lluuid.h"
|
||||||
|
|
||||||
|
//std
|
||||||
|
#include <set>
|
||||||
|
//boost
|
||||||
|
#include "boost/multi_index_container.hpp"
|
||||||
|
#include "boost/multi_index/ordered_index.hpp"
|
||||||
|
#include "boost/multi_index/mem_fun.hpp"
|
||||||
|
|
||||||
|
class LLDrawable;
|
||||||
|
|
||||||
|
|
||||||
|
class LLSculptIDSize
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct SizeSum
|
||||||
|
{
|
||||||
|
SizeSum(int size)
|
||||||
|
: mSizeSum(size)
|
||||||
|
{}
|
||||||
|
unsigned int mSizeSum;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Info
|
||||||
|
{
|
||||||
|
typedef boost::shared_ptr<SizeSum> PtrSizeSum;
|
||||||
|
|
||||||
|
Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId)
|
||||||
|
: mDrawable(drawable)
|
||||||
|
, mSize(size)
|
||||||
|
, mSharedSizeSum(sizeInfo)
|
||||||
|
, mSculptId(sculptId)
|
||||||
|
{}
|
||||||
|
|
||||||
|
const LLDrawable *mDrawable;
|
||||||
|
unsigned int mSize;
|
||||||
|
PtrSizeSum mSharedSizeSum;
|
||||||
|
LLUUID mSculptId;
|
||||||
|
|
||||||
|
inline const LLDrawable* getPtrLLDrawable() const { return mDrawable; }
|
||||||
|
inline unsigned int getSize() const { return mSize; }
|
||||||
|
inline unsigned int getSizeSum() const { return mSharedSizeSum->mSizeSum; }
|
||||||
|
inline LLUUID getSculptId() const { return mSculptId; }
|
||||||
|
PtrSizeSum getSizeInfo() { return mSharedSizeSum; }
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
//tags
|
||||||
|
struct tag_BY_DRAWABLE {};
|
||||||
|
struct tag_BY_SCULPT_ID {};
|
||||||
|
struct tag_BY_SIZE {};
|
||||||
|
|
||||||
|
//container
|
||||||
|
typedef boost::multi_index_container <
|
||||||
|
Info,
|
||||||
|
boost::multi_index::indexed_by <
|
||||||
|
boost::multi_index::ordered_unique< boost::multi_index::tag<tag_BY_DRAWABLE>
|
||||||
|
, boost::multi_index::const_mem_fun<Info, const LLDrawable*, &Info::getPtrLLDrawable>
|
||||||
|
>
|
||||||
|
, boost::multi_index::ordered_non_unique<boost::multi_index::tag<tag_BY_SCULPT_ID>
|
||||||
|
, boost::multi_index::const_mem_fun<Info, LLUUID, &Info::getSculptId>
|
||||||
|
>
|
||||||
|
, boost::multi_index::ordered_non_unique < boost::multi_index::tag<tag_BY_SIZE>
|
||||||
|
, boost::multi_index::const_mem_fun < Info, unsigned int, &Info::getSizeSum >
|
||||||
|
>
|
||||||
|
>
|
||||||
|
> container;
|
||||||
|
|
||||||
|
//views
|
||||||
|
typedef container::index<tag_BY_DRAWABLE>::type container_BY_DRAWABLE_view;
|
||||||
|
typedef container::index<tag_BY_SCULPT_ID>::type container_BY_SCULPT_ID_view;
|
||||||
|
typedef container::index<tag_BY_SIZE>::type container_BY_SIZE_view;
|
||||||
|
|
||||||
|
private:
|
||||||
|
LLSculptIDSize()
|
||||||
|
{}
|
||||||
|
|
||||||
|
public:
|
||||||
|
static LLSculptIDSize & instance()
|
||||||
|
{
|
||||||
|
static LLSculptIDSize inst;
|
||||||
|
return inst;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
void inc(const LLDrawable *pdrawable, int sz);
|
||||||
|
void dec(const LLDrawable *pdrawable);
|
||||||
|
void rem(const LLUUID &sculptId);
|
||||||
|
|
||||||
|
inline void addToUnloaded(const LLUUID &sculptId) { mMarkAsUnloaded.insert(sculptId); }
|
||||||
|
inline void remFromUnloaded(const LLUUID &sculptId) { mMarkAsUnloaded.erase(sculptId); }
|
||||||
|
inline bool isUnloaded(const LLUUID &sculptId) const { return mMarkAsUnloaded.end() != mMarkAsUnloaded.find(sculptId); }
|
||||||
|
inline void clearUnloaded() { mMarkAsUnloaded.clear(); }
|
||||||
|
|
||||||
|
void resetSizeSum(const LLUUID &sculptId);
|
||||||
|
|
||||||
|
inline const container & getSizeInfo() const { return mSizeInfo; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
container mSizeInfo;
|
||||||
|
typedef std::set<LLUUID> std_LLUUID;
|
||||||
|
std_LLUUID mMarkAsUnloaded;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -369,7 +369,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Select the object, parents and children.
|
// Select the object, parents and children.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end)
|
LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end, BOOL ignore_select_owned)
|
||||||
{
|
{
|
||||||
llassert( obj );
|
llassert( obj );
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canSelectObject(obj))
|
if (!canSelectObject(obj,ignore_select_owned))
|
||||||
{
|
{
|
||||||
//make_ui_sound("UISndInvalidOp");
|
//make_ui_sound("UISndInvalidOp");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1211,7 +1211,7 @@ void LLSelectMgr::setGridMode(EGridMode mode)
|
|||||||
updateSelectionCenter();
|
updateSelectionCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale)
|
void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale, bool for_snap_guides)
|
||||||
{
|
{
|
||||||
mGridObjects.cleanupNodes();
|
mGridObjects.cleanupNodes();
|
||||||
|
|
||||||
@@ -1236,7 +1236,15 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
|
|||||||
}
|
}
|
||||||
else if (mGridMode == GRID_MODE_REF_OBJECT && first_grid_object && first_grid_object->mDrawable.notNull())
|
else if (mGridMode == GRID_MODE_REF_OBJECT && first_grid_object && first_grid_object->mDrawable.notNull())
|
||||||
{
|
{
|
||||||
mGridRotation = first_grid_object->getRenderRotation();
|
LLSelectNode *node = mSelectedObjects->findNode(first_grid_object);
|
||||||
|
if (!for_snap_guides && node)
|
||||||
|
{
|
||||||
|
mGridRotation = node->mSavedRotation;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mGridRotation = first_grid_object->getRenderRotation();
|
||||||
|
}
|
||||||
|
|
||||||
LLVector4a min_extents(F32_MAX);
|
LLVector4a min_extents(F32_MAX);
|
||||||
LLVector4a max_extents(-F32_MAX);
|
LLVector4a max_extents(-F32_MAX);
|
||||||
@@ -6823,7 +6831,7 @@ void LLSelectMgr::validateSelection()
|
|||||||
getSelection()->applyToObjects(&func);
|
getSelection()->applyToObjects(&func);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
|
BOOL LLSelectMgr::canSelectObject(LLViewerObject* object, BOOL ignore_select_owned)
|
||||||
{
|
{
|
||||||
// Never select dead objects
|
// Never select dead objects
|
||||||
if (!object || object->isDead())
|
if (!object || object->isDead())
|
||||||
@@ -6836,11 +6844,14 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) ||
|
if(!ignore_select_owned)
|
||||||
(gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced())))
|
|
||||||
{
|
{
|
||||||
// only select my own objects
|
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) ||
|
||||||
return FALSE;
|
(gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced())))
|
||||||
|
{
|
||||||
|
// only select my own objects
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't select orphans
|
// Can't select orphans
|
||||||
@@ -7039,7 +7050,7 @@ F32 LLObjectSelection::getSelectedLinksetCost()
|
|||||||
LLSelectNode* node = *iter;
|
LLSelectNode* node = *iter;
|
||||||
LLViewerObject* object = node->getObject();
|
LLViewerObject* object = node->getObject();
|
||||||
|
|
||||||
if (object)
|
if (object && !object->isAttachment())
|
||||||
{
|
{
|
||||||
LLViewerObject* root = static_cast<LLViewerObject*>(object->getRoot());
|
LLViewerObject* root = static_cast<LLViewerObject*>(object->getRoot());
|
||||||
if (root)
|
if (root)
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ public:
|
|||||||
//
|
//
|
||||||
// *NOTE: You must hold on to the object selection handle, otherwise
|
// *NOTE: You must hold on to the object selection handle, otherwise
|
||||||
// the objects will be automatically deselected in 1 frame.
|
// the objects will be automatically deselected in 1 frame.
|
||||||
LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE);
|
LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE, BOOL ignore_select_owned = FALSE);
|
||||||
|
|
||||||
// For when you want just a child object.
|
// For when you want just a child object.
|
||||||
LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES);
|
LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES);
|
||||||
@@ -491,7 +491,7 @@ public:
|
|||||||
void clearGridObjects();
|
void clearGridObjects();
|
||||||
void setGridMode(EGridMode mode);
|
void setGridMode(EGridMode mode);
|
||||||
EGridMode getGridMode() { return mGridMode; }
|
EGridMode getGridMode() { return mGridMode; }
|
||||||
void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale);
|
void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale, bool for_snap_guides = false);
|
||||||
|
|
||||||
BOOL getTEMode() { return mTEMode; }
|
BOOL getTEMode() { return mTEMode; }
|
||||||
void setTEMode(BOOL b) { mTEMode = b; }
|
void setTEMode(BOOL b) { mTEMode = b; }
|
||||||
@@ -573,7 +573,7 @@ public:
|
|||||||
void validateSelection();
|
void validateSelection();
|
||||||
|
|
||||||
// returns TRUE if it is possible to select this object
|
// returns TRUE if it is possible to select this object
|
||||||
BOOL canSelectObject(LLViewerObject* object);
|
BOOL canSelectObject(LLViewerObject* object, BOOL ignore_select_owned = FALSE);
|
||||||
|
|
||||||
// Returns TRUE if the viewer has information on all selected objects
|
// Returns TRUE if the viewer has information on all selected objects
|
||||||
BOOL selectGetAllRootsValid();
|
BOOL selectGetAllRootsValid();
|
||||||
|
|||||||
@@ -78,22 +78,24 @@ void LLSkinningUtil::initSkinningMatrixPalette(
|
|||||||
LLVOAvatar *avatar,
|
LLVOAvatar *avatar,
|
||||||
bool relative_to_avatar)
|
bool relative_to_avatar)
|
||||||
{
|
{
|
||||||
|
LLVector4a pos = LLVector4a::getZero();
|
||||||
|
if (relative_to_avatar)
|
||||||
|
{
|
||||||
|
pos.load3(avatar->getPosition().mV);
|
||||||
|
pos.mul(-1.f);
|
||||||
|
}
|
||||||
|
|
||||||
initJointNums(const_cast<LLMeshSkinInfo*>(skin), avatar);
|
initJointNums(const_cast<LLMeshSkinInfo*>(skin), avatar);
|
||||||
for (U32 j = 0; j < (U32)count; ++j)
|
for (U32 j = 0; j < (U32)count; ++j)
|
||||||
{
|
{
|
||||||
LLJoint *joint = avatar->getJoint(skin->mJointNums[j]);
|
LLJoint *joint = avatar->getJoint(skin->mJointNums[j]);
|
||||||
if (joint)
|
if (joint)
|
||||||
{
|
{
|
||||||
LLMatrix4a bind;
|
LLMatrix4a bind;
|
||||||
bind.loadu((F32*)skin->mInvBindMatrix[j].mMatrix);
|
bind.loadu((F32*)skin->mInvBindMatrix[j].mMatrix);
|
||||||
if (relative_to_avatar)
|
LLMatrix4a world = joint->getWorldMatrix();
|
||||||
{
|
world.getRow<3>().add(pos); // Append pos into world matrix.
|
||||||
LLMatrix4a trans = joint->getWorldMatrix();
|
mat[j].setMul(world, bind);
|
||||||
trans.translate_affine(avatar->getPosition() * -1.f);
|
|
||||||
mat[j].setMul(trans, bind);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mat[j].setMul(joint->getWorldMatrix(), bind);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ BOOL LLSpatialGroup::sNoDelete = FALSE;
|
|||||||
static F32 sLastMaxTexPriority = 1.f;
|
static F32 sLastMaxTexPriority = 1.f;
|
||||||
static F32 sCurMaxTexPriority = 1.f;
|
static F32 sCurMaxTexPriority = 1.f;
|
||||||
|
|
||||||
|
BOOL LLSpatialPartition::sTeleportRequested = FALSE;
|
||||||
|
|
||||||
//BOOL LLSpatialPartition::sFreezeState = FALSE;
|
//BOOL LLSpatialPartition::sFreezeState = FALSE;
|
||||||
|
|
||||||
//static counter for frame to switch LOD on
|
//static counter for frame to switch LOD on
|
||||||
@@ -1309,7 +1311,7 @@ void LLSpatialPartition::restoreGL()
|
|||||||
|
|
||||||
void LLSpatialPartition::resetVertexBuffers()
|
void LLSpatialPartition::resetVertexBuffers()
|
||||||
{
|
{
|
||||||
LLOctreeDirty dirty;
|
LLOctreeDirty dirty(sTeleportRequested);
|
||||||
dirty.traverse(mOctree);
|
dirty.traverse(mOctree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,8 @@ public:
|
|||||||
U32 mVertexDataMask;
|
U32 mVertexDataMask;
|
||||||
F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25);
|
F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25);
|
||||||
BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering
|
BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering
|
||||||
|
|
||||||
|
static BOOL sTeleportRequested; //started to issue a teleport request
|
||||||
};
|
};
|
||||||
|
|
||||||
// class for creating bridges between spatial partitions
|
// class for creating bridges between spatial partitions
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ void LLTextureBar::draw()
|
|||||||
{
|
{
|
||||||
color = LLColor4::green4;
|
color = LLColor4::green4;
|
||||||
}
|
}
|
||||||
else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_NONE)
|
else if (mImagep->getBoostLevel() > LLGLTexture::BOOST_ALM)
|
||||||
{
|
{
|
||||||
color = LLColor4::magenta;
|
color = LLColor4::magenta;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,16 @@ bool handleStateMachineMaxTimeChanged(const LLSD& newvalue)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool sInwlfPanelUpdate;
|
||||||
|
static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue)
|
||||||
|
{
|
||||||
|
if (!sInwlfPanelUpdate && isAgentAvatarValid())
|
||||||
|
{
|
||||||
|
gAgentAvatarp->setHoverIfRegionEnabled();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static bool handleSetShaderChanged(const LLSD& newvalue)
|
static bool handleSetShaderChanged(const LLSD& newvalue)
|
||||||
{
|
{
|
||||||
// changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache
|
// changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache
|
||||||
@@ -836,6 +846,7 @@ void settings_setup_listeners()
|
|||||||
gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2));
|
gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2));
|
||||||
gSavedSettings.getControl("AlchemyWLCloudTexture")->getSignal()->connect(boost::bind(&handleWindlightCloudChanged, _2));
|
gSavedSettings.getControl("AlchemyWLCloudTexture")->getSignal()->connect(boost::bind(&handleWindlightCloudChanged, _2));
|
||||||
|
|
||||||
|
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&handleAvatarHoverOffsetChanged, _2));
|
||||||
gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||||
gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||||
gSavedSettings.getControl("AscentAvatarZModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
gSavedSettings.getControl("AscentAvatarZModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
#include "llselectmgr.h"
|
#include "llselectmgr.h"
|
||||||
#include "llrendersphere.h"
|
#include "llrendersphere.h"
|
||||||
#include "lltooldraganddrop.h"
|
#include "lltooldraganddrop.h"
|
||||||
|
#include "lluiavatar.h"
|
||||||
#include "llviewercamera.h"
|
#include "llviewercamera.h"
|
||||||
#include "llviewertexturelist.h"
|
#include "llviewertexturelist.h"
|
||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
@@ -98,7 +99,7 @@
|
|||||||
#include "llvowlsky.h"
|
#include "llvowlsky.h"
|
||||||
#include "llmanip.h"
|
#include "llmanip.h"
|
||||||
#include "llmediaentry.h"
|
#include "llmediaentry.h"
|
||||||
|
#include "llmeshrepository.h"
|
||||||
// [RLVa:KB]
|
// [RLVa:KB]
|
||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
#include "rlvlocks.h"
|
#include "rlvlocks.h"
|
||||||
@@ -137,7 +138,7 @@ const S32 MAX_OBJECT_BINARY_DATA_SIZE = 60 + 16;
|
|||||||
static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object");
|
static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object");
|
||||||
|
|
||||||
// static
|
// static
|
||||||
LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
|
LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, S32 flags)
|
||||||
{
|
{
|
||||||
LLViewerObject *res = NULL;
|
LLViewerObject *res = NULL;
|
||||||
LL_RECORD_BLOCK_TIME(FTM_CREATE_OBJECT);
|
LL_RECORD_BLOCK_TIME(FTM_CREATE_OBJECT);
|
||||||
@@ -165,6 +166,12 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
|
|||||||
}
|
}
|
||||||
res = gAgentAvatarp;
|
res = gAgentAvatarp;
|
||||||
}
|
}
|
||||||
|
else if (flags & CO_FLAG_UI_AVATAR)
|
||||||
|
{
|
||||||
|
LLUIAvatar *ui_avatar = new LLUIAvatar(id, pcode, regionp);
|
||||||
|
ui_avatar->initInstance();
|
||||||
|
res = ui_avatar;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp);
|
LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp);
|
||||||
@@ -2780,6 +2787,9 @@ struct LLFilenameAndTask
|
|||||||
{
|
{
|
||||||
LLUUID mTaskID;
|
LLUUID mTaskID;
|
||||||
std::string mFilename;
|
std::string mFilename;
|
||||||
|
|
||||||
|
// for sequencing in case of multiple updates
|
||||||
|
S16 mSerial;
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
static S32 sCount;
|
static S32 sCount;
|
||||||
LLFilenameAndTask()
|
LLFilenameAndTask()
|
||||||
@@ -2815,9 +2825,17 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum);
|
|
||||||
LLFilenameAndTask* ft = new LLFilenameAndTask;
|
LLFilenameAndTask* ft = new LLFilenameAndTask;
|
||||||
ft->mTaskID = task_id;
|
ft->mTaskID = task_id;
|
||||||
|
// we can receive multiple task updates simultaneously, make sure we will not rewrite newer with older update
|
||||||
|
msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, ft->mSerial);
|
||||||
|
|
||||||
|
if (ft->mSerial < object->mInventorySerialNum)
|
||||||
|
{
|
||||||
|
// viewer did some changes to inventory that were not saved yet.
|
||||||
|
LL_DEBUGS() << "Task inventory serial might be out of sync, server serial: " << ft->mSerial << " client serial: " << object->mInventorySerialNum << LL_ENDL;
|
||||||
|
object->mInventorySerialNum = ft->mSerial;
|
||||||
|
}
|
||||||
|
|
||||||
std::string unclean_filename;
|
std::string unclean_filename;
|
||||||
msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, unclean_filename);
|
msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, unclean_filename);
|
||||||
@@ -2871,9 +2889,13 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
|
|||||||
{
|
{
|
||||||
LLFilenameAndTask* ft = (LLFilenameAndTask*)user_data;
|
LLFilenameAndTask* ft = (LLFilenameAndTask*)user_data;
|
||||||
LLViewerObject* object = NULL;
|
LLViewerObject* object = NULL;
|
||||||
if(ft && (0 == error_code) &&
|
|
||||||
(object = gObjectList.findObject(ft->mTaskID)))
|
if (ft
|
||||||
|
&& (0 == error_code)
|
||||||
|
&& (object = gObjectList.findObject(ft->mTaskID))
|
||||||
|
&& ft->mSerial >= object->mInventorySerialNum)
|
||||||
{
|
{
|
||||||
|
object->mInventorySerialNum = ft->mSerial;
|
||||||
if (object->loadTaskInvFile(ft->mFilename))
|
if (object->loadTaskInvFile(ft->mFilename))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -4268,10 +4290,10 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry)
|
|||||||
if (getTE(te)->getMaterialParams().notNull())
|
if (getTE(te)->getMaterialParams().notNull())
|
||||||
{
|
{
|
||||||
const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID();
|
const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID();
|
||||||
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
|
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
|
||||||
|
|
||||||
const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID();
|
const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID();
|
||||||
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
|
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4393,14 +4415,14 @@ S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid)
|
|||||||
S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid)
|
S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid)
|
||||||
{
|
{
|
||||||
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
|
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
|
||||||
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid);
|
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid);
|
||||||
return setTENormalMapCore(te, image);
|
return setTENormalMapCore(te, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
S32 LLViewerObject::setTESpecularMap(const U8 te, const LLUUID& uuid)
|
S32 LLViewerObject::setTESpecularMap(const U8 te, const LLUUID& uuid)
|
||||||
{
|
{
|
||||||
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
|
LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture(
|
||||||
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid);
|
uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid);
|
||||||
return setTESpecularMapCore(te, image);
|
return setTESpecularMapCore(te, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5759,6 +5781,15 @@ void LLViewerObject::markForUpdate(BOOL priority)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LLViewerObject::markForUnload(BOOL priority)
|
||||||
|
{
|
||||||
|
if (mDrawable.notNull())
|
||||||
|
{
|
||||||
|
gPipeline.markRebuild(mDrawable, LLDrawable::FOR_UNLOAD, priority);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool LLViewerObject::isPermanentEnforced() const
|
bool LLViewerObject::isPermanentEnforced() const
|
||||||
{
|
{
|
||||||
return flagObjectPermanent() && (mRegionp != gAgent.getRegion()) && !gAgent.isGodlike();
|
return flagObjectPermanent() && (mRegionp != gAgent.getRegion()) && !gAgent.isGodlike();
|
||||||
|
|||||||
@@ -428,6 +428,7 @@ public:
|
|||||||
|
|
||||||
void recursiveMarkForUpdate(BOOL priority);
|
void recursiveMarkForUpdate(BOOL priority);
|
||||||
virtual void markForUpdate(BOOL priority);
|
virtual void markForUpdate(BOOL priority);
|
||||||
|
void markForUnload(BOOL priority);
|
||||||
void updateVolume(const LLVolumeParams& volume_params);
|
void updateVolume(const LLVolumeParams& volume_params);
|
||||||
virtual void updateSpatialExtents(LLVector4a& min, LLVector4a& max);
|
virtual void updateSpatialExtents(LLVector4a& min, LLVector4a& max);
|
||||||
virtual F32 getBinRadius();
|
virtual F32 getBinRadius();
|
||||||
@@ -696,6 +697,10 @@ public:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
virtual bool isAnimatedObject() const;
|
virtual bool isAnimatedObject() const;
|
||||||
|
|
||||||
|
// Flags for createObject
|
||||||
|
static const S32 CO_FLAG_UI_AVATAR = 1 << 1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// delete an item in the inventory, but don't tell the
|
// delete an item in the inventory, but don't tell the
|
||||||
// server. This is used internally by remove, update, and
|
// server. This is used internally by remove, update, and
|
||||||
@@ -706,8 +711,7 @@ protected:
|
|||||||
// updateInventory.
|
// updateInventory.
|
||||||
void doUpdateInventory(LLPointer<LLViewerInventoryItem>& item, U8 key, bool is_new);
|
void doUpdateInventory(LLPointer<LLViewerInventoryItem>& item, U8 key, bool is_new);
|
||||||
|
|
||||||
|
static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp, S32 flags = 0);
|
||||||
static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp);
|
|
||||||
|
|
||||||
BOOL setData(const U8 *datap, const U32 data_size);
|
BOOL setData(const U8 *datap, const U32 data_size);
|
||||||
|
|
||||||
|
|||||||
@@ -1990,12 +1990,12 @@ void LLViewerObjectList::resetObjectBeacons()
|
|||||||
mDebugBeacons.clear();
|
mDebugBeacons.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp)
|
LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp, S32 flags)
|
||||||
{
|
{
|
||||||
LLUUID fullid;
|
LLUUID fullid;
|
||||||
fullid.generate();
|
fullid.generate();
|
||||||
|
|
||||||
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
|
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp, flags);
|
||||||
if (!objectp)
|
if (!objectp)
|
||||||
{
|
{
|
||||||
// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << LL_ENDL;
|
// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << LL_ENDL;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
inline LLViewerObject *findObject(const LLUUID &id) const;
|
inline LLViewerObject *findObject(const LLUUID &id) const;
|
||||||
inline LLVOAvatar *findAvatar(const LLUUID &id) const;
|
inline LLVOAvatar *findAvatar(const LLUUID &id) const;
|
||||||
LLViewerObject *createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp); // Create a viewer-side object
|
LLViewerObject *createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp, S32 flags = 0); // Create a viewer-side object
|
||||||
LLViewerObject *createObject(const LLPCode pcode, LLViewerRegion *regionp,
|
LLViewerObject *createObject(const LLPCode pcode, LLViewerRegion *regionp,
|
||||||
const LLUUID &uuid, const U32 local_id, const LLHost &sender);
|
const LLUUID &uuid, const U32 local_id, const LLHost &sender);
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size
|
|||||||
const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64;
|
const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64;
|
||||||
const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez;
|
const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez;
|
||||||
const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128;
|
const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128;
|
||||||
|
const S32 DEFAULT_ICON_DIMENTIONS = 32;
|
||||||
S32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256.
|
S32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256.
|
||||||
S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA;
|
S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA;
|
||||||
BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE;
|
BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE;
|
||||||
@@ -112,6 +113,8 @@ const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve
|
|||||||
const F32 desired_discard_bias_max = (F32)MAX_DISCARD_LEVEL; // max number of levels to reduce image quality by
|
const F32 desired_discard_bias_max = (F32)MAX_DISCARD_LEVEL; // max number of levels to reduce image quality by
|
||||||
const F64 log_2 = log(2.0);
|
const F64 log_2 = log(2.0);
|
||||||
|
|
||||||
|
const U32 DESIRED_NORMAL_TEXTURE_SIZE = (U32)LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
//namespace: LLViewerTextureAccess
|
//namespace: LLViewerTextureAccess
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
@@ -459,7 +462,7 @@ bool LLViewerTexture::isMemoryForTextureLow()
|
|||||||
|
|
||||||
LL_RECORD_BLOCK_TIME(FTM_TEXTURE_MEMORY_CHECK);
|
LL_RECORD_BLOCK_TIME(FTM_TEXTURE_MEMORY_CHECK);
|
||||||
|
|
||||||
static const S32Megabytes MIN_FREE_TEXTURE_MEMORY(5); //MB
|
static const S32Megabytes MIN_FREE_TEXTURE_MEMORY(20); //MB
|
||||||
static const S32Megabytes MIN_FREE_MAIN_MEMORY(100); //MB
|
static const S32Megabytes MIN_FREE_MAIN_MEMORY(100); //MB
|
||||||
|
|
||||||
bool low_mem = false;
|
bool low_mem = false;
|
||||||
@@ -690,7 +693,9 @@ void LLViewerTexture::setBoostLevel(S32 level)
|
|||||||
{
|
{
|
||||||
mBoostLevel = level;
|
mBoostLevel = level;
|
||||||
if(mBoostLevel != LLViewerTexture::BOOST_NONE &&
|
if(mBoostLevel != LLViewerTexture::BOOST_NONE &&
|
||||||
mBoostLevel != LLViewerTexture::BOOST_SELECTED)
|
mBoostLevel != LLViewerTexture::BOOST_ALM &&
|
||||||
|
mBoostLevel != LLViewerTexture::BOOST_SELECTED &&
|
||||||
|
mBoostLevel != LLViewerTexture::BOOST_ICON)
|
||||||
{
|
{
|
||||||
setNoDelete();
|
setNoDelete();
|
||||||
}
|
}
|
||||||
@@ -1524,15 +1529,31 @@ void LLViewerFetchedTexture::processTextureStats()
|
|||||||
{
|
{
|
||||||
mDesiredDiscardLevel = 0;
|
mDesiredDiscardLevel = 0;
|
||||||
}
|
}
|
||||||
|
else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
|
||||||
|
{
|
||||||
|
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
|
||||||
|
}
|
||||||
|
else if (mDontDiscard && mBoostLevel == LLGLTexture::BOOST_ICON)
|
||||||
|
{
|
||||||
|
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
|
||||||
|
{
|
||||||
|
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mDesiredDiscardLevel = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(!mFullWidth || !mFullHeight)
|
else if(!mFullWidth || !mFullHeight)
|
||||||
{
|
{
|
||||||
mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel);
|
mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
S32 desired_size = MAX_IMAGE_SIZE_DEFAULT; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
||||||
if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight)
|
if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight)
|
||||||
{
|
{
|
||||||
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
|
if (mFullWidth > desired_size || mFullHeight > desired_size)
|
||||||
{
|
{
|
||||||
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
||||||
}
|
}
|
||||||
@@ -1782,10 +1803,11 @@ void LLViewerFetchedTexture::updateVirtualSize()
|
|||||||
{
|
{
|
||||||
if(drawable->isRecentlyVisible())
|
if(drawable->isRecentlyVisible())
|
||||||
{
|
{
|
||||||
if (getBoostLevel() == LLViewerTexture::BOOST_NONE &&
|
if ((getBoostLevel() == LLViewerTexture::BOOST_NONE || getBoostLevel() == LLViewerTexture::BOOST_ALM)
|
||||||
drawable->getVObj() && drawable->getVObj()->isSelected())
|
&& drawable->getVObj()
|
||||||
{
|
&& drawable->getVObj()->isSelected())
|
||||||
setBoostLevel(LLViewerTexture::BOOST_SELECTED);
|
{
|
||||||
|
setBoostLevel(LLViewerTexture::BOOST_SELECTED);
|
||||||
}
|
}
|
||||||
addTextureStats(facep->getVirtualSize());
|
addTextureStats(facep->getVirtualSize());
|
||||||
setAdditionalDecodePriority(facep->getImportanceToCamera());
|
setAdditionalDecodePriority(facep->getImportanceToCamera());
|
||||||
@@ -1953,6 +1975,17 @@ bool LLViewerFetchedTexture::updateFetch()
|
|||||||
addToCreateTexture();
|
addToCreateTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mBoostLevel == LLGLTexture::BOOST_ICON)
|
||||||
|
{
|
||||||
|
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
|
||||||
|
{
|
||||||
|
// scale oversized icon, no need to give more work to gl
|
||||||
|
mRawImage->scale(expected_width, expected_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2057,7 +2090,7 @@ bool LLViewerFetchedTexture::updateFetch()
|
|||||||
// Load the texture progressively: we try not to rush to the desired discard too fast.
|
// Load the texture progressively: we try not to rush to the desired discard too fast.
|
||||||
// If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps
|
// If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps
|
||||||
// This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around
|
// This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around
|
||||||
S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_NONE) ? 2 : 1;
|
S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_ALM) ? 2 : 1;
|
||||||
if (current_discard < 0)
|
if (current_discard < 0)
|
||||||
{
|
{
|
||||||
desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
|
desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
|
||||||
@@ -2688,7 +2721,7 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level)
|
|||||||
|
|
||||||
if(mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= discard_level)
|
if(mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= discard_level)
|
||||||
{
|
{
|
||||||
if(mSavedRawDiscardLevel != discard_level)
|
if (mSavedRawDiscardLevel != discard_level && mBoostLevel != BOOST_ICON)
|
||||||
{
|
{
|
||||||
mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents());
|
mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents());
|
||||||
mRawImage->copy(getSavedRawImage());
|
mRawImage->copy(getSavedRawImage());
|
||||||
@@ -2792,7 +2825,24 @@ void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* im
|
|||||||
{
|
{
|
||||||
if(mCachedRawImage.notNull())
|
if(mCachedRawImage.notNull())
|
||||||
mCachedRawImage->setInCache(false);
|
mCachedRawImage->setInCache(false);
|
||||||
mCachedRawImage = imageraw;
|
if (mBoostLevel == LLGLTexture::BOOST_ICON)
|
||||||
|
{
|
||||||
|
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)
|
||||||
|
{
|
||||||
|
mCachedRawImage = new LLImageRaw(expected_width, expected_height, imageraw->getComponents());
|
||||||
|
mCachedRawImage->copyScaled(imageraw);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCachedRawImage = imageraw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCachedRawImage = imageraw;
|
||||||
|
}
|
||||||
if(mCachedRawImage.notNull())
|
if(mCachedRawImage.notNull())
|
||||||
mCachedRawImage->setInCache(true);
|
mCachedRawImage->setInCache(true);
|
||||||
mCachedRawDiscardLevel = discard_level;
|
mCachedRawDiscardLevel = discard_level;
|
||||||
@@ -2900,7 +2950,24 @@ void LLViewerFetchedTexture::saveRawImage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
mSavedRawDiscardLevel = mRawDiscardLevel;
|
mSavedRawDiscardLevel = mRawDiscardLevel;
|
||||||
mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
|
if (mBoostLevel == LLGLTexture::BOOST_ICON)
|
||||||
|
{
|
||||||
|
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS;
|
||||||
|
if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)
|
||||||
|
{
|
||||||
|
mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents());
|
||||||
|
mSavedRawImage->copyScaled(mRawImage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
|
||||||
|
}
|
||||||
|
|
||||||
if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel)
|
if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel)
|
||||||
{
|
{
|
||||||
@@ -3079,6 +3146,10 @@ void LLViewerLODTexture::processTextureStats()
|
|||||||
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
|
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
|
||||||
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
||||||
}
|
}
|
||||||
|
else if (!LLPipeline::sRenderDeferred && mBoostLevel == LLGLTexture::BOOST_ALM)
|
||||||
|
{
|
||||||
|
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
|
||||||
|
}
|
||||||
else if (mBoostLevel < LLGLTexture::BOOST_HIGH && mMaxVirtualSize <= 10.f)
|
else if (mBoostLevel < LLGLTexture::BOOST_HIGH && mMaxVirtualSize <= 10.f)
|
||||||
{
|
{
|
||||||
// If the image has not been significantly visible in a while, we don't want it
|
// If the image has not been significantly visible in a while, we don't want it
|
||||||
@@ -3101,6 +3172,7 @@ void LLViewerLODTexture::processTextureStats()
|
|||||||
if (mKnownDrawWidth && mKnownDrawHeight)
|
if (mKnownDrawWidth && mKnownDrawHeight)
|
||||||
{
|
{
|
||||||
S32 draw_texels = mKnownDrawWidth * mKnownDrawHeight;
|
S32 draw_texels = mKnownDrawWidth * mKnownDrawHeight;
|
||||||
|
draw_texels = llclamp(draw_texels, MIN_IMAGE_AREA, MAX_IMAGE_AREA);
|
||||||
|
|
||||||
// Use log_4 because we're in square-pixel space, so an image
|
// Use log_4 because we're in square-pixel space, so an image
|
||||||
// with twice the width and twice the height will have mTexelsPerImage
|
// with twice the width and twice the height will have mTexelsPerImage
|
||||||
@@ -3138,8 +3210,13 @@ void LLViewerLODTexture::processTextureStats()
|
|||||||
discard_level = floorf(discard_level);
|
discard_level = floorf(discard_level);
|
||||||
|
|
||||||
F32 min_discard = 0.f;
|
F32 min_discard = 0.f;
|
||||||
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
|
S32 desired_size = MAX_IMAGE_SIZE_DEFAULT; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
||||||
min_discard = 1.f; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
|
if (mBoostLevel <= LLGLTexture::BOOST_SCULPTED)
|
||||||
|
{
|
||||||
|
desired_size = DESIRED_NORMAL_TEXTURE_SIZE;
|
||||||
|
}
|
||||||
|
if (mFullWidth > desired_size || mFullHeight > desired_size)
|
||||||
|
min_discard = 1.f;
|
||||||
|
|
||||||
discard_level = llclamp(discard_level, min_discard, (F32)MAX_DISCARD_LEVEL);
|
discard_level = llclamp(discard_level, min_discard, (F32)MAX_DISCARD_LEVEL);
|
||||||
|
|
||||||
|
|||||||
@@ -1114,6 +1114,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||||||
mLastUpdateRequestCOFVersion(-1),
|
mLastUpdateRequestCOFVersion(-1),
|
||||||
mLastUpdateReceivedCOFVersion(-1),
|
mLastUpdateReceivedCOFVersion(-1),
|
||||||
mIsUIAvatar(false),
|
mIsUIAvatar(false),
|
||||||
|
mEnableDefaultMotions(true),
|
||||||
// <edit>
|
// <edit>
|
||||||
mHasPhysicsParameters( false ),
|
mHasPhysicsParameters( false ),
|
||||||
mIdleMinute(0),
|
mIdleMinute(0),
|
||||||
@@ -1233,9 +1234,6 @@ LLVOAvatar::~LLVOAvatar()
|
|||||||
LL_DEBUGS("Avatar") << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << LL_ENDL;
|
LL_DEBUGS("Avatar") << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << LL_ENDL;
|
||||||
|
|
||||||
std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer());
|
std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer());
|
||||||
#if USE_LL_APPEARANCE_CODE
|
|
||||||
mAttachmentPoints.clear();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mDead = TRUE;
|
mDead = TRUE;
|
||||||
|
|
||||||
@@ -1566,7 +1564,7 @@ void LLVOAvatar::cleanupClass()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void LLVOAvatar::initInstance(void)
|
void LLVOAvatar::initInstance()
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// register motions
|
// register motions
|
||||||
@@ -1709,6 +1707,11 @@ void LLVOAvatar::onShift(const LLVector4a& shift_vector)
|
|||||||
|
|
||||||
void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
|
void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
|
||||||
{
|
{
|
||||||
|
if (mDrawable.isNull())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isImpostor() && !needsImpostorUpdate())
|
if (isImpostor() && !needsImpostorUpdate())
|
||||||
{
|
{
|
||||||
LLVector3 delta = getRenderPosition() -
|
LLVector3 delta = getRenderPosition() -
|
||||||
@@ -1889,13 +1892,23 @@ void LLVOAvatar::renderCollisionVolumes()
|
|||||||
static F32 sphere_scale = 1.0f;
|
static F32 sphere_scale = 1.0f;
|
||||||
static F32 center_dot_scale = 0.05f;
|
static F32 center_dot_scale = 0.05f;
|
||||||
|
|
||||||
static LLVector3 CV_COLOR_OCCLUDED(0.0f, 0.0f, 1.0f);
|
static LLVector3 BLUE(0.0f, 0.0f, 1.0f);
|
||||||
static LLVector3 CV_COLOR_VISIBLE(0.5f, 0.5f, 1.0f);
|
static LLVector3 PASTEL_BLUE(0.5f, 0.5f, 1.0f);
|
||||||
static LLVector3 DOT_COLOR_OCCLUDED(1.0f, 1.0f, 1.0f);
|
static LLVector3 RED(1.0f, 0.0f, 0.0f);
|
||||||
static LLVector3 DOT_COLOR_VISIBLE(1.0f, 1.0f, 1.0f);
|
static LLVector3 PASTEL_RED(1.0f, 0.5f, 0.5f);
|
||||||
|
static LLVector3 WHITE(1.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
render_sphere_and_line(begin_pos, end_pos, sphere_scale, CV_COLOR_OCCLUDED, CV_COLOR_VISIBLE);
|
|
||||||
render_sphere_and_line(begin_pos, end_pos, center_dot_scale, DOT_COLOR_OCCLUDED, DOT_COLOR_VISIBLE);
|
LLVector3 cv_color_occluded;
|
||||||
|
LLVector3 cv_color_visible;
|
||||||
|
LLVector3 dot_color_occluded(WHITE);
|
||||||
|
LLVector3 dot_color_visible(WHITE);
|
||||||
|
{
|
||||||
|
cv_color_occluded = BLUE;
|
||||||
|
cv_color_visible = PASTEL_BLUE;
|
||||||
|
}
|
||||||
|
render_sphere_and_line(begin_pos, end_pos, sphere_scale, cv_color_occluded, cv_color_visible);
|
||||||
|
render_sphere_and_line(begin_pos, end_pos, center_dot_scale, dot_color_occluded, dot_color_visible);
|
||||||
|
|
||||||
gGL.popMatrix();
|
gGL.popMatrix();
|
||||||
}
|
}
|
||||||
@@ -2123,6 +2136,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
|
|||||||
|
|
||||||
if (isSelf())
|
if (isSelf())
|
||||||
{
|
{
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
||||||
iter != mAttachmentPoints.end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
@@ -2134,6 +2148,12 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
|
|||||||
++attachment_iter)
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* attached_object = (*attachment_iter);
|
LLViewerObject* attached_object = (*attachment_iter);
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{
|
||||||
|
const LLViewerJointAttachment* attachment = iter.second;
|
||||||
|
const LLViewerObject* attached_object = iter.first;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (attached_object && !attached_object->isDead() && attachment->getValid())
|
if (attached_object && !attached_object->isDead() && attachment->getValid())
|
||||||
{
|
{
|
||||||
@@ -2187,6 +2207,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
|
|||||||
LLVector4a local_end = end;
|
LLVector4a local_end = end;
|
||||||
LLVector4a local_intersection;
|
LLVector4a local_intersection;
|
||||||
|
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
||||||
iter != mAttachmentPoints.end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
@@ -2198,6 +2219,11 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
|
|||||||
++attachment_iter)
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* attached_object = (*attachment_iter);
|
LLViewerObject* attached_object = (*attachment_iter);
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{
|
||||||
|
LLViewerObject* attached_object = iter.first;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, face_hit, &local_intersection, tex_coord, normal, tangent))
|
if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, face_hit, &local_intersection, tex_coord, normal, tangent))
|
||||||
{
|
{
|
||||||
@@ -2280,6 +2306,11 @@ void LLVOAvatar::buildCharacter()
|
|||||||
mAahMorph = getVisualParam( "Express_Open_Mouth" );
|
mAahMorph = getVisualParam( "Express_Open_Mouth" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Currently disabled for control avatars (animated objects), enabled for all others.
|
||||||
|
if (mEnableDefaultMotions)
|
||||||
|
{
|
||||||
|
startDefaultMotions();
|
||||||
|
}
|
||||||
startDefaultMotions();
|
startDefaultMotions();
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -2394,8 +2425,11 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset tweakable params to preserved state
|
// Reset tweakable params to preserved state
|
||||||
bool slam_params = true;
|
if (mLastProcessedAppearance)
|
||||||
applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params);
|
{
|
||||||
|
bool slam_params = true;
|
||||||
|
applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params);
|
||||||
|
}
|
||||||
updateVisualParams();
|
updateVisualParams();
|
||||||
|
|
||||||
// Restore attachment pos overrides
|
// Restore attachment pos overrides
|
||||||
@@ -7353,7 +7387,7 @@ void LLVOAvatar::lazyAttach()
|
|||||||
|
|
||||||
void LLVOAvatar::resetHUDAttachments()
|
void LLVOAvatar::resetHUDAttachments()
|
||||||
{
|
{
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
||||||
iter != mAttachmentPoints.end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
@@ -7366,6 +7400,14 @@ void LLVOAvatar::resetHUDAttachments()
|
|||||||
++attachment_iter)
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
const LLViewerObject* attached_object = (*attachment_iter);
|
const LLViewerObject* attached_object = (*attachment_iter);
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{{
|
||||||
|
const LLViewerJointAttachment* attachment = iter.second;
|
||||||
|
if (!attachment->getIsHUDAttachment())
|
||||||
|
continue;
|
||||||
|
const LLViewerObject* attached_object = iter.first;
|
||||||
|
#endif
|
||||||
if (attached_object && attached_object->mDrawable.notNull())
|
if (attached_object && attached_object->mDrawable.notNull())
|
||||||
{
|
{
|
||||||
gPipeline.markMoved(attached_object->mDrawable);
|
gPipeline.markMoved(attached_object->mDrawable);
|
||||||
@@ -7377,6 +7419,7 @@ void LLVOAvatar::resetHUDAttachments()
|
|||||||
|
|
||||||
void LLVOAvatar::rebuildRiggedAttachments( void )
|
void LLVOAvatar::rebuildRiggedAttachments( void )
|
||||||
{
|
{
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for ( attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter )
|
for ( attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter )
|
||||||
{
|
{
|
||||||
LLViewerJointAttachment* pAttachment = iter->second;
|
LLViewerJointAttachment* pAttachment = iter->second;
|
||||||
@@ -7386,6 +7429,12 @@ void LLVOAvatar::rebuildRiggedAttachments( void )
|
|||||||
attachmentIter != attachmentIterEnd; ++attachmentIter)
|
attachmentIter != attachmentIterEnd; ++attachmentIter)
|
||||||
{
|
{
|
||||||
const LLViewerObject* pAttachedObject = *attachmentIter;
|
const LLViewerObject* pAttachedObject = *attachmentIter;
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{
|
||||||
|
const LLViewerObject* pAttachedObject = iter.first;
|
||||||
|
const LLViewerJointAttachment* pAttachment = iter.second;
|
||||||
|
#endif
|
||||||
if ( pAttachment && pAttachedObject->mDrawable.notNull() )
|
if ( pAttachment && pAttachedObject->mDrawable.notNull() )
|
||||||
{
|
{
|
||||||
gPipeline.markRebuild(pAttachedObject->mDrawable);
|
gPipeline.markRebuild(pAttachedObject->mDrawable);
|
||||||
@@ -7568,7 +7617,10 @@ void LLVOAvatar::getOffObject()
|
|||||||
mRoot->setRotation(cur_rotation_world);
|
mRoot->setRotation(cur_rotation_world);
|
||||||
mRoot->getXform()->update();
|
mRoot->getXform()->update();
|
||||||
|
|
||||||
|
if (mEnableDefaultMotions)
|
||||||
|
{
|
||||||
startMotion(ANIM_AGENT_BODY_NOISE);
|
startMotion(ANIM_AGENT_BODY_NOISE);
|
||||||
|
}
|
||||||
|
|
||||||
if (isSelf())
|
if (isSelf())
|
||||||
{
|
{
|
||||||
@@ -7703,6 +7755,7 @@ LLViewerObject* LLVOAvatar::getWornAttachment( const LLUUID& inv_item_id )
|
|||||||
|
|
||||||
LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const
|
LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const
|
||||||
{
|
{
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for(attachment_map_t::const_iterator attachment_points_iter = mAttachmentPoints.begin();
|
for(attachment_map_t::const_iterator attachment_points_iter = mAttachmentPoints.begin();
|
||||||
attachment_points_iter != gAgentAvatarp->mAttachmentPoints.end();
|
attachment_points_iter != gAgentAvatarp->mAttachmentPoints.end();
|
||||||
++attachment_points_iter)
|
++attachment_points_iter)
|
||||||
@@ -7713,6 +7766,11 @@ LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) cons
|
|||||||
++attachment_iter)
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
LLViewerObject *attached_object = (*attachment_iter);
|
LLViewerObject *attached_object = (*attachment_iter);
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{
|
||||||
|
LLViewerObject* attached_object = iter.first;
|
||||||
|
#endif
|
||||||
if (attached_object &&
|
if (attached_object &&
|
||||||
attached_object->getID() == target_id)
|
attached_object->getID() == target_id)
|
||||||
{
|
{
|
||||||
@@ -8563,6 +8621,7 @@ BOOL LLVOAvatar::hasHUDAttachment() const
|
|||||||
LLBBox LLVOAvatar::getHUDBBox() const
|
LLBBox LLVOAvatar::getHUDBBox() const
|
||||||
{
|
{
|
||||||
LLBBox bbox;
|
LLBBox bbox;
|
||||||
|
#if SLOW_ATTACHMENT_LIST
|
||||||
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
||||||
iter != mAttachmentPoints.end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
@@ -8575,6 +8634,14 @@ LLBBox LLVOAvatar::getHUDBBox() const
|
|||||||
++attachment_iter)
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
const LLViewerObject* attached_object = (*attachment_iter);
|
const LLViewerObject* attached_object = (*attachment_iter);
|
||||||
|
#else
|
||||||
|
for(auto& iter : mAttachedObjectsVector)
|
||||||
|
{{{
|
||||||
|
const LLViewerJointAttachment* attachment = iter.second;
|
||||||
|
if (!attachment || !attachment->getIsHUDAttachment())
|
||||||
|
continue;
|
||||||
|
const LLViewerObject* attached_object = iter.first;
|
||||||
|
#endif
|
||||||
if (attached_object == NULL)
|
if (attached_object == NULL)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL;
|
LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
#include "llviewertexlayer.h"
|
#include "llviewertexlayer.h"
|
||||||
#include "material_codes.h" // LL_MCODE_END
|
#include "material_codes.h" // LL_MCODE_END
|
||||||
#include "llviewerstats.h"
|
#include "llviewerstats.h"
|
||||||
|
#include "llvovolume.h"
|
||||||
#include "llavatarname.h"
|
#include "llavatarname.h"
|
||||||
|
|
||||||
//<singu>
|
//<singu>
|
||||||
@@ -477,6 +477,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool mIsUIAvatar;
|
bool mIsUIAvatar;
|
||||||
|
bool mEnableDefaultMotions;
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Morph masks
|
// Morph masks
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
#include "llvocache.h"
|
#include "llvocache.h"
|
||||||
#include "llmaterialmgr.h"
|
#include "llmaterialmgr.h"
|
||||||
|
#include "llsculptidsize.h"
|
||||||
|
|
||||||
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d)
|
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d)
|
||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
@@ -262,6 +263,7 @@ void LLVOVolume::markDead()
|
|||||||
{
|
{
|
||||||
if (!mDead)
|
if (!mDead)
|
||||||
{
|
{
|
||||||
|
LLSculptIDSize::instance().rem(getVolume()->getParams().getSculptID());
|
||||||
if(getMDCImplCount() > 0)
|
if(getMDCImplCount() > 0)
|
||||||
{
|
{
|
||||||
LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
|
LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
|
||||||
@@ -1078,8 +1080,10 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
else if (NO_LOD == lod)
|
||||||
|
{
|
||||||
|
LLSculptIDSize::instance().resetSizeSum(volume_params.getSculptID());
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1304,7 +1308,16 @@ BOOL LLVOVolume::updateLOD()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL lod_changed = calcLOD();
|
BOOL lod_changed = FALSE;
|
||||||
|
|
||||||
|
if (!LLSculptIDSize::instance().isUnloaded(getVolume()->getParams().getSculptID()))
|
||||||
|
{
|
||||||
|
lod_changed = calcLOD();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (lod_changed)
|
if (lod_changed)
|
||||||
{
|
{
|
||||||
@@ -3346,6 +3359,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
|
static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
|
||||||
static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
|
static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
|
||||||
static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
|
static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
|
||||||
|
static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
|
||||||
static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
|
static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
|
||||||
|
|
||||||
static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
|
static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
|
||||||
@@ -3354,6 +3368,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
|
|
||||||
F32 shame = 0;
|
F32 shame = 0;
|
||||||
|
|
||||||
|
U32 invisi = 0;
|
||||||
U32 shiny = 0;
|
U32 shiny = 0;
|
||||||
U32 glow = 0;
|
U32 glow = 0;
|
||||||
U32 alpha = 0;
|
U32 alpha = 0;
|
||||||
@@ -3384,7 +3399,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_triangles == 0)
|
if (num_triangles <= 0)
|
||||||
{
|
{
|
||||||
num_triangles = 4;
|
num_triangles = 4;
|
||||||
}
|
}
|
||||||
@@ -3395,10 +3410,10 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
{
|
{
|
||||||
// base cost is dependent on mesh complexity
|
// base cost is dependent on mesh complexity
|
||||||
// note that 3 is the highest LOD as of the time of this coding.
|
// note that 3 is the highest LOD as of the time of this coding.
|
||||||
S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
|
S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(), getLOD());
|
||||||
if ( size > 0)
|
if ( size > 0)
|
||||||
{
|
{
|
||||||
if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this))
|
if (isRiggedMesh())
|
||||||
{
|
{
|
||||||
// weighted attachment - 1 point for every 3 bytes
|
// weighted attachment - 1 point for every 3 bytes
|
||||||
weighted_mesh = 1;
|
weighted_mesh = 1;
|
||||||
@@ -3461,6 +3476,10 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
{
|
{
|
||||||
alpha = 1;
|
alpha = 1;
|
||||||
}
|
}
|
||||||
|
else if (img && img->getPrimaryFormat() == GL_ALPHA)
|
||||||
|
{
|
||||||
|
invisi = 1;
|
||||||
|
}
|
||||||
if (face->hasMedia())
|
if (face->hasMedia())
|
||||||
{
|
{
|
||||||
media_faces++;
|
media_faces++;
|
||||||
@@ -3514,6 +3533,11 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||||||
shame *= alpha * ARC_ALPHA_COST;
|
shame *= alpha * ARC_ALPHA_COST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(invisi)
|
||||||
|
{
|
||||||
|
shame *= invisi * ARC_INVISI_COST;
|
||||||
|
}
|
||||||
|
|
||||||
if (glow)
|
if (glow)
|
||||||
{
|
{
|
||||||
shame *= glow * ARC_GLOW_MULT;
|
shame *= glow * ARC_GLOW_MULT;
|
||||||
|
|||||||
@@ -2514,7 +2514,7 @@ void LLPipeline::doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderT
|
|||||||
|
|
||||||
void LLPipeline::doOcclusion(LLCamera& camera)
|
void LLPipeline::doOcclusion(LLCamera& camera)
|
||||||
{
|
{
|
||||||
if (LLGLSLShader::sNoFixedFunction && LLPipeline::sUseOcclusion > 1 && sCull->hasOcclusionGroups())
|
if (LLGLSLShader::sNoFixedFunction && LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested && sCull->hasOcclusionGroups())
|
||||||
{
|
{
|
||||||
LLVertexBuffer::unbind();
|
LLVertexBuffer::unbind();
|
||||||
|
|
||||||
@@ -2668,6 +2668,52 @@ void LLPipeline::clearRebuildGroups()
|
|||||||
mGroupQ2Locked = false;
|
mGroupQ2Locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPipeline::clearRebuildDrawables()
|
||||||
|
{
|
||||||
|
// Clear all drawables on the priority build queue,
|
||||||
|
for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin();
|
||||||
|
iter != mBuildQ1.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLDrawable* drawablep = *iter;
|
||||||
|
if (drawablep && !drawablep->isDead())
|
||||||
|
{
|
||||||
|
drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
|
||||||
|
drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBuildQ1.clear();
|
||||||
|
|
||||||
|
// clear drawables on the non-priority build queue
|
||||||
|
for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin();
|
||||||
|
iter != mBuildQ2.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLDrawable* drawablep = *iter;
|
||||||
|
if (!drawablep->isDead())
|
||||||
|
{
|
||||||
|
drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBuildQ2.clear();
|
||||||
|
|
||||||
|
//clear all moving bridges
|
||||||
|
for (LLDrawable::drawable_vector_t::iterator iter = mMovedBridge.begin();
|
||||||
|
iter != mMovedBridge.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLDrawable *drawablep = *iter;
|
||||||
|
drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD);
|
||||||
|
}
|
||||||
|
mMovedBridge.clear();
|
||||||
|
|
||||||
|
//clear all moving drawables
|
||||||
|
for (LLDrawable::drawable_vector_t::iterator iter = mMovedList.begin();
|
||||||
|
iter != mMovedList.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLDrawable *drawablep = *iter;
|
||||||
|
drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD);
|
||||||
|
}
|
||||||
|
mMovedList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
static LLTrace::BlockTimerStatHandle FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups");
|
static LLTrace::BlockTimerStatHandle FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups");
|
||||||
|
|
||||||
void LLPipeline::rebuildPriorityGroups()
|
void LLPipeline::rebuildPriorityGroups()
|
||||||
@@ -2783,6 +2829,11 @@ void LLPipeline::updateGeom(F32 max_dtime, LLCamera& camera)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (drawablep->isUnload())
|
||||||
|
{
|
||||||
|
drawablep->unload();
|
||||||
|
drawablep->clearState(LLDrawable::FOR_UNLOAD);
|
||||||
|
}
|
||||||
if (updateDrawableGeom(drawablep, TRUE))
|
if (updateDrawableGeom(drawablep, TRUE))
|
||||||
{
|
{
|
||||||
drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
|
drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
|
||||||
@@ -6591,16 +6642,37 @@ void LLPipeline::resetVertexBuffers()
|
|||||||
|
|
||||||
static LLTrace::BlockTimerStatHandle FTM_RESET_VB("Reset VB");
|
static LLTrace::BlockTimerStatHandle FTM_RESET_VB("Reset VB");
|
||||||
|
|
||||||
void LLPipeline::doResetVertexBuffers()
|
void LLPipeline::doResetVertexBuffers(bool forced)
|
||||||
{
|
{
|
||||||
if ( !mResetVertexBuffers)
|
if ( !mResetVertexBuffers)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mResetVertexBuffers = false;
|
if(!forced && LLSpatialPartition::sTeleportRequested)
|
||||||
|
{
|
||||||
|
if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
|
||||||
|
{
|
||||||
|
return; //wait for teleporting to finish
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//teleporting aborted
|
||||||
|
LLSpatialPartition::sTeleportRequested = FALSE;
|
||||||
|
mResetVertexBuffers = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LL_RECORD_BLOCK_TIME(FTM_RESET_VB);
|
LL_RECORD_BLOCK_TIME(FTM_RESET_VB);
|
||||||
|
mResetVertexBuffers = false;
|
||||||
releaseVertexBuffers();
|
releaseVertexBuffers();
|
||||||
|
if(LLSpatialPartition::sTeleportRequested)
|
||||||
|
{
|
||||||
|
LLSpatialPartition::sTeleportRequested = FALSE;
|
||||||
|
|
||||||
|
LLWorld::getInstance()->clearAllVisibleObjects();
|
||||||
|
clearRebuildDrawables();
|
||||||
|
}
|
||||||
|
|
||||||
refreshCachedSettings();
|
refreshCachedSettings();
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public:
|
|||||||
void destroyGL();
|
void destroyGL();
|
||||||
void restoreGL();
|
void restoreGL();
|
||||||
void resetVertexBuffers();
|
void resetVertexBuffers();
|
||||||
void doResetVertexBuffers();
|
void doResetVertexBuffers(bool forced = false);
|
||||||
void resizeScreenTexture();
|
void resizeScreenTexture();
|
||||||
void releaseVertexBuffers();
|
void releaseVertexBuffers();
|
||||||
void releaseGLBuffers();
|
void releaseGLBuffers();
|
||||||
@@ -254,6 +254,7 @@ public:
|
|||||||
void rebuildPriorityGroups();
|
void rebuildPriorityGroups();
|
||||||
void rebuildGroups();
|
void rebuildGroups();
|
||||||
void clearRebuildGroups();
|
void clearRebuildGroups();
|
||||||
|
void clearRebuildDrawables();
|
||||||
|
|
||||||
//calculate pixel area of given box from vantage point of given camera
|
//calculate pixel area of given box from vantage point of given camera
|
||||||
static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
|
static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl)
|
|||||||
{
|
{
|
||||||
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
||||||
LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL;
|
LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL;
|
||||||
gAgentAvatarp->setHoverOffset(offset);
|
gAgentAvatarp->setHoverIfRegionEnabled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,19 +476,22 @@ void onHoverSliderMoved(const LLSD& val)
|
|||||||
F32 value = val.asFloat();
|
F32 value = val.asFloat();
|
||||||
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
||||||
LL_INFOS("Avatar") << "setting hover from slider moved" << offset[2] << LL_ENDL;
|
LL_INFOS("Avatar") << "setting hover from slider moved" << offset[2] << LL_ENDL;
|
||||||
gAgentAvatarp->setHoverOffset(offset, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool sInwlfPanelUpdate = false;
|
||||||
|
|
||||||
// Do send-to-the-server work when slider drag completes, or new
|
// Do send-to-the-server work when slider drag completes, or new
|
||||||
// value entered as text.
|
// value entered as text.
|
||||||
void onHoverSliderFinalCommit(const LLSD& val)
|
void onHoverSliderFinalCommit(const LLSD& val)
|
||||||
{
|
{
|
||||||
|
sInwlfPanelUpdate = true;
|
||||||
F32 value = val.asFloat();
|
F32 value = val.asFloat();
|
||||||
gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value);
|
gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value);
|
||||||
|
|
||||||
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
|
||||||
LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL;
|
LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL;
|
||||||
gAgentAvatarp->setHoverOffset(offset, true); // will send update this time.
|
gAgentAvatarp->setHoverIfRegionEnabled(); // will send update this time.
|
||||||
|
sInwlfPanelUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onRegionChanged()
|
void wlfPanel_AdvSettings::onRegionChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user