Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer
This commit is contained in:
@@ -244,6 +244,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterpostprocess.cpp
|
||||
llfloaterpreference.cpp
|
||||
llfloaterproperties.cpp
|
||||
llfloaterregiondebugconsole.cpp
|
||||
llfloaterregioninfo.cpp
|
||||
llfloaterreporter.cpp
|
||||
llfloatersearchreplace.cpp
|
||||
@@ -373,6 +374,7 @@ set(viewer_SOURCE_FILES
|
||||
llpanelmsgs.cpp
|
||||
llpanelnetwork.cpp
|
||||
llpanelobject.cpp
|
||||
llpanelpathfindingrebakenavmesh.cpp
|
||||
llpanelpermissions.cpp
|
||||
llpanelpick.cpp
|
||||
llpanelplace.cpp
|
||||
@@ -381,6 +383,15 @@ set(viewer_SOURCE_FILES
|
||||
llpanelweb.cpp
|
||||
llparcelselection.cpp
|
||||
llpatchvertexarray.cpp
|
||||
llpathfindingcharacter.cpp
|
||||
llpathfindingcharacterlist.cpp
|
||||
llpathfindinglinkset.cpp
|
||||
llpathfindinglinksetlist.cpp
|
||||
llpathfindingmanager.cpp
|
||||
llpathfindingnavmesh.cpp
|
||||
llpathfindingnavmeshstatus.cpp
|
||||
llpathfindingobject.cpp
|
||||
llpathfindingobjectlist.cpp
|
||||
llphysicsmotion.cpp
|
||||
llphysicsshapebuilderutil.cpp
|
||||
llpolymesh.cpp
|
||||
@@ -736,6 +747,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterpreference.h
|
||||
llfloaterperms.h
|
||||
llfloaterproperties.h
|
||||
llfloaterregiondebugconsole.h
|
||||
llfloaterregioninfo.h
|
||||
llfloaterreporter.h
|
||||
llfloatersearchreplace.h
|
||||
@@ -858,7 +870,6 @@ set(viewer_HEADER_FILES
|
||||
llpanellandmedia.h
|
||||
llpanellandobjects.h
|
||||
llpanellandoptions.h
|
||||
llpanelLCD.h
|
||||
llpanellogin.h
|
||||
llpanelmaininventory.h
|
||||
llpanelmorph.h
|
||||
@@ -866,6 +877,7 @@ set(viewer_HEADER_FILES
|
||||
llpanelmsgs.h
|
||||
llpanelnetwork.h
|
||||
llpanelobject.h
|
||||
llpanelpathfindingrebakenavmesh.h
|
||||
llpanelpermissions.h
|
||||
llpanelpick.h
|
||||
llpanelplace.h
|
||||
@@ -874,6 +886,15 @@ set(viewer_HEADER_FILES
|
||||
llpanelweb.h
|
||||
llparcelselection.h
|
||||
llpatchvertexarray.h
|
||||
llpathfindingcharacter.h
|
||||
llpathfindingcharacterlist.h
|
||||
llpathfindinglinkset.h
|
||||
llpathfindinglinksetlist.h
|
||||
llpathfindingmanager.h
|
||||
llpathfindingnavmesh.h
|
||||
llpathfindingnavmeshstatus.h
|
||||
llpathfindingobject.h
|
||||
llpathfindingobjectlist.h
|
||||
llphysicsmotion.h
|
||||
llphysicsshapebuilderutil.h
|
||||
llpolymesh.h
|
||||
@@ -1572,6 +1593,14 @@ if (LINUX)
|
||||
|
||||
set(product ${VIEWER_BRANDING_NAME_CAMELCASE}-${ARCH}-${viewer_VERSION})
|
||||
|
||||
if (FMODEX)
|
||||
if(MANIFEST_LIBRARIES)
|
||||
set(MANIFEST_LIBRARIES "${MANIFEST_LIBRARIES}|${FMODEX_LIBRARY}")
|
||||
else(MANIFEST_LIBRARIES)
|
||||
set(MANIFEST_LIBRARIES "--extra_libraries=${FMODEX_LIBRARY}")
|
||||
endif(MANIFEST_LIBRARIES)
|
||||
endif (FMODEX)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${product}.tar.bz2
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
@@ -1590,6 +1619,7 @@ if (LINUX)
|
||||
--dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
|
||||
--buildtype=${CMAKE_BUILD_TYPE}
|
||||
${MANIFEST_LIBRARIES}
|
||||
DEPENDS secondlife-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
)
|
||||
|
||||
|
||||
@@ -7242,6 +7242,17 @@
|
||||
<key>Value</key>
|
||||
<string>help/index.html</string>
|
||||
</map>
|
||||
<key>WebProfileURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL for Web Profiles</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>https://my.secondlife.com/[AGENT_NAME]</string>
|
||||
</map>
|
||||
<key>HighResSnapshot</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -13398,7 +13409,7 @@
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>10</integer>
|
||||
<integer>5</integer>
|
||||
</map>
|
||||
<key>SystemLanguage</key>
|
||||
<map>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @file colorFilterF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 gl_FragColor;
|
||||
#endif
|
||||
|
||||
uniform sampler2DRect tex0;
|
||||
uniform int layerCount;
|
||||
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec3 color = pow(floor(pow(vec3(texture2D(tex0, vary_texcoord0.st)),vec3(.6)) * layerCount)/layerCount,vec3(1.66666));
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
}
|
||||
@@ -23,9 +23,9 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
ATTRIBUTE ivec4 texture_index;
|
||||
ATTRIBUTE int texture_index;
|
||||
|
||||
VARYING_FLAT ivec4 vary_texture_index;
|
||||
VARYING_FLAT int vary_texture_index;
|
||||
|
||||
void passTextureIndex()
|
||||
{
|
||||
|
||||
@@ -174,6 +174,8 @@
|
||||
<boolean>0</boolean>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>extract_high</key>
|
||||
@@ -186,6 +188,8 @@
|
||||
<real>0.40000000000000002</real>
|
||||
<key>saturation</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
@@ -256,7 +256,7 @@ static void request(const std::string &url,
|
||||
LLPumpIO::chain_t chain;
|
||||
|
||||
LLURLRequest *req = new LLURLRequest(method, url);
|
||||
req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req);
|
||||
req->checkRootCertificate(true);
|
||||
|
||||
/*
|
||||
// Insert custom headers if the caller sent any
|
||||
|
||||
@@ -203,7 +203,7 @@ void ImportTracker::get_update(S32 newid, BOOL justCreated, BOOL createSelected)
|
||||
msg->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("EmeraldBuildPrefs_Physical"));
|
||||
msg->addBOOLFast(_PREHASH_IsTemporary, gSavedSettings.getBOOL("EmeraldBuildPrefs_Temporary"));
|
||||
msg->addBOOLFast(_PREHASH_IsPhantom, gSavedSettings.getBOOL("EmeraldBuildPrefs_Phantom") );
|
||||
msg->addBOOL("CastsShadows", true );
|
||||
msg->addBOOL("CastsShadows", false );
|
||||
msg->sendReliable(gAgent.getRegion()->getHost());
|
||||
|
||||
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_EmbedItem"))
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "llmoveview.h"
|
||||
#include "llchatbar.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanelpathfindingrebakenavmesh.h"
|
||||
#include "llparcel.h"
|
||||
#include "llrendersphere.h"
|
||||
#include "llsdmessage.h"
|
||||
@@ -1874,6 +1875,8 @@ void LLAgent::endAnimationUpdateUI()
|
||||
gMenuBarView->setVisible(TRUE);
|
||||
gStatusBar->setVisibleForMouselook(true);
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(TRUE);
|
||||
|
||||
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
|
||||
|
||||
|
||||
@@ -1962,6 +1965,7 @@ void LLAgent::endAnimationUpdateUI()
|
||||
// hide menus
|
||||
gMenuBarView->setVisible(FALSE);
|
||||
gStatusBar->setVisibleForMouselook(false);
|
||||
LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(FALSE);
|
||||
|
||||
// clear out camera lag effect
|
||||
gAgentCamera.clearCameraLag();
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
#include "llvector4a.h"
|
||||
#include "llfont.h"
|
||||
#include "llvocache.h"
|
||||
#include "llvopartgroup.h"
|
||||
#include "llfloaterteleporthistory.h"
|
||||
|
||||
#include "llweb.h"
|
||||
@@ -216,11 +217,6 @@
|
||||
|
||||
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
|
||||
//
|
||||
#if LL_WINDOWS && LL_LCD_COMPILE
|
||||
#include "lllcd.h"
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// viewer.cpp - these are only used in viewer, should be easily moved.
|
||||
|
||||
@@ -602,6 +598,10 @@ bool LLAppViewer::init()
|
||||
|
||||
// initialize SSE options
|
||||
LLVector4a::initClass();
|
||||
|
||||
//initialize particle index pool
|
||||
LLVOPartGroup::initClass();
|
||||
|
||||
// Need to do this initialization before we do anything else, since anything
|
||||
// that touches files should really go through the lldir API
|
||||
gDirUtilp->initAppDirs("SecondLife");
|
||||
@@ -637,9 +637,8 @@ bool LLAppViewer::init()
|
||||
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
|
||||
// *NOTE:Mani - LLCurl::initClass is not thread safe.
|
||||
// Called before threads are created.
|
||||
LLCurl::initClass(gSavedSettings.getF32("CurlRequestTimeOut"),
|
||||
gSavedSettings.getS32("CurlMaximumNumberOfHandles"),
|
||||
gSavedSettings.getBOOL("CurlUseMultipleThreads"));
|
||||
LLCurl::initClass(gSavedSettings.getF32("CurlRequestTimeOut"));
|
||||
|
||||
LL_INFOS("InitInfo") << "LLCurl initialized." << LL_ENDL ;
|
||||
|
||||
initThreads();
|
||||
@@ -810,13 +809,6 @@ bool LLAppViewer::init()
|
||||
// call all self-registered classes
|
||||
LLInitClassList::instance().fireCallbacks();
|
||||
|
||||
#if LL_LCD_COMPILE
|
||||
// start up an LCD window on a logitech keyboard, if there is one
|
||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||
gLcdScreen = new LLLCD(hInstance);
|
||||
CreateLCDDebugWindows();
|
||||
#endif
|
||||
|
||||
LLFolderViewItem::initClass(); // SJB: Needs to happen after initWindow(), not sure why but related to fonts
|
||||
|
||||
gGLManager.getGLInfo(gDebugInfo);
|
||||
@@ -1198,11 +1190,6 @@ bool LLAppViewer::mainLoop()
|
||||
pingMainloopTimeout("Main:Snapshot");
|
||||
LLFloaterSnapshot::update(); // take snapshots
|
||||
gGLActive = FALSE;
|
||||
#if LL_LCD_COMPILE
|
||||
// update LCD Screen
|
||||
pingMainloopTimeout("Main:LCD");
|
||||
gLcdScreen->UpdateDisplay();
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1570,12 +1557,6 @@ bool LLAppViewer::cleanup()
|
||||
// gDXHardware.cleanup();
|
||||
//#endif // LL_WINDOWS
|
||||
|
||||
#if LL_LCD_COMPILE
|
||||
// shut down the LCD window on a logitech keyboard, if there is one
|
||||
delete gLcdScreen;
|
||||
gLcdScreen = NULL;
|
||||
#endif
|
||||
|
||||
LLVolumeMgr* volume_manager = LLPrimitive::getVolumeManager();
|
||||
if (!volume_manager->cleanup())
|
||||
{
|
||||
@@ -1678,6 +1659,8 @@ bool LLAppViewer::cleanup()
|
||||
|
||||
writeDebugInfo();
|
||||
|
||||
if(!gDirUtilp->getLindenUserDir(true).empty())
|
||||
LLViewerMedia::saveCookieFile();
|
||||
// Stop the plugin read thread if it's running.
|
||||
LLPluginProcessParent::setUseReadThread(false);
|
||||
|
||||
|
||||
@@ -165,6 +165,9 @@ BOOL LLChatBar::postBuild()
|
||||
mInputEditor->setEnableLineHistory(TRUE);
|
||||
}
|
||||
|
||||
mHistoryBtn.connect(this,"History");
|
||||
mSayBtn.connect(this,"Say");
|
||||
|
||||
mIsBuilt = TRUE;
|
||||
|
||||
return TRUE;
|
||||
@@ -228,9 +231,9 @@ void LLChatBar::refresh()
|
||||
gAgent.stopTyping();
|
||||
}
|
||||
|
||||
childSetValue("History", LLFloaterChat::instanceVisible(LLSD()));
|
||||
mHistoryBtn->setValue(LLFloaterChat::instanceVisible(LLSD()));
|
||||
|
||||
childSetEnabled("Say", mInputEditor->getText().size() > 0);
|
||||
mSayBtn->setEnabled(mInputEditor->getText().size() > 0);
|
||||
//childSetEnabled("Shout", mInputEditor->getText().size() > 0); createDummyWidget Making Dummy -HgB
|
||||
|
||||
}
|
||||
|
||||
@@ -110,6 +110,9 @@ protected:
|
||||
LLComboBox* mGestureCombo;
|
||||
|
||||
LLChatBarGestureObserver* mObserver;
|
||||
|
||||
CachedUICtrl<LLButton> mHistoryBtn;
|
||||
CachedUICtrl<LLButton> mSayBtn;
|
||||
};
|
||||
|
||||
extern LLChatBar *gChatBar;
|
||||
|
||||
@@ -113,6 +113,7 @@ void LLDrawable::init()
|
||||
|
||||
mGeneration = -1;
|
||||
mBinRadius = 1.f;
|
||||
mBinIndex = -1;
|
||||
mSpatialBridge = NULL;
|
||||
}
|
||||
|
||||
@@ -790,19 +791,7 @@ void LLDrawable::updateTexture()
|
||||
|
||||
if (getVOVolume())
|
||||
{
|
||||
/*if (isActive())
|
||||
{
|
||||
if (isRoot())
|
||||
{
|
||||
mQuietCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
getParent()->mQuietCount = 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
getVOVolume()->mFaceMappingChanged = TRUE;
|
||||
//getVOVolume()->mFaceMappingChanged = TRUE;
|
||||
gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL, TRUE);
|
||||
}
|
||||
}
|
||||
@@ -963,6 +952,12 @@ void LLDrawable::updateUVMinMax()
|
||||
{
|
||||
}
|
||||
|
||||
LLSpatialGroup* LLDrawable::getSpatialGroup() const
|
||||
{
|
||||
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
|
||||
return mSpatialGroupp;
|
||||
}
|
||||
|
||||
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
|
||||
{
|
||||
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
|
||||
@@ -985,6 +980,8 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
|
||||
}
|
||||
|
||||
mSpatialGroupp = groupp;
|
||||
|
||||
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
|
||||
}
|
||||
|
||||
LLSpatialPartition* LLDrawable::getSpatialPartition()
|
||||
@@ -1107,6 +1104,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
|
||||
mDrawable = root;
|
||||
root->setSpatialBridge(this);
|
||||
|
||||
mBinIndex = -1;
|
||||
|
||||
mRenderType = mDrawable->mRenderType;
|
||||
mDrawableType = mDrawable->mRenderType;
|
||||
|
||||
@@ -1500,7 +1499,13 @@ void LLSpatialBridge::cleanupReferences()
|
||||
LLDrawable::cleanupReferences();
|
||||
if (mDrawable)
|
||||
{
|
||||
mDrawable->setSpatialGroup(NULL);
|
||||
LLSpatialGroup* group = mDrawable->getSpatialGroup();
|
||||
if (group)
|
||||
{
|
||||
group->mOctreeNode->remove(mDrawable);
|
||||
mDrawable->setSpatialGroup(NULL);
|
||||
}
|
||||
|
||||
if (mDrawable->getVObj())
|
||||
{
|
||||
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
|
||||
@@ -1511,7 +1516,12 @@ void LLSpatialBridge::cleanupReferences()
|
||||
LLDrawable* drawable = child->mDrawable;
|
||||
if (drawable)
|
||||
{
|
||||
drawable->setSpatialGroup(NULL);
|
||||
LLSpatialGroup* group = drawable->getSpatialGroup();
|
||||
if (group)
|
||||
{
|
||||
group->mOctreeNode->remove(drawable);
|
||||
drawable->setSpatialGroup(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,9 @@ public:
|
||||
F32 getIntensity() const { return llmin(mXform.getScale().mV[0], 4.f); }
|
||||
S32 getLOD() const { return mVObjp ? mVObjp->getLOD() : 1; }
|
||||
F32 getBinRadius() const { return mBinRadius; }
|
||||
S32 getBinIndex() const { return mBinIndex; }
|
||||
void setBinIndex(S32 index) const { mBinIndex = index; }
|
||||
|
||||
void getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
|
||||
LLXformMatrix* getXform() { return &mXform; }
|
||||
|
||||
@@ -200,7 +203,7 @@ public:
|
||||
S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators...
|
||||
|
||||
void setSpatialGroup(LLSpatialGroup *groupp);
|
||||
LLSpatialGroup *getSpatialGroup() const { return mSpatialGroupp; }
|
||||
LLSpatialGroup *getSpatialGroup() const;
|
||||
LLSpatialPartition* getSpatialPartition();
|
||||
|
||||
// Statics
|
||||
@@ -321,6 +324,7 @@ private:
|
||||
mutable U32 mVisible;
|
||||
F32 mRadius;
|
||||
F32 mBinRadius;
|
||||
mutable S32 mBinIndex;
|
||||
S32 mGeneration;
|
||||
|
||||
LLVector3 mCurrentScale;
|
||||
|
||||
@@ -446,7 +446,7 @@ void LLRenderPass::renderTexture(U32 type, U32 mask)
|
||||
|
||||
void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture, BOOL batch_textures)
|
||||
{
|
||||
for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)
|
||||
for (LLCullResult::drawinfo_iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)
|
||||
{
|
||||
LLDrawInfo* pparams = *i;
|
||||
if (pparams)
|
||||
|
||||
@@ -355,7 +355,7 @@ void LLDrawPoolAlpha::render(S32 pass)
|
||||
|
||||
void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
|
||||
{
|
||||
for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
|
||||
for (LLCullResult::sg_iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
|
||||
{
|
||||
LLSpatialGroup* group = *i;
|
||||
if (group->mSpatialPartition->mRenderByGroup &&
|
||||
@@ -392,7 +392,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
|
||||
|
||||
BOOL use_shaders = gPipeline.canUseVertexShaders();
|
||||
|
||||
for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
|
||||
for (LLCullResult::sg_iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
|
||||
{
|
||||
LLSpatialGroup* group = *i;
|
||||
llassert(group);
|
||||
|
||||
@@ -1203,15 +1203,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
||||
|
||||
if (pass >= 7 && pass < 9)
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
||||
gGL.setColorMask(true, true);
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
|
||||
LLRender::BF_ZERO,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
|
||||
|
||||
|
||||
if (pass == 7)
|
||||
{
|
||||
renderRiggedAlpha(avatarp);
|
||||
@@ -1227,20 +1218,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
||||
|
||||
if (pass == 9)
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
LLGLDisable test(GL_ALPHA_TEST);
|
||||
gGL.flush();
|
||||
|
||||
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-1.0f, -1.0f);
|
||||
gGL.setSceneBlendType(LLRender::BT_ADD);
|
||||
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
gGL.setColorMask(false, true);
|
||||
|
||||
renderRiggedGlow(avatarp);
|
||||
gGL.setColorMask(true, false);
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1640,17 +1619,56 @@ void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar)
|
||||
|
||||
void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
|
||||
{
|
||||
renderRigged(avatar, RIGGED_ALPHA);
|
||||
if (!mRiggedFace[RIGGED_ALPHA].empty())
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
||||
gGL.setColorMask(true, true);
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
|
||||
LLRender::BF_ZERO,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
|
||||
|
||||
renderRigged(avatar, RIGGED_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
|
||||
{
|
||||
renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA);
|
||||
if (!mRiggedFace[RIGGED_FULLBRIGHT_ALPHA].empty())
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
||||
gGL.setColorMask(true, true);
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
|
||||
LLRender::BF_ZERO,
|
||||
LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
|
||||
|
||||
renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
|
||||
{
|
||||
renderRigged(avatar, RIGGED_GLOW, true);
|
||||
if (!mRiggedFace[RIGGED_GLOW].empty())
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
LLGLDisable test(GL_ALPHA_TEST);
|
||||
gGL.flush();
|
||||
|
||||
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-1.0f, -1.0f);
|
||||
gGL.setSceneBlendType(LLRender::BT_ADD);
|
||||
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
gGL.setColorMask(false, true);
|
||||
|
||||
renderRigged(avatar, RIGGED_GLOW, true);
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -848,12 +848,12 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
|
||||
LLFastTimer ftm(FTM_RENDER_BUMP);
|
||||
|
||||
U32 type = LLRenderPass::PASS_BUMP;
|
||||
LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
|
||||
LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
|
||||
LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
|
||||
LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
|
||||
|
||||
U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_BINORMAL | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
|
||||
|
||||
for (LLCullResult::drawinfo_list_t::iterator i = begin; i != end; ++i)
|
||||
for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i)
|
||||
{
|
||||
LLDrawInfo& params = **i;
|
||||
|
||||
@@ -1449,10 +1449,10 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
|
||||
|
||||
void LLDrawPoolBump::renderBump(U32 type, U32 mask)
|
||||
{
|
||||
LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
|
||||
LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
|
||||
LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
|
||||
LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
|
||||
|
||||
for (LLCullResult::drawinfo_list_t::iterator i = begin; i != end; ++i)
|
||||
for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i)
|
||||
{
|
||||
LLDrawInfo& params = **i;
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ LLDriverParam::LLDriverParam(LLVOAvatar *avatarp) :
|
||||
mAvatarp(avatarp),
|
||||
mWearablep(NULL)
|
||||
{
|
||||
mDefaultVec.clear();
|
||||
}
|
||||
|
||||
LLDriverParam::LLDriverParam(LLWearable *wearablep) :
|
||||
@@ -162,6 +163,7 @@ LLDriverParam::LLDriverParam(LLWearable *wearablep) :
|
||||
mAvatarp(NULL),
|
||||
mWearablep(wearablep)
|
||||
{
|
||||
mDefaultVec.clear();
|
||||
}
|
||||
|
||||
LLDriverParam::~LLDriverParam()
|
||||
@@ -341,18 +343,19 @@ F32 LLDriverParam::getTotalDistortion()
|
||||
return sum;
|
||||
}
|
||||
|
||||
const LLVector3 &LLDriverParam::getAvgDistortion()
|
||||
const LLVector4a &LLDriverParam::getAvgDistortion()
|
||||
{
|
||||
// It's not actually correct to take the average of averages, but it good enough here.
|
||||
LLVector3 sum;
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
S32 count = 0;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum += driven->mParam->getAvgDistortion();
|
||||
sum.add(driven->mParam->getAvgDistortion());
|
||||
count++;
|
||||
}
|
||||
sum /= (F32)count;
|
||||
sum.mul( 1.f/(F32)count);
|
||||
|
||||
mDefaultVec = sum;
|
||||
return mDefaultVec;
|
||||
@@ -375,21 +378,22 @@ F32 LLDriverParam::getMaxDistortion()
|
||||
}
|
||||
|
||||
|
||||
LLVector3 LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
|
||||
LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
|
||||
{
|
||||
LLVector3 sum;
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum += driven->mParam->getVertexDistortion( index, poly_mesh );
|
||||
sum.add(driven->mParam->getVertexDistortion( index, poly_mesh ));
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
const LLVector3* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
mCurrentDistortionParam = NULL;
|
||||
const LLVector3* v = NULL;
|
||||
const LLVector4a* v = NULL;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
@@ -404,7 +408,7 @@ const LLVector3* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly
|
||||
return v;
|
||||
};
|
||||
|
||||
const LLVector3* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
llassert( mCurrentDistortionParam );
|
||||
if( !mCurrentDistortionParam )
|
||||
@@ -432,7 +436,7 @@ const LLVector3* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_
|
||||
}
|
||||
|
||||
// We're already in the middle of a param's distortions, so get the next one.
|
||||
const LLVector3* v = driven->mParam->getNextDistortion( index, poly_mesh );
|
||||
const LLVector4a* v = driven->mParam->getNextDistortion( index, poly_mesh );
|
||||
if( (!v) && (iter != mDriven.end()) )
|
||||
{
|
||||
// This param is finished, so start the next param. It might not have any
|
||||
|
||||
@@ -105,18 +105,18 @@ public:
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
/*virtual*/ F32 getTotalDistortion();
|
||||
/*virtual*/ const LLVector3& getAvgDistortion();
|
||||
/*virtual*/ const LLVector4a& getAvgDistortion();
|
||||
/*virtual*/ F32 getMaxDistortion();
|
||||
/*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
|
||||
/*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
|
||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
|
||||
protected:
|
||||
F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
|
||||
void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
|
||||
|
||||
|
||||
LLVector3 mDefaultVec; // temp holder
|
||||
LLVector4a mDefaultVec; // temp holder
|
||||
typedef std::vector<LLDrivenEntry> entry_list_t;
|
||||
entry_list_t mDriven;
|
||||
LLViewerVisualParam* mCurrentDistortionParam;
|
||||
|
||||
@@ -169,19 +169,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
|
||||
mGeomCount = 0;
|
||||
mGeomIndex = 0;
|
||||
mIndicesCount = 0;
|
||||
if (drawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
|
||||
drawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES
|
||||
#if ENABLE_CLASSIC_CLOUDS
|
||||
|| drawablep->getRenderType() == LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS
|
||||
#endif
|
||||
)
|
||||
{ //indicate to LLParticlePartition that this particle is uninitialized
|
||||
mIndicesIndex = 0xFFFFFFFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
mIndicesIndex = 0;
|
||||
}
|
||||
|
||||
//special value to indicate uninitialized position
|
||||
mIndicesIndex = 0xFFFFFFFF;
|
||||
|
||||
mIndexInTex = 0;
|
||||
mTexture = NULL;
|
||||
mTEOffset = -1;
|
||||
@@ -214,17 +205,10 @@ void LLFace::destroy()
|
||||
mTexture->removeFace(this) ;
|
||||
}
|
||||
|
||||
if (mDrawablep.notNull() &&
|
||||
(mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
|
||||
mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES
|
||||
#if ENABLE_CLASSIC_CLOUDS
|
||||
|| mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS
|
||||
#endif
|
||||
) &&
|
||||
mIndicesIndex != 0xFFFFFFFF)
|
||||
if (isState(LLFace::PARTICLE))
|
||||
{
|
||||
LLVOPartGroup::freeVBSlot(getGeomIndex()/4);
|
||||
mIndicesIndex = 0xFFFFFFFF;
|
||||
clearState(LLFace::PARTICLE);
|
||||
}
|
||||
|
||||
if (mDrawPoolp)
|
||||
@@ -335,7 +319,20 @@ void LLFace::setTexture(LLViewerTexture* tex)
|
||||
|
||||
void LLFace::dirtyTexture()
|
||||
{
|
||||
gPipeline.markTextured(getDrawable());
|
||||
LLDrawable* drawablep = getDrawable();
|
||||
|
||||
if (mVObjp.notNull() && mVObjp->getVolume() &&
|
||||
mTexture.notNull() && mTexture->getComponents() == 4)
|
||||
{ //dirty texture on an alpha object should be treated as an LoD update
|
||||
LLVOVolume* vobj = drawablep->getVOVolume();
|
||||
if (vobj)
|
||||
{
|
||||
vobj->mLODChanged = TRUE;
|
||||
}
|
||||
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME, FALSE);
|
||||
}
|
||||
|
||||
gPipeline.markTextured(drawablep);
|
||||
}
|
||||
|
||||
void LLFace::switchTexture(LLViewerTexture* new_texture)
|
||||
@@ -1209,19 +1206,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
{
|
||||
if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
|
||||
{
|
||||
llwarns << "Index buffer overflow!" << llendl;
|
||||
llwarns << "Indices Count: " << mIndicesCount
|
||||
<< " VF Num Indices: " << num_indices
|
||||
<< " Indices Index: " << mIndicesIndex
|
||||
<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
|
||||
llwarns << " Face Index: " << f
|
||||
<< " Pool Type: " << mPoolType << llendl;
|
||||
if (gDebugGL)
|
||||
{
|
||||
llwarns << "Index buffer overflow!" << llendl;
|
||||
llwarns << "Indices Count: " << mIndicesCount
|
||||
<< " VF Num Indices: " << num_indices
|
||||
<< " Indices Index: " << mIndicesIndex
|
||||
<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
|
||||
llwarns << " Face Index: " << f
|
||||
<< " Pool Type: " << mPoolType << llendl;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
|
||||
{
|
||||
llwarns << "Vertex buffer overflow!" << llendl;
|
||||
if (gDebugGL)
|
||||
{
|
||||
llwarns << "Vertex buffer overflow!" << llendl;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1632,7 +1635,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
if (!do_xform)
|
||||
{
|
||||
LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
|
||||
LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
|
||||
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
|
||||
LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, tc_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1853,15 +1857,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
|
||||
LLVector4a texIdx;
|
||||
|
||||
U8 index = mTextureIndex < 255 ? mTextureIndex : 0;
|
||||
S32 index = mTextureIndex < 255 ? mTextureIndex : 0;
|
||||
|
||||
F32 val = 0.f;
|
||||
U8* vp = (U8*) &val;
|
||||
vp[0] = index;
|
||||
vp[1] = 0;
|
||||
vp[2] = 0;
|
||||
vp[3] = 0;
|
||||
|
||||
S32* vp = (S32*) &val;
|
||||
*vp = index;
|
||||
|
||||
llassert(index <= LLGLSLShader::sIndexedTextureChannels-1);
|
||||
|
||||
LLVector4Logical mask;
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
USE_FACE_COLOR = 0x0010,
|
||||
TEXTURE_ANIM = 0x0020,
|
||||
RIGGED = 0x0040,
|
||||
PARTICLE = 0x0080,
|
||||
};
|
||||
|
||||
static void initClass();
|
||||
|
||||
@@ -255,50 +255,28 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// This calculates the physics of the flexible object. Note that it has to be 0
|
||||
// updated every time step. In the future, perhaps there could be an
|
||||
// optimization similar to what Havok does for objects that are stationary.
|
||||
//---------------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
|
||||
BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||
|
||||
void LLVolumeImplFlexible::updateRenderRes()
|
||||
{
|
||||
if (mVO->mDrawable.isNull())
|
||||
{
|
||||
// Don't do anything until we have a drawable
|
||||
return FALSE; // (we are not initialized or updated)
|
||||
}
|
||||
LLDrawable* drawablep = mVO->mDrawable;
|
||||
|
||||
BOOL force_update = mSimulateRes == 0 ? TRUE : FALSE;
|
||||
|
||||
//flexible objects never go static
|
||||
mVO->mDrawable->mQuietCount = 0;
|
||||
if (!mVO->mDrawable->isRoot())
|
||||
{
|
||||
LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
|
||||
parent->mDrawable->mQuietCount = 0;
|
||||
}
|
||||
|
||||
LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
|
||||
|
||||
S32 new_res = mAttributes->getSimulateLOD();
|
||||
|
||||
//number of segments only cares about z axis
|
||||
F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, mVO->mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
|
||||
#if 1 //optimal approximation of previous behavior that doesn't rely on atan2
|
||||
F32 app_angle = mVO->getScale().mV[2]/drawablep->mDistanceWRTCamera;
|
||||
|
||||
// Rendering sections increases with visible angle on the screen
|
||||
mRenderRes = (S32) (12.f*app_angle);
|
||||
#else //legacy behavior
|
||||
//number of segments only cares about z axis
|
||||
F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
|
||||
|
||||
// Rendering sections increases with visible angle on the screen
|
||||
mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView());
|
||||
if (mRenderRes > FLEXIBLE_OBJECT_MAX_SECTIONS)
|
||||
{
|
||||
mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS;
|
||||
}
|
||||
|
||||
|
||||
// Bottom cap at 1/4 the original number of sections
|
||||
if (mRenderRes < mAttributes->getSimulateLOD()-1)
|
||||
{
|
||||
mRenderRes = mAttributes->getSimulateLOD()-1;
|
||||
}
|
||||
#endif
|
||||
|
||||
mRenderRes = llclamp(mRenderRes, new_res-1, (S32) FLEXIBLE_OBJECT_MAX_SECTIONS);
|
||||
|
||||
// Throttle back simulation of segments we're not rendering
|
||||
if (mRenderRes < new_res)
|
||||
{
|
||||
@@ -311,43 +289,67 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
|
||||
setAttributesOfAllSections();
|
||||
mInitialized = TRUE;
|
||||
}
|
||||
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
|
||||
{
|
||||
return FALSE; // (we are not initialized or updated)
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
// This calculates the physics of the flexible object. Note that it has to be 0
|
||||
// updated every time step. In the future, perhaps there could be an
|
||||
// optimization similar to what Havok does for objects that are stationary.
|
||||
//---------------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
|
||||
void LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||
{
|
||||
LLDrawable* drawablep = mVO->mDrawable;
|
||||
|
||||
bool visible = mVO->mDrawable->isVisible();
|
||||
|
||||
if (force_update && visible)
|
||||
if (drawablep)
|
||||
{
|
||||
gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
|
||||
}
|
||||
else if (visible &&
|
||||
!mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
|
||||
mVO->getPixelArea() > 256.f)
|
||||
{
|
||||
U32 id;
|
||||
F32 pixel_area = mVO->getPixelArea();
|
||||
//LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
|
||||
|
||||
if (mVO->isRootEdit())
|
||||
//flexible objects never go static
|
||||
drawablep->mQuietCount = 0;
|
||||
if (!drawablep->isRoot())
|
||||
{
|
||||
id = mID;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
|
||||
id = parent->getVolumeInterfaceID();
|
||||
LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
|
||||
parent->mDrawable->mQuietCount = 0;
|
||||
}
|
||||
|
||||
U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
|
||||
|
||||
if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
|
||||
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
|
||||
{
|
||||
gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
|
||||
}
|
||||
bool visible = drawablep->isVisible();
|
||||
|
||||
if ((mSimulateRes == 0) && visible)
|
||||
{
|
||||
updateRenderRes();
|
||||
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
|
||||
}
|
||||
else if (visible &&
|
||||
!drawablep->isState(LLDrawable::IN_REBUILD_Q1) &&
|
||||
mVO->getPixelArea() > 256.f)
|
||||
{
|
||||
U32 id;
|
||||
F32 pixel_area = mVO->getPixelArea();
|
||||
|
||||
if (mVO->isRootEdit())
|
||||
{
|
||||
id = mID;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
|
||||
id = parent->getVolumeInterfaceID();
|
||||
}
|
||||
|
||||
U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
|
||||
|
||||
if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
|
||||
{
|
||||
updateRenderRes();
|
||||
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!mInitialized)
|
||||
updateRenderRes();
|
||||
}
|
||||
|
||||
return force_update;
|
||||
}
|
||||
|
||||
inline S32 log2(S32 x)
|
||||
@@ -368,8 +370,11 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
|
||||
LLPath *path = &volume->getPath();
|
||||
if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible())
|
||||
{
|
||||
//mVO->markForUpdate(TRUE);
|
||||
if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0))
|
||||
BOOL force_update = mSimulateRes == 0 ? TRUE : FALSE;
|
||||
|
||||
doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0);
|
||||
|
||||
if (!force_update || !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
|
||||
{
|
||||
return; // we did not get updated or initialized, proceeding without can be dangerous
|
||||
}
|
||||
|
||||
@@ -84,7 +84,8 @@ class LLVolumeImplFlexible : public LLVolumeInterface
|
||||
LLVector3 getFramePosition() const;
|
||||
LLQuaternion getFrameRotation() const;
|
||||
LLVolumeInterfaceType getInterfaceType() const { return INTERFACE_FLEXIBLE; }
|
||||
BOOL doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
|
||||
void updateRenderRes();
|
||||
void doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
|
||||
BOOL doUpdateGeometry(LLDrawable *drawable);
|
||||
LLVector3 getPivotPosition() const;
|
||||
void onSetVolume(const LLVolumeParams &volume_params, const S32 detail);
|
||||
|
||||
@@ -353,6 +353,13 @@ BOOL LLPanelActiveSpeakers::postBuild()
|
||||
childSetCommitCallback("moderator_allow_text", onModeratorMuteText, this);
|
||||
childSetCommitCallback("moderation_mode", onChangeModerationMode, this);
|
||||
|
||||
mVolumeSlider.connect(this,"speaker_volume");
|
||||
mModeratorCtrlLbl.connect(this,"moderator_controls_label");
|
||||
mModeratorAllowVoiceCheckbox.connect(this,"moderator_allow_voice");
|
||||
mModeratorAllowTextCheckbox.connect(this,"moderator_allow_text");
|
||||
mModeratorModePanel.connect(this,"moderation_mode_panel");
|
||||
mModeratorControlsPanel.connect(this,"moderator_controls");
|
||||
|
||||
// update speaker UI
|
||||
handleSpeakerSelect();
|
||||
|
||||
@@ -625,25 +632,21 @@ void LLPanelActiveSpeakers::refreshSpeakers()
|
||||
//&& !LLMuteList::getInstance()->isLinden(selected_speakerp->mDisplayName));
|
||||
&& !LLMuteList::getInstance()->isLinden(selected_speakerp->mLegacyName));
|
||||
}
|
||||
childSetValue("speaker_volume", gVoiceClient->getUserVolume(selected_id));
|
||||
childSetEnabled("speaker_volume", LLVoiceClient::voiceEnabled()
|
||||
mVolumeSlider->setValue(gVoiceClient->getUserVolume(selected_id));
|
||||
mVolumeSlider->setEnabled(LLVoiceClient::voiceEnabled()
|
||||
&& gVoiceClient->getVoiceEnabled(selected_id)
|
||||
&& selected_id.notNull()
|
||||
&& selected_id != gAgent.getID()
|
||||
&& (selected_speakerp.notNull() && (selected_speakerp->mType == LLSpeaker::SPEAKER_AGENT || selected_speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL)));
|
||||
|
||||
childSetEnabled(
|
||||
"moderator_controls_label",
|
||||
selected_id.notNull());
|
||||
mModeratorCtrlLbl->setEnabled(selected_id.notNull());
|
||||
|
||||
childSetEnabled(
|
||||
"moderator_allow_voice",
|
||||
mModeratorAllowVoiceCheckbox->setEnabled(
|
||||
selected_id.notNull()
|
||||
&& mSpeakerMgr->isVoiceActive()
|
||||
&& gVoiceClient->getVoiceEnabled(selected_id));
|
||||
|
||||
childSetEnabled(
|
||||
"moderator_allow_text",
|
||||
mModeratorAllowTextCheckbox->setEnabled(
|
||||
selected_id.notNull());
|
||||
|
||||
if (mProfileBtn)
|
||||
@@ -668,8 +671,8 @@ void LLPanelActiveSpeakers::refreshSpeakers()
|
||||
LLPointer<LLSpeaker> self_speakerp = mSpeakerMgr->findSpeaker(gAgent.getID());
|
||||
if(self_speakerp)
|
||||
{
|
||||
childSetVisible("moderation_mode_panel", self_speakerp->mIsModerator && mSpeakerMgr->isVoiceActive());
|
||||
childSetVisible("moderator_controls", self_speakerp->mIsModerator);
|
||||
mModeratorModePanel->setVisible(self_speakerp->mIsModerator && mSpeakerMgr->isVoiceActive());
|
||||
mModeratorControlsPanel->setVisible(self_speakerp->mIsModerator);
|
||||
}
|
||||
|
||||
// keep scroll value stable
|
||||
|
||||
@@ -46,6 +46,9 @@ class LLButton;
|
||||
class LLPanelActiveSpeakers;
|
||||
class LLSpeakerMgr;
|
||||
class LLVoiceChannel;
|
||||
class LLSlider;
|
||||
class LLTextBox;
|
||||
class LLCheckBoxCtrl;
|
||||
|
||||
|
||||
// data for a given participant in a voice channel
|
||||
@@ -296,6 +299,13 @@ protected:
|
||||
LLPointer<SpeakerAddListener> mSpeakerAddListener;
|
||||
LLPointer<SpeakerRemoveListener> mSpeakerRemoveListener;
|
||||
LLPointer<SpeakerClearListener> mSpeakerClearListener;
|
||||
|
||||
CachedUICtrl<LLUICtrl> mVolumeSlider;
|
||||
CachedUICtrl<LLTextBox> mModeratorCtrlLbl;
|
||||
CachedUICtrl<LLCheckBoxCtrl> mModeratorAllowVoiceCheckbox;
|
||||
CachedUICtrl<LLCheckBoxCtrl> mModeratorAllowTextCheckbox;
|
||||
CachedUICtrl<LLPanel> mModeratorModePanel;
|
||||
CachedUICtrl<LLPanel> mModeratorControlsPanel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "llcommandhandler.h"
|
||||
#include "llpanelavatar.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llweb.h"
|
||||
|
||||
// linden library includes
|
||||
#include "llinventory.h"
|
||||
@@ -293,3 +294,13 @@ LLPreview::EAssetStatus LLFloaterAvatarInfo::getAssetStatus()
|
||||
}
|
||||
return mAssetStatus;
|
||||
}
|
||||
|
||||
std::string getProfileURL(const std::string& agent_name)
|
||||
{
|
||||
std::string url = gSavedSettings.getString("WebProfileURL");
|
||||
LLSD subs;
|
||||
subs["AGENT_NAME"] = agent_name;
|
||||
url = LLWeb::expandURLSubstitutions(url,subs);
|
||||
LLStringUtil::toLower(url);
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -101,5 +101,6 @@ private:
|
||||
EOnlineStatus mSuggestedOnlineStatus;
|
||||
};
|
||||
|
||||
std::string getProfileURL(const std::string& agent_name);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -135,9 +135,9 @@ void LLFloaterChat::draw()
|
||||
{
|
||||
// enable say and shout only when text available
|
||||
|
||||
childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));
|
||||
mToggleActiveSpeakersBtn->setValue(mPanel->getVisible());
|
||||
|
||||
LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE);
|
||||
LLChatBar* chat_barp = mChatPanel;
|
||||
if (chat_barp)
|
||||
{
|
||||
chat_barp->refresh();
|
||||
@@ -156,6 +156,9 @@ BOOL LLFloaterChat::postBuild()
|
||||
{
|
||||
chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture"));
|
||||
}
|
||||
|
||||
mToggleActiveSpeakersBtn.connect(this,"toggle_active_speakers_btn");
|
||||
mChatPanel.connect(this,"chat_panel");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -452,20 +455,6 @@ void LLFloaterChat::addChat(const LLChat& chat,
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
#if LL_LCD_COMPILE
|
||||
// add into LCD displays
|
||||
if (!invisible_script_debug_chat)
|
||||
{
|
||||
if (!from_instant_message)
|
||||
{
|
||||
AddNewChatToLCD(chat.mText);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddNewIMToLCD(chat.mText);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!invisible_script_debug_chat
|
||||
&& !chat.mMuted
|
||||
&& gConsole
|
||||
|
||||
@@ -50,6 +50,7 @@ class LLUUID;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLPanelActiveSpeakers;
|
||||
class LLLogChat;
|
||||
class LLChatBar;
|
||||
|
||||
class LLFloaterChat
|
||||
: public LLFloater, public LLUISingleton<LLFloaterChat, LLFloaterChat>
|
||||
@@ -95,6 +96,9 @@ public:
|
||||
|
||||
LLPanelActiveSpeakers* mPanel;
|
||||
BOOL mScrolledToEnd;
|
||||
|
||||
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
|
||||
CachedUICtrl<LLChatBar> mChatPanel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
#include "lldaycyclemanager.h"
|
||||
#include "llwlparamset.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llpostprocess.h"
|
||||
#include "llfloaterwindlight.h"
|
||||
|
||||
|
||||
|
||||
@@ -80,8 +80,6 @@
|
||||
// <dogmode> stuff for Contact groups
|
||||
#include "ascentfloatercontactgroups.h"
|
||||
|
||||
//Maximum number of people you can select to do an operation on at once.
|
||||
#define MAX_FRIEND_SELECT 20
|
||||
#define DEFAULT_PERIOD 5.0
|
||||
#define RIGHTS_CHANGE_TIMEOUT 5.0
|
||||
#define OBSERVER_TIMEOUT 0.5
|
||||
@@ -368,8 +366,6 @@ void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data)
|
||||
BOOL LLPanelFriends::postBuild()
|
||||
{
|
||||
mFriendsList = getChild<LLScrollListCtrl>("friend_list");
|
||||
mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
|
||||
mFriendsList->setMaximumSelectCallback(onMaximumSelect);
|
||||
mFriendsList->setCommitOnSelectionChange(TRUE);
|
||||
childSetCommitCallback("friend_list", onSelectName, this);
|
||||
childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this);
|
||||
@@ -816,14 +812,6 @@ void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data)
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLPanelFriends::onMaximumSelect(void* user_data)
|
||||
{
|
||||
LLSD args;
|
||||
args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT);
|
||||
LLNotificationsUtil::add("MaxListSelectMessage", args);
|
||||
};
|
||||
|
||||
// static
|
||||
void LLPanelFriends::onClickProfile(void* user_data)
|
||||
{
|
||||
|
||||
@@ -135,7 +135,6 @@ private:
|
||||
static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
|
||||
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
|
||||
static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
|
||||
static void onMaximumSelect(void* user_data);
|
||||
static void onContactSearchEdit(const std::string& search_string, void* user_data);
|
||||
static void onClickIM(void* user_data);
|
||||
static void onClickAssign(void* user_data);
|
||||
|
||||
@@ -115,17 +115,8 @@ LLFloaterPostProcess* LLFloaterPostProcess::instance()
|
||||
|
||||
void LLFloaterPostProcess::onControlChanged(LLUICtrl* ctrl, void* userData)
|
||||
{
|
||||
char const *VariableName = (char const *)userData;
|
||||
char buf[256];
|
||||
S32 elem=0;
|
||||
if(sscanf(VariableName,"%255[^[][%d]", buf, &elem) == 2)
|
||||
{
|
||||
LLPostProcess::getInstance()->tweaks[(const char*)buf][elem] = ctrl->getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLPostProcess::getInstance()->tweaks[VariableName] = ctrl->getValue();
|
||||
}
|
||||
LLSD v = ctrl->getValue();
|
||||
LLPostProcess::getInstance()->setSelectedEffectValue((char const *)userData, v);
|
||||
}
|
||||
|
||||
void LLFloaterPostProcess::onLoadEffect(void* userData)
|
||||
@@ -145,7 +136,7 @@ void LLFloaterPostProcess::onSaveEffect(void* userData)
|
||||
|
||||
std::string effectName(editBox->getValue().asString());
|
||||
|
||||
if (LLPostProcess::getInstance()->mAllEffects.has(effectName))
|
||||
if (LLPostProcess::getInstance()->getAllEffectInfo().has(effectName))
|
||||
{
|
||||
LLSD payload;
|
||||
payload["effect_name"] = effectName;
|
||||
@@ -153,7 +144,7 @@ void LLFloaterPostProcess::onSaveEffect(void* userData)
|
||||
}
|
||||
else
|
||||
{
|
||||
LLPostProcess::getInstance()->saveEffect(effectName);
|
||||
LLPostProcess::getInstance()->saveEffectAs(effectName);
|
||||
sPostProcess->syncMenu();
|
||||
}
|
||||
}
|
||||
@@ -175,7 +166,7 @@ bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLS
|
||||
// if they choose save, do it. Otherwise, don't do anything
|
||||
if (option == 0)
|
||||
{
|
||||
LLPostProcess::getInstance()->saveEffect(notification["payload"]["effect_name"].asString());
|
||||
LLPostProcess::getInstance()->saveEffectAs(notification["payload"]["effect_name"].asString());
|
||||
|
||||
sPostProcess->syncMenu();
|
||||
}
|
||||
@@ -209,17 +200,17 @@ void LLFloaterPostProcess::syncMenu()
|
||||
comboBox->removeall();
|
||||
|
||||
LLSD::map_const_iterator currEffect;
|
||||
for(currEffect = LLPostProcess::getInstance()->mAllEffects.beginMap();
|
||||
currEffect != LLPostProcess::getInstance()->mAllEffects.endMap();
|
||||
for(currEffect = LLPostProcess::getInstance()->getAllEffectInfo().beginMap();
|
||||
currEffect != LLPostProcess::getInstance()->getAllEffectInfo().endMap();
|
||||
++currEffect)
|
||||
{
|
||||
comboBox->add(currEffect->first);
|
||||
}
|
||||
|
||||
// set the current effect as selected.
|
||||
comboBox->selectByValue(LLPostProcess::getInstance()->getSelectedEffect());
|
||||
comboBox->selectByValue(LLPostProcess::getInstance()->getSelectedEffectName());
|
||||
|
||||
LLSD &tweaks = LLPostProcess::getInstance()->tweaks;
|
||||
const LLSD &tweaks = LLPostProcess::getInstance()->getSelectedEffectInfo();
|
||||
//Iterate down all uniforms handled by post-process shaders. Update any linked ui elements.
|
||||
for (LLSD::map_const_iterator it = tweaks.beginMap(); it != tweaks.endMap(); ++it)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "llpanelgeneral.h"
|
||||
#include "llpanelinput.h"
|
||||
#include "llpanellogin.h"
|
||||
#include "llpanelLCD.h"
|
||||
#include "llpanelmsgs.h"
|
||||
#include "llpanelweb.h"
|
||||
#include "llpanelskins.h"
|
||||
@@ -178,20 +177,6 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
|
||||
mTabContainer->addTabPanel(mPrefsIM->getPanel(), mPrefsIM->getPanel()->getLabel());
|
||||
mPrefsIM->getPanel()->setDefaultBtn(default_btn);
|
||||
|
||||
#if LL_LCD_COMPILE
|
||||
|
||||
// only add this option if we actually have a logitech keyboard / speaker set
|
||||
if (gLcdScreen->Enabled())
|
||||
{
|
||||
mLCDPanel = new LLPanelLCD();
|
||||
mTabContainer->addTabPanel(mLCDPanel, mLCDPanel->getLabel());
|
||||
mLCDPanel->setDefaultBtn(default_btn);
|
||||
}
|
||||
|
||||
#else
|
||||
mLCDPanel = NULL;
|
||||
#endif
|
||||
|
||||
mMsgPanel = new LLPanelMsgs();
|
||||
mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel());
|
||||
mMsgPanel->setDefaultBtn(default_btn);
|
||||
@@ -318,14 +303,6 @@ void LLPreferenceCore::apply()
|
||||
mPrefsAscentVan->apply();
|
||||
|
||||
mWebPanel->apply();
|
||||
#if LL_LCD_COMPILE
|
||||
// only add this option if we actually have a logitech keyboard / speaker set
|
||||
if (gLcdScreen->Enabled())
|
||||
{
|
||||
mLCDPanel->apply();
|
||||
}
|
||||
#endif
|
||||
// mWebPanel->apply();
|
||||
}
|
||||
|
||||
|
||||
@@ -347,14 +324,6 @@ void LLPreferenceCore::cancel()
|
||||
mPrefsAscentVan->cancel();
|
||||
|
||||
mWebPanel->cancel();
|
||||
#if LL_LCD_COMPILE
|
||||
// only add this option if we actually have a logitech keyboard / speaker set
|
||||
if (gLcdScreen->Enabled())
|
||||
{
|
||||
mLCDPanel->cancel();
|
||||
}
|
||||
#endif
|
||||
// mWebPanel->cancel();
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
237
indra/newview/llfloaterregiondebugconsole.cpp
Normal file
237
indra/newview/llfloaterregiondebugconsole.cpp
Normal file
@@ -0,0 +1,237 @@
|
||||
/**
|
||||
* @file llfloaterregiondebugconsole.h
|
||||
* @author Brad Kittenbrink <brad@lindenlab.com>
|
||||
* @brief Quick and dirty console for region debug settings
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&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 "llfloaterregiondebugconsole.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "llhttpnode.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
// Two versions of the sim console API are supported.
|
||||
//
|
||||
// SimConsole capability (deprecated):
|
||||
// This is the initial implementation that is supported by some versions of the
|
||||
// simulator. It is simple and straight forward, just POST a command and the
|
||||
// body of the response has the result. This API is deprecated because it
|
||||
// doesn't allow the sim to use any asynchronous API.
|
||||
//
|
||||
// SimConsoleAsync capability:
|
||||
// This capability replaces the original SimConsole capability. It is similar
|
||||
// in that the command is POSTed to the SimConsoleAsync cap, but the response
|
||||
// comes in through the event poll, which gives the simulator more flexibility
|
||||
// and allows it to perform complex operations without blocking any frames.
|
||||
//
|
||||
// We will assume the SimConsoleAsync capability is available, and fall back to
|
||||
// the SimConsole cap if it is not. The simulator will only support one or the
|
||||
// other.
|
||||
|
||||
namespace
|
||||
{
|
||||
// Signal used to notify the floater of responses from the asynchronous
|
||||
// API.
|
||||
console_reply_signal_t sConsoleReplySignal;
|
||||
|
||||
const std::string PROMPT("\n\n> ");
|
||||
const std::string UNABLE_TO_SEND_COMMAND(
|
||||
"ERROR: The last command was not received by the server.");
|
||||
const std::string CONSOLE_UNAVAILABLE(
|
||||
"ERROR: No console available for this region/simulator.");
|
||||
const std::string CONSOLE_NOT_SUPPORTED(
|
||||
"This region does not support the simulator console.");
|
||||
|
||||
// This responder handles the initial response. Unless error() is called
|
||||
// we assume that the simulator has received our request. Error will be
|
||||
// called if this request times out.
|
||||
class AsyncConsoleResponder : public LLHTTPClient::Responder
|
||||
{
|
||||
public:
|
||||
/* virtual */
|
||||
void error(U32 status, const std::string& reason)
|
||||
{
|
||||
sConsoleReplySignal(UNABLE_TO_SEND_COMMAND);
|
||||
}
|
||||
};
|
||||
|
||||
class ConsoleResponder : public LLHTTPClient::Responder
|
||||
{
|
||||
public:
|
||||
ConsoleResponder(LLTextEditor *output) : mOutput(output)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void error(U32 status, const std::string& reason)
|
||||
{
|
||||
if (mOutput)
|
||||
{
|
||||
mOutput->appendText(
|
||||
UNABLE_TO_SEND_COMMAND + PROMPT,
|
||||
false, false);
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void result(const LLSD& content)
|
||||
{
|
||||
if (mOutput)
|
||||
{
|
||||
mOutput->appendText(
|
||||
content.asString() + PROMPT, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
LLTextEditor * mOutput;
|
||||
};
|
||||
|
||||
// This handles responses for console commands sent via the asynchronous
|
||||
// API.
|
||||
class ConsoleResponseNode : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
/* virtual */
|
||||
void post(
|
||||
LLHTTPNode::ResponsePtr reponse,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
{
|
||||
llinfos << "Received response from the debug console: "
|
||||
<< input << llendl;
|
||||
sConsoleReplySignal(input["body"].asString());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
boost::signals2::connection LLFloaterRegionDebugConsole::setConsoleReplyCallback(const console_reply_signal_t::slot_type& cb)
|
||||
{
|
||||
return sConsoleReplySignal.connect(cb);
|
||||
}
|
||||
|
||||
LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole()
|
||||
: LLFloater(), mOutput(NULL)
|
||||
{
|
||||
mReplySignalConnection = sConsoleReplySignal.connect(
|
||||
boost::bind(
|
||||
&LLFloaterRegionDebugConsole::onReplyReceived,
|
||||
this,
|
||||
_1));
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_debug_console.xml");
|
||||
}
|
||||
|
||||
LLFloaterRegionDebugConsole::~LLFloaterRegionDebugConsole()
|
||||
{
|
||||
mReplySignalConnection.disconnect();
|
||||
}
|
||||
|
||||
BOOL LLFloaterRegionDebugConsole::postBuild()
|
||||
{
|
||||
LLLineEditor* input = getChild<LLLineEditor>("region_debug_console_input");
|
||||
input->setEnableLineHistory(true);
|
||||
input->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2));
|
||||
input->setFocus(true);
|
||||
input->setCommitOnFocusLost(false);
|
||||
|
||||
mOutput = getChild<LLTextEditor>("region_debug_console_output");
|
||||
|
||||
std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync");
|
||||
if (url.empty())
|
||||
{
|
||||
// Fall back to see if the old API is supported.
|
||||
url = gAgent.getRegion()->getCapability("SimConsole");
|
||||
if (url.empty())
|
||||
{
|
||||
mOutput->appendText(
|
||||
CONSOLE_NOT_SUPPORTED + PROMPT,
|
||||
false, false);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
mOutput->appendText("> ", false, false);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterRegionDebugConsole::onClose(bool app_quitting)
|
||||
{
|
||||
LLFloater::onClose(app_quitting);
|
||||
|
||||
if (!app_quitting)
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param)
|
||||
{
|
||||
LLLineEditor* input = static_cast<LLLineEditor*>(ctrl);
|
||||
std::string text = input->getText() + "\n";
|
||||
|
||||
std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync");
|
||||
if (url.empty())
|
||||
{
|
||||
// Fall back to the old API
|
||||
url = gAgent.getRegion()->getCapability("SimConsole");
|
||||
if (url.empty())
|
||||
{
|
||||
text += CONSOLE_UNAVAILABLE + PROMPT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using SimConsole (deprecated)
|
||||
LLHTTPClient::post(
|
||||
url,
|
||||
LLSD(input->getText()),
|
||||
new ConsoleResponder(mOutput));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using SimConsoleAsync
|
||||
LLHTTPClient::post(
|
||||
url,
|
||||
LLSD(input->getText()),
|
||||
new AsyncConsoleResponder);
|
||||
}
|
||||
|
||||
mOutput->appendText(text, false, false);
|
||||
input->clear();
|
||||
}
|
||||
|
||||
void LLFloaterRegionDebugConsole::onReplyReceived(const std::string& output)
|
||||
{
|
||||
mOutput->appendText(output + PROMPT, false, false);
|
||||
}
|
||||
|
||||
LLHTTPRegistration<ConsoleResponseNode>
|
||||
gHTTPRegistrationMessageDebugConsoleResponse(
|
||||
"/message/SimConsoleResponse");
|
||||
63
indra/newview/llfloaterregiondebugconsole.h
Normal file
63
indra/newview/llfloaterregiondebugconsole.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @file llfloaterregiondebugconsole.h
|
||||
* @author Brad Kittenbrink <brad@lindenlab.com>
|
||||
* @brief Quick and dirty console for region debug settings
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&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_LLFLOATERREGIONDEBUGCONSOLE_H
|
||||
#define LL_LLFLOATERREGIONDEBUGCONSOLE_H
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llhttpclient.h"
|
||||
|
||||
class LLTextEditor;
|
||||
|
||||
typedef boost::signals2::signal<
|
||||
void (const std::string& output)> console_reply_signal_t;
|
||||
|
||||
class LLFloaterRegionDebugConsole : public LLFloater, public LLHTTPClient::Responder, public LLSingleton<LLFloaterRegionDebugConsole>
|
||||
{
|
||||
public:
|
||||
LLFloaterRegionDebugConsole();
|
||||
virtual ~LLFloaterRegionDebugConsole();
|
||||
|
||||
// virtual
|
||||
BOOL postBuild();
|
||||
void onClose(bool app_quitting);
|
||||
|
||||
void onInput(LLUICtrl* ctrl, const LLSD& param);
|
||||
|
||||
LLTextEditor * mOutput;
|
||||
|
||||
static boost::signals2::connection setConsoleReplyCallback(const console_reply_signal_t::slot_type& cb);
|
||||
|
||||
private:
|
||||
void onReplyReceived(const std::string& output);
|
||||
|
||||
boost::signals2::connection mReplySignalConnection;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERREGIONDEBUGCONSOLE_H
|
||||
@@ -110,9 +110,6 @@ void click_popup_minimize(void*);
|
||||
void click_popup_grab_drag(LLUICtrl *, void*);
|
||||
void click_popup_grab_lift(LLUICtrl *, void*);
|
||||
void click_popup_grab_spin(LLUICtrl *, void*);
|
||||
void click_popup_rotate_left(void*);
|
||||
void click_popup_rotate_reset(void*);
|
||||
void click_popup_rotate_right(void*);
|
||||
void click_popup_dozer_mode(LLUICtrl *, void *user);
|
||||
void commit_slider_dozer_size(LLUICtrl *, void*);
|
||||
void commit_slider_dozer_force(LLUICtrl *, void*);
|
||||
@@ -947,25 +944,6 @@ void commit_slider_zoom(LLUICtrl *ctrl, void*)
|
||||
gAgentCamera.setCameraZoomFraction(zoom_level);
|
||||
}
|
||||
|
||||
void click_popup_rotate_left(void*)
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionRotateAroundZ( 45.f );
|
||||
dialog_refresh_all();
|
||||
}
|
||||
|
||||
void click_popup_rotate_reset(void*)
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionResetRotation();
|
||||
dialog_refresh_all();
|
||||
}
|
||||
|
||||
void click_popup_rotate_right(void*)
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionRotateAroundZ( -45.f );
|
||||
dialog_refresh_all();
|
||||
}
|
||||
|
||||
|
||||
void click_popup_dozer_mode(LLUICtrl *, void *user)
|
||||
{
|
||||
S32 mode = (S32)(intptr_t) user;
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
|
||||
#include "llwaterparamset.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llpostprocess.h"
|
||||
|
||||
#undef max
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
|
||||
#include "llwlparamset.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llpostprocess.h"
|
||||
|
||||
#undef max
|
||||
|
||||
|
||||
@@ -118,20 +118,20 @@ public:
|
||||
virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse);
|
||||
virtual BOOL addFolder( LLFolderViewFolder* folder);
|
||||
|
||||
// Finds width and height of this object and it's children. Also
|
||||
// makes sure that this view and it's children are the right size.
|
||||
// Find width and height of this object and its children. Also
|
||||
// makes sure that this view and its children are the right size.
|
||||
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
|
||||
|
||||
void arrangeAll() { mArrangeGeneration++; }
|
||||
S32 getArrangeGeneration() { return mArrangeGeneration; }
|
||||
|
||||
// applies filters to control visibility of inventory items
|
||||
// Apply filters to control visibility of inventory items
|
||||
virtual void filter( LLInventoryFilter& filter);
|
||||
|
||||
// get the last selected item
|
||||
// Get the last selected item
|
||||
virtual LLFolderViewItem* getCurSelectedItem( void );
|
||||
|
||||
// Record the selected item and pass it down the hierachy.
|
||||
// Record the selected item and pass it down the hierarchy.
|
||||
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
|
||||
BOOL take_keyboard_focus);
|
||||
|
||||
@@ -141,13 +141,13 @@ public:
|
||||
// Called once a frame to update the selection if mSelectThisID has been set
|
||||
void updateSelection();
|
||||
|
||||
// This method is used to toggle the selection of an item. Walks
|
||||
// children, and keeps track of selected objects.
|
||||
// This method is used to toggle the selection of an item.
|
||||
// Walks children and keeps track of selected objects.
|
||||
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
|
||||
|
||||
virtual std::set<LLUUID> getSelectionList() const;
|
||||
|
||||
// make sure if ancestor is selected, descendents are not
|
||||
// Make sure if ancestor is selected, descendents are not
|
||||
void sanitizeSelection();
|
||||
void clearSelection();
|
||||
void addToSelectionList(LLFolderViewItem* item);
|
||||
@@ -158,21 +158,21 @@ public:
|
||||
void setDraggingOverItem(LLFolderViewItem* item) { mDraggingOverItem = item; }
|
||||
LLFolderViewItem* getDraggingOverItem() { return mDraggingOverItem; }
|
||||
|
||||
// deletion functionality
|
||||
// Deletion functionality
|
||||
void removeSelectedItems();
|
||||
|
||||
// open the selected item.
|
||||
// Open the selected item
|
||||
void openSelectedItems( void );
|
||||
void propertiesSelectedItems( void );
|
||||
|
||||
// change the folder type
|
||||
// Change the folder type
|
||||
void changeType(LLInventoryModel *model, LLFolderType::EType new_folder_type);
|
||||
|
||||
void autoOpenItem(LLFolderViewFolder* item);
|
||||
void closeAutoOpenedFolders();
|
||||
BOOL autoOpenTest(LLFolderViewFolder* item);
|
||||
|
||||
// copy & paste
|
||||
// Copy & paste
|
||||
virtual void copy();
|
||||
virtual BOOL canCopy() const;
|
||||
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
virtual void doDelete();
|
||||
virtual BOOL canDoDelete() const;
|
||||
|
||||
// public rename functionality - can only start the process
|
||||
// Public rename functionality - can only start the process
|
||||
void startRenamingSelectedItem( void );
|
||||
|
||||
// These functions were used when there was only one folderview,
|
||||
|
||||
@@ -408,7 +408,7 @@ void LLHoverView::updateText()
|
||||
LLViewerObject *parent = (LLViewerObject *)object->getParent();
|
||||
|
||||
if (object &&
|
||||
(object->usePhysics() ||
|
||||
(object->flagUsePhysics() ||
|
||||
object->flagScripted() ||
|
||||
object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ||
|
||||
object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ||
|
||||
@@ -423,7 +423,7 @@ void LLHoverView::updateText()
|
||||
line.append(LLTrans::getString("TooltipFlagScript") + " ");
|
||||
}
|
||||
|
||||
if (object->usePhysics())
|
||||
if (object->flagUsePhysics())
|
||||
{
|
||||
line.append(LLTrans::getString("TooltipFlagPhysics") + " ");
|
||||
}
|
||||
@@ -456,7 +456,7 @@ void LLHoverView::updateText()
|
||||
line.append(LLTrans::getString("TooltipFlagTemporary") + " ");
|
||||
}
|
||||
|
||||
if (object->usePhysics() ||
|
||||
if (object->flagUsePhysics() ||
|
||||
object->flagHandleTouch() ||
|
||||
(parent && parent->flagHandleTouch()) )
|
||||
{
|
||||
|
||||
@@ -1411,6 +1411,15 @@ BOOL LLFloaterIMPanel::postBuild()
|
||||
}
|
||||
|
||||
setDefaultBtn("send_btn");
|
||||
|
||||
mActiveSpeakersPanel.connect(this,"active_speakers_panel");
|
||||
mToggleActiveSpeakersBtn.connect(this,"toggle_active_speakers_btn");
|
||||
mVolumeSlider.connect(this,"speaker_volume");
|
||||
mEndCallBtn.connect(this,"end_call_btn");
|
||||
mStartCallBtn.connect(this,"start_call_btn");
|
||||
mSendBtn.connect(this,"send_btn");
|
||||
mMuteBtn.connect(this,"mute_btn");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1466,10 +1475,10 @@ void LLFloaterIMPanel::draw()
|
||||
&& mCallBackEnabled;
|
||||
|
||||
// hide/show start call and end call buttons
|
||||
childSetVisible("end_call_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
|
||||
childSetVisible("start_call_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
|
||||
childSetEnabled("start_call_btn", enable_connect);
|
||||
childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty());
|
||||
mEndCallBtn->setVisible(LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
|
||||
mStartCallBtn->setVisible(LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
|
||||
mStartCallBtn->setEnabled(enable_connect);
|
||||
mSendBtn->setEnabled(!childGetValue("chat_editor").asString().empty());
|
||||
|
||||
LLPointer<LLSpeaker> self_speaker = mSpeakers->findSpeaker(gAgent.getID());
|
||||
if(!mTextIMPossible)
|
||||
@@ -1497,10 +1506,10 @@ void LLFloaterIMPanel::draw()
|
||||
// show speakers window when voice first connects
|
||||
if (mShowSpeakersOnConnect && mVoiceChannel->isActive())
|
||||
{
|
||||
childSetVisible("active_speakers_panel", TRUE);
|
||||
mActiveSpeakersPanel->setVisible(true);
|
||||
mShowSpeakersOnConnect = FALSE;
|
||||
}
|
||||
childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));
|
||||
mToggleActiveSpeakersBtn->setValue(mActiveSpeakersPanel->getVisible());
|
||||
|
||||
if (mTyping)
|
||||
{
|
||||
@@ -1531,11 +1540,11 @@ void LLFloaterIMPanel::draw()
|
||||
else
|
||||
{
|
||||
// refresh volume and mute checkbox
|
||||
childSetVisible("speaker_volume", LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive());
|
||||
childSetValue("speaker_volume", gVoiceClient->getUserVolume(mOtherParticipantUUID));
|
||||
mVolumeSlider->setVisible(LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive());
|
||||
mVolumeSlider->setValue(gVoiceClient->getUserVolume(mOtherParticipantUUID));
|
||||
|
||||
childSetValue("mute_btn", LLMuteList::getInstance()->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat));
|
||||
childSetVisible("mute_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive());
|
||||
mMuteBtn->setValue(LLMuteList::getInstance()->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat));
|
||||
mMuteBtn->setVisible(LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive());
|
||||
}
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ class LLInventoryItem;
|
||||
class LLInventoryCategory;
|
||||
class LLIMSpeakerMgr;
|
||||
class LLPanelActiveSpeakers;
|
||||
class LLPanel;
|
||||
class LLButton;
|
||||
|
||||
class LLVoiceChannel : public LLVoiceClientStatusObserver
|
||||
{
|
||||
@@ -385,6 +387,13 @@ private:
|
||||
boost::signals2::connection mFocusLostSignal;
|
||||
|
||||
|
||||
CachedUICtrl<LLPanel> mActiveSpeakersPanel;
|
||||
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
|
||||
CachedUICtrl<LLUICtrl> mVolumeSlider;
|
||||
CachedUICtrl<LLButton> mEndCallBtn;
|
||||
CachedUICtrl<LLButton> mStartCallBtn;
|
||||
CachedUICtrl<LLButton> mSendBtn;
|
||||
CachedUICtrl<LLButton> mMuteBtn;
|
||||
|
||||
void disableWhileSessionStarting();
|
||||
|
||||
|
||||
@@ -484,9 +484,12 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject* object = selectNode->getObject();
|
||||
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
|
||||
// have permission to move and object is root of selection or individually selected
|
||||
if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
|
||||
if (object->permMove() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
(object->isRootEdit() || selectNode->mIndividualSelection))
|
||||
{
|
||||
object->mUnselectedChildrenPositions.clear() ;
|
||||
}
|
||||
@@ -572,9 +575,12 @@ void LLManipRotate::drag( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject* object = selectNode->getObject();
|
||||
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
|
||||
// have permission to move and object is root of selection or individually selected
|
||||
if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
|
||||
if (object->permMove() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
(object->isRootEdit() || selectNode->mIndividualSelection))
|
||||
{
|
||||
if (!object->isRootEdit())
|
||||
{
|
||||
@@ -626,9 +632,11 @@ void LLManipRotate::drag( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject* object = selectNode->getObject();
|
||||
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
|
||||
// to avoid cumulative position changes we calculate the objects new position using its saved position
|
||||
if (object && object->permMove())
|
||||
if (object && object->permMove() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()))
|
||||
{
|
||||
LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
|
||||
|
||||
@@ -709,7 +717,10 @@ void LLManipRotate::drag( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject*cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar())
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar())
|
||||
{
|
||||
selectNode->mLastRotation = cur->getRotation();
|
||||
selectNode->mLastPositionLocal = cur->getPosition();
|
||||
@@ -1876,7 +1887,10 @@ BOOL LLManipRotate::canAffectSelection()
|
||||
{
|
||||
virtual bool apply(LLViewerObject* objectp)
|
||||
{
|
||||
return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
|
||||
return objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
}
|
||||
} func;
|
||||
can_rotate = mObjectSelection->applyToObjects(&func);
|
||||
|
||||
@@ -825,7 +825,10 @@ void LLManipScale::drag( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject*cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar())
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar())
|
||||
{
|
||||
selectNode->mLastScale = cur->getScale();
|
||||
selectNode->mLastPositionLocal = cur->getPosition();
|
||||
@@ -972,7 +975,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject* cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar() )
|
||||
{
|
||||
const LLVector3& scale = selectNode->mSavedScale;
|
||||
|
||||
@@ -994,7 +1000,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject* cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() )
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar() && cur->isRootEdit() )
|
||||
{
|
||||
const LLVector3& scale = selectNode->mSavedScale;
|
||||
cur->setScale( scale_factor * scale );
|
||||
@@ -1042,7 +1051,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject*cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() )
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar() && !cur->isRootEdit() )
|
||||
{
|
||||
const LLVector3& scale = selectNode->mSavedScale;
|
||||
cur->setScale( scale_factor * scale, FALSE );
|
||||
@@ -1250,7 +1262,10 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
|
||||
{
|
||||
LLSelectNode* selectNode = *iter;
|
||||
LLViewerObject*cur = selectNode->getObject();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
|
||||
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
|
||||
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!cur->isAvatar() )
|
||||
{
|
||||
LLBBox cur_bbox = cur->getBoundingBoxAgent();
|
||||
LLVector3 start_local = cur_bbox.agentToLocal( drag_start_agent );
|
||||
@@ -2057,7 +2072,10 @@ BOOL LLManipScale::canAffectSelection()
|
||||
{
|
||||
virtual bool apply(LLViewerObject* objectp)
|
||||
{
|
||||
return objectp->permModify() && objectp->permMove() && !objectp->isSeat();
|
||||
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
|
||||
return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
!objectp->isSeat();
|
||||
}
|
||||
} func;
|
||||
can_scale = mObjectSelection->applyToObjects(&func);
|
||||
|
||||
@@ -705,7 +705,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
|
||||
}
|
||||
}
|
||||
|
||||
if (object->permMove())
|
||||
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
if (object->permMove() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()))
|
||||
{
|
||||
// handle attachments in local space
|
||||
if (object->isAttachment() && object->mDrawable.notNull())
|
||||
@@ -2328,7 +2330,10 @@ BOOL LLManipTranslate::canAffectSelection()
|
||||
{
|
||||
virtual bool apply(LLViewerObject* objectp)
|
||||
{
|
||||
return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
|
||||
return objectp->permMove() && !objectp->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
}
|
||||
} func;
|
||||
can_move = mObjectSelection->applyToObjects(&func);
|
||||
|
||||
@@ -170,7 +170,7 @@ BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask )
|
||||
|
||||
if (mMediaSource)
|
||||
{
|
||||
mMediaSource->mouseMove(x, y);
|
||||
mMediaSource->mouseMove(x, y, mask);
|
||||
|
||||
gViewerWindow->setCursor(mLastSetCursor);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
|
||||
|
||||
if (mMediaSource)
|
||||
{
|
||||
mMediaSource->mouseUp(x, y);
|
||||
mMediaSource->mouseUp(x, y, mask);
|
||||
|
||||
/*// *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
|
||||
// in addition to the onFocusReceived() call below. Undo this. JC
|
||||
@@ -222,7 +222,7 @@ BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
|
||||
convertInputCoords(x, y);
|
||||
|
||||
if (mMediaSource)
|
||||
mMediaSource->mouseDown(x, y);
|
||||
mMediaSource->mouseDown(x, y, mask);
|
||||
|
||||
gFocusMgr.setMouseCapture( this );
|
||||
|
||||
@@ -265,11 +265,11 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
|
||||
{
|
||||
if (LLUICtrl::handleRightMouseDown(x, y, mask)) return TRUE;
|
||||
|
||||
/*S32 media_x = x, media_y = y;
|
||||
S32 media_x = x, media_y = y;
|
||||
convertInputCoords(media_x, media_y);
|
||||
|
||||
if (mMediaSource)
|
||||
mMediaSource->mouseDown(media_x, media_y);
|
||||
mMediaSource->mouseDown(media_x, media_y, mask, 1);
|
||||
|
||||
gFocusMgr.setMouseCapture( this );
|
||||
|
||||
@@ -277,7 +277,7 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
|
||||
{
|
||||
setFocus( TRUE );
|
||||
}
|
||||
*/
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
|
||||
convertInputCoords(x, y);
|
||||
|
||||
if (mMediaSource)
|
||||
mMediaSource->mouseLeftDoubleClick( x, y);
|
||||
mMediaSource->mouseDoubleClick( x, y, mask);
|
||||
|
||||
gFocusMgr.setMouseCapture( this );
|
||||
|
||||
@@ -916,20 +916,16 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
|
||||
|
||||
case MEDIA_EVENT_NAVIGATE_BEGIN:
|
||||
{
|
||||
LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN, url is " << self->getNavigateURI() << LL_ENDL;
|
||||
if(mMediaSource && mHideLoading)
|
||||
{
|
||||
mMediaSource->suspendUpdates(true);
|
||||
}
|
||||
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN, url is " << self->getNavigateURI() << LL_ENDL;
|
||||
};
|
||||
break;
|
||||
|
||||
case MEDIA_EVENT_NAVIGATE_COMPLETE:
|
||||
{
|
||||
LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
|
||||
if(mMediaSource && mHideLoading)
|
||||
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
|
||||
if(mHidingInitialLoad)
|
||||
{
|
||||
mMediaSource->suspendUpdates(false);
|
||||
mHidingInitialLoad = false;
|
||||
}
|
||||
};
|
||||
break;
|
||||
|
||||
@@ -177,6 +177,7 @@ class LLMediaCtrl :
|
||||
bool mStretchToFill;
|
||||
bool mMaintainAspectRatio;
|
||||
bool mHideLoading;
|
||||
bool mHidingInitialLoad;
|
||||
bool mDecoupleTextureSize;
|
||||
S32 mTextureWidth;
|
||||
S32 mTextureHeight;
|
||||
|
||||
@@ -89,6 +89,16 @@ BOOL LLMediaRemoteCtrl::postBuild()
|
||||
childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this);
|
||||
childSetAction("music_pause",LLOverlayBar::toggleMusicPlay,this);
|
||||
|
||||
mMusicPlayBtn.connect(this,"music_play");
|
||||
mMusicStopBtn.connect(this,"music_stop");
|
||||
mMusicPauseBtn.connect(this,"music_pause");
|
||||
mMediaPlayBtn.connect(this,"media_play");
|
||||
mMediaStopBtn.connect(this,"media_stop");
|
||||
mMediaPauseBtn.connect(this,"media_pause");
|
||||
mMediaIcon.connect(this,"media_icon");
|
||||
mMusicIcon.connect(this,"music_icon");
|
||||
mExpandBtn.connect(this,"expand");
|
||||
|
||||
childSetAction("expand", onClickExpandBtn, this);
|
||||
|
||||
LLButton *pause = getChild<LLButton>("music_pause");
|
||||
@@ -101,7 +111,7 @@ void LLMediaRemoteCtrl::draw()
|
||||
{
|
||||
enableMediaButtons();
|
||||
|
||||
LLButton* expand_button = getChild<LLButton>("expand");
|
||||
LLButton* expand_button = mExpandBtn;
|
||||
if (expand_button)
|
||||
{
|
||||
if (expand_button->getToggleState())
|
||||
@@ -147,8 +157,8 @@ void LLMediaRemoteCtrl::setToolTip(const std::string& msg)
|
||||
std::string tool_tip = LLMIMETypes::findToolTip(mime_type);
|
||||
std::string play_tip = LLMIMETypes::findPlayTip(mime_type);
|
||||
// childSetToolTip("media_stop", mControls->getString("stop_label") + "\n" + tool_tip);
|
||||
childSetToolTip("media_icon", tool_tip);
|
||||
childSetToolTip("media_play", play_tip);
|
||||
mMediaIcon->setToolTip(tool_tip);
|
||||
mMediaIcon->setToolTip(play_tip);
|
||||
}
|
||||
|
||||
void LLMediaRemoteCtrl::enableMediaButtons()
|
||||
@@ -227,13 +237,13 @@ void LLMediaRemoteCtrl::enableMediaButtons()
|
||||
// Don't test the mime-type: this is not updated in a consistent basis. The existence of a valid gAudiop is enough guarantee.
|
||||
}
|
||||
const std::string media_icon_name = LLMIMETypes::findIcon(media_type);
|
||||
LLButton* music_play_btn = getChild<LLButton>("music_play");
|
||||
LLButton* music_stop_btn = getChild<LLButton>("music_stop");
|
||||
LLButton* music_pause_btn = getChild<LLButton>("music_pause");
|
||||
LLButton* media_play_btn = getChild<LLButton>("media_play");
|
||||
LLButton* media_stop_btn = getChild<LLButton>("media_stop");
|
||||
LLButton* media_pause_btn = getChild<LLButton>("media_pause");
|
||||
LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon");
|
||||
LLButton* music_play_btn = mMusicPlayBtn;
|
||||
LLButton* music_stop_btn = mMusicStopBtn;
|
||||
LLButton* music_pause_btn = mMusicPauseBtn;
|
||||
LLButton* media_play_btn = mMediaPlayBtn;
|
||||
LLButton* media_stop_btn = mMediaPlayBtn;
|
||||
LLButton* media_pause_btn = mMediaPauseBtn;
|
||||
LLIconCtrl* media_icon = mMediaIcon;
|
||||
|
||||
music_play_btn->setEnabled(play_music_enabled);
|
||||
music_stop_btn->setEnabled(stop_music_enabled);
|
||||
@@ -262,7 +272,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
|
||||
music_pause_btn->setToolTip(mCachedPauseTip);
|
||||
}
|
||||
|
||||
childSetColor("music_icon", music_icon_color);
|
||||
mMusicIcon->setColor(music_icon_color);
|
||||
if(!media_icon_name.empty())
|
||||
{
|
||||
media_icon->setImage(media_icon_name);
|
||||
@@ -273,7 +283,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
|
||||
media_pause_btn->setEnabled(media_show_pause);
|
||||
media_pause_btn->setVisible(media_show_pause);
|
||||
media_play_btn->setVisible(! media_show_pause);
|
||||
childSetColor("media_icon", media_icon_color);
|
||||
mMediaIcon->setColor(media_icon_color);
|
||||
|
||||
setToolTip(media_url);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "llpanel.h"
|
||||
|
||||
class LLButton;
|
||||
class LLIconCtrl;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -61,6 +62,16 @@ protected:
|
||||
void build();
|
||||
|
||||
std::string mCachedPauseTip;
|
||||
|
||||
CachedUICtrl<LLButton> mMusicPlayBtn;
|
||||
CachedUICtrl<LLButton> mMusicStopBtn;
|
||||
CachedUICtrl<LLButton> mMusicPauseBtn;
|
||||
CachedUICtrl<LLButton> mMediaPlayBtn;
|
||||
CachedUICtrl<LLButton> mMediaStopBtn;
|
||||
CachedUICtrl<LLButton> mMediaPauseBtn;
|
||||
CachedUICtrl<LLButton> mExpandBtn;
|
||||
CachedUICtrl<LLIconCtrl> mMediaIcon;
|
||||
CachedUICtrl<LLIconCtrl> mMusicIcon;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
@@ -189,7 +191,16 @@ BOOL LLOverlayBar::postBuild()
|
||||
setFocusRoot(TRUE);
|
||||
mBuilt = true;
|
||||
|
||||
mOriginalIMLabel = getChild<LLButton>("New IM")->getLabelSelected();
|
||||
mChatbarAndButtons.connect(this,"chatbar_and_buttons");
|
||||
mNewIM.connect(this,"New IM");
|
||||
mNotBusy.connect(this,"Set Not Busy");
|
||||
mMouseLook.connect(this,"Mouselook");
|
||||
mStandUp.connect(this,"Stand Up");
|
||||
mFlyCam.connect(this,"Flycam");
|
||||
mChatBar.connect(this,"chat_bar");
|
||||
mVoiceRemoteContainer.connect(this,"voice_remote_container");
|
||||
|
||||
mOriginalIMLabel = mNewIM->getLabelSelected();
|
||||
|
||||
layoutButtons();
|
||||
|
||||
@@ -203,6 +214,7 @@ BOOL LLOverlayBar::postBuild()
|
||||
childSetVisible("AdvSettings_container_exp", sAdvSettingsPopup);
|
||||
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -214,6 +226,12 @@ LLOverlayBar::~LLOverlayBar()
|
||||
// virtual
|
||||
void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
{
|
||||
S32 delta_width = width - getRect().getWidth();
|
||||
S32 delta_height = height - getRect().getHeight();
|
||||
|
||||
if (!delta_width && !delta_height && !sForceReshape)
|
||||
return;
|
||||
|
||||
LLView::reshape(width, height, called_from_parent);
|
||||
|
||||
if (mBuilt)
|
||||
@@ -224,53 +242,60 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
|
||||
void LLOverlayBar::layoutButtons()
|
||||
{
|
||||
LLView* state_buttons_panel = getChildView("state_buttons");
|
||||
LLView* state_buttons_panel = getChildView("state_management_buttons_container");
|
||||
|
||||
if (state_buttons_panel->getVisible())
|
||||
{
|
||||
LLViewQuery query;
|
||||
LLWidgetTypeFilter<LLButton> widget_filter;
|
||||
query.addPreFilter(LLEnabledFilter::getInstance());
|
||||
query.addPreFilter(&widget_filter);
|
||||
U32 required_width=0;
|
||||
const child_list_t& view_list = *(state_buttons_panel->getChildList());
|
||||
BOOST_FOREACH(LLView* viewp, view_list)
|
||||
{
|
||||
required_width+=viewp->getRect().getWidth();
|
||||
}
|
||||
|
||||
child_list_t button_list = query(state_buttons_panel);
|
||||
const S32 MAX_BAR_WIDTH = 800;
|
||||
//const S32 MAX_BUTTON_WIDTH = 150;
|
||||
|
||||
const S32 MAX_BAR_WIDTH = 600;
|
||||
S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH);
|
||||
|
||||
// calculate button widths
|
||||
const S32 MAX_BUTTON_WIDTH = 150;
|
||||
S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH);
|
||||
S32 btn_width = segment_width - gSavedSettings.getS32("StatusBarPad");
|
||||
static LLCachedControl<S32> status_bar_pad("StatusBarPad",10);
|
||||
S32 usable_bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH) - (view_list.size()-1) * status_bar_pad;
|
||||
F32 element_scale = (F32)usable_bar_width / (F32)required_width;
|
||||
|
||||
// Evenly space all buttons, starting from left
|
||||
S32 left = 0;
|
||||
S32 bottom = 1;
|
||||
|
||||
for (child_list_reverse_iter_t child_iter = button_list.rbegin();
|
||||
child_iter != button_list.rend(); ++child_iter)
|
||||
BOOST_REVERSE_FOREACH(LLView* viewp, view_list)
|
||||
{
|
||||
LLView *view = *child_iter;
|
||||
LLRect r = view->getRect();
|
||||
r.setOriginAndSize(left, bottom, btn_width, r.getHeight());
|
||||
view->setRect(r);
|
||||
left += segment_width;
|
||||
LLRect r = viewp->getRect();
|
||||
S32 new_width = r.getWidth() * element_scale;
|
||||
//if(dynamic_cast<LLButton*>(viewp))
|
||||
// new_width = llclamp(new_width,0,MAX_BUTTON_WIDTH);
|
||||
r.setOriginAndSize(left, bottom, new_width, r.getHeight());
|
||||
viewp->setShape(r,false);
|
||||
left += viewp->getRect().getWidth() + status_bar_pad;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLButton* LLOverlayBar::updateButtonVisiblity(LLButton* button, bool visible)
|
||||
{
|
||||
if (button && (bool)button->getVisible() != visible)
|
||||
{
|
||||
button->setVisible(visible);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
// Per-frame updates of visibility
|
||||
void LLOverlayBar::refresh()
|
||||
{
|
||||
BOOL buttons_changed = FALSE;
|
||||
bool buttons_changed = FALSE;
|
||||
|
||||
BOOL im_received = gIMMgr->getIMReceived();
|
||||
int unread_count = gIMMgr->getIMUnreadCount();
|
||||
LLButton* button = getChild<LLButton>("New IM");
|
||||
|
||||
if ((button && button->getVisible() != im_received) ||
|
||||
(button && button->getVisible()))
|
||||
if(LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived()))
|
||||
{
|
||||
int unread_count = gIMMgr->getIMUnreadCount();
|
||||
if (unread_count > 0)
|
||||
{
|
||||
if (unread_count > 1)
|
||||
@@ -284,86 +309,16 @@ void LLOverlayBar::refresh()
|
||||
button->setLabel("1 " + mOriginalIMLabel);
|
||||
}
|
||||
}
|
||||
button->setVisible(im_received);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
buttons_changed = true;
|
||||
}
|
||||
|
||||
BOOL busy = gAgent.getBusy();
|
||||
button = getChild<LLButton>("Set Not Busy");
|
||||
if (button && button->getVisible() != busy)
|
||||
{
|
||||
button->setVisible(busy);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
}
|
||||
|
||||
BOOL flycam = LLViewerJoystick::getInstance()->getOverrideCamera();
|
||||
button = getChild<LLButton>("Flycam");
|
||||
if (button && button->getVisible() != flycam)
|
||||
{
|
||||
button->setVisible(flycam);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
}
|
||||
|
||||
BOOL mouselook_grabbed;
|
||||
mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
|
||||
|| gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);
|
||||
button = getChild<LLButton>("Mouselook");
|
||||
|
||||
if (button && button->getVisible() != mouselook_grabbed)
|
||||
{
|
||||
button->setVisible(mouselook_grabbed);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
}
|
||||
|
||||
BOOL sitting = FALSE;
|
||||
if (gAgentAvatarp)
|
||||
{
|
||||
// sitting = gAgentAvatarp->isSitting();
|
||||
buttons_changed |= updateButtonVisiblity(mNotBusy,gAgent.getBusy()) != NULL;
|
||||
buttons_changed |= updateButtonVisiblity(mFlyCam,LLViewerJoystick::getInstance()->getOverrideCamera()) != NULL;
|
||||
buttons_changed |= updateButtonVisiblity(mMouseLook,gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)||gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX)) != NULL;
|
||||
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
|
||||
sitting = gAgentAvatarp->isSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT);
|
||||
// buttons_changed |= updateButtonVisiblity("Stand Up", isAgentAvatarValid() && gAgentAvatarp->isSitting()) != NULL;
|
||||
buttons_changed |= updateButtonVisiblity(mStandUp,isAgentAvatarValid() && gAgentAvatarp->isSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) != NULL;
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
button = getChild<LLButton>("Stand Up");
|
||||
|
||||
if (button && button->getVisible() != sitting)
|
||||
{
|
||||
button->setVisible(sitting);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
}
|
||||
|
||||
BOOL teleporting = FALSE;
|
||||
if ((gAgent.getTeleportState() == LLAgent::TELEPORT_START) ||
|
||||
(gAgent.getTeleportState() == LLAgent::TELEPORT_REQUESTED) ||
|
||||
(gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING) ||
|
||||
(gAgent.getTeleportState() == LLAgent::TELEPORT_START))
|
||||
{
|
||||
teleporting = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
teleporting = FALSE;
|
||||
}
|
||||
|
||||
|
||||
button = getChild<LLButton>("Cancel TP");
|
||||
|
||||
if (button && button->getVisible() != teleporting)
|
||||
{
|
||||
button->setVisible(teleporting);
|
||||
sendChildToFront(button);
|
||||
moveChildToBackOfTabGroup(button);
|
||||
buttons_changed = TRUE;
|
||||
}
|
||||
buttons_changed |= updateButtonVisiblity(mCancelBtn,(gAgent.getTeleportState() >= LLAgent::TELEPORT_START) && (gAgent.getTeleportState() <= LLAgent::TELEPORT_MOVING)) != NULL;
|
||||
|
||||
moveChildToBackOfTabGroup(mAORemote);
|
||||
moveChildToBackOfTabGroup(mMediaRemote);
|
||||
@@ -384,7 +339,7 @@ void LLOverlayBar::refresh()
|
||||
childSetVisible("AdvSettings_container", FALSE);
|
||||
childSetVisible("AdvSettings_container_exp", FALSE);
|
||||
childSetVisible("ao_remote_container", FALSE);
|
||||
childSetVisible("state_buttons", FALSE);
|
||||
childSetVisible("state_management_buttons_container", FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -394,15 +349,15 @@ void LLOverlayBar::refresh()
|
||||
childSetVisible("AdvSettings_container", !sAdvSettingsPopup);//!gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
|
||||
childSetVisible("AdvSettings_container_exp", sAdvSettingsPopup);//gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
|
||||
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
|
||||
childSetVisible("state_buttons", TRUE);
|
||||
childSetVisible("state_management_buttons_container", TRUE);
|
||||
}
|
||||
}
|
||||
if(!in_mouselook)
|
||||
childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled());
|
||||
mVoiceRemoteContainer->setVisible(LLVoiceClient::voiceEnabled());
|
||||
|
||||
// always let user toggle into and out of chatbar
|
||||
static const LLCachedControl<bool> chat_visible("ChatVisible",true);
|
||||
childSetVisible("chat_bar", chat_visible);
|
||||
mChatBar->setVisible(chat_visible);
|
||||
|
||||
if (buttons_changed)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ class LLSlider;
|
||||
class LLVoiceRemoteCtrl;
|
||||
class wlfPanel_AdvSettings;
|
||||
class AORemoteCtrl;
|
||||
class LLChatBar;
|
||||
|
||||
class LLOverlayBar
|
||||
: public LLPanel
|
||||
@@ -64,10 +65,14 @@ public:
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
LLButton* updateButtonVisiblity(LLButton* button, bool visible);
|
||||
|
||||
void layoutButtons();
|
||||
|
||||
// helpers for returning desired state
|
||||
BOOL musicPlaying() { return mMusicState == PLAYING; }
|
||||
|
||||
LLView* getChatbarAndButtons() const {return mChatbarAndButtons;}
|
||||
|
||||
static void onClickIMReceived(void* data);
|
||||
static void onClickSetNotBusy(void* data);
|
||||
@@ -114,7 +119,14 @@ protected:
|
||||
S32 mMusicState;
|
||||
std::string mOriginalIMLabel;
|
||||
|
||||
|
||||
CachedUICtrl<LLView> mChatbarAndButtons;
|
||||
CachedUICtrl<LLButton> mNewIM;
|
||||
CachedUICtrl<LLButton> mNotBusy;
|
||||
CachedUICtrl<LLButton> mMouseLook;
|
||||
CachedUICtrl<LLButton> mStandUp;
|
||||
CachedUICtrl<LLButton> mFlyCam;
|
||||
CachedUICtrl<LLChatBar> mChatBar;
|
||||
CachedUICtrl<LLPanel> mVoiceRemoteContainer;
|
||||
private:
|
||||
|
||||
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
/**
|
||||
* @file llpanellcd.cpp
|
||||
* @brief lcd options panel
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llpanelLCD.h"
|
||||
|
||||
// linden library includes
|
||||
#include "llerror.h"
|
||||
#include "llrect.h"
|
||||
#include "llfontgl.h"
|
||||
#include "message.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
// project includes
|
||||
#include "llviewerwindow.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llradiogroup.h"
|
||||
#include "llresmgr.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llui.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
//Ventrella
|
||||
#include "llagent.h"
|
||||
//end Ventrella
|
||||
|
||||
// for Logitech LCD keyboards / speakers
|
||||
#ifndef LL_LCD_H
|
||||
#include "lllcd.h"
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
|
||||
//
|
||||
// Static functions
|
||||
//
|
||||
|
||||
|
||||
LLPanelLCD::LLPanelLCD()
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_lcd.xml");
|
||||
}
|
||||
|
||||
BOOL LLPanelLCD::postBuild()
|
||||
{
|
||||
requires<LLRadioGroup>("LCDDestination");
|
||||
requires<LLCheckBoxCtrl>("DisplayLinden");
|
||||
requires<LLCheckBoxCtrl>("DisplayDebug");
|
||||
requires<LLCheckBoxCtrl>("DisplayDebugConsole");
|
||||
requires<LLCheckBoxCtrl>("DisplayRegion");
|
||||
requires<LLCheckBoxCtrl>("DisplayChat");
|
||||
requires<LLCheckBoxCtrl>("DisplayIM");
|
||||
|
||||
if (!checkRequirements())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
refresh();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
LLPanelLCD::~LLPanelLCD()
|
||||
{
|
||||
// Children all cleaned up by default view destructor.
|
||||
}
|
||||
|
||||
void LLPanelLCD::refresh()
|
||||
{
|
||||
mLCDDestination = gSavedSettings.getS32("LCDDestination");
|
||||
mDisplayChat = gSavedSettings.getBOOL("DisplayChat");
|
||||
mDisplayIM = gSavedSettings.getBOOL("DisplayIM");
|
||||
mDisplayRegion = gSavedSettings.getBOOL("DisplayRegion");
|
||||
mDisplayDebug = gSavedSettings.getBOOL("DisplayDebug");
|
||||
mDisplayDebugConsole = gSavedSettings.getBOOL("DisplayDebugConsole");
|
||||
mDisplayLinden = gSavedSettings.getBOOL("DisplayLinden");
|
||||
|
||||
LLPanel::refresh();
|
||||
}
|
||||
|
||||
void LLPanelLCD::apply()
|
||||
{
|
||||
// nothing really to do here.
|
||||
}
|
||||
|
||||
|
||||
void LLPanelLCD::cancel()
|
||||
{
|
||||
// doing this to restore situation when we entered this function
|
||||
gSavedSettings.setS32("LCDDestination", mLCDDestination);
|
||||
gSavedSettings.setBOOL("DisplayChat", mDisplayChat);
|
||||
gSavedSettings.setBOOL("DisplayIM", mDisplayIM);
|
||||
gSavedSettings.setBOOL("DisplayRegion", mDisplayRegion);
|
||||
gSavedSettings.setBOOL("DisplayDebug", mDisplayDebug);
|
||||
gSavedSettings.setBOOL("DisplayDebugConsole", mDisplayDebugConsole);
|
||||
gSavedSettings.setBOOL("DisplayLinden", mDisplayLinden);
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* @file llpanelLCD.h
|
||||
* @brief lcd options panel
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_PANEL_LCD_H
|
||||
#define LL_PANEL_LCD_H
|
||||
|
||||
#include "llpanel.h"
|
||||
|
||||
class LLCheckBoxCtrl;
|
||||
|
||||
|
||||
class LLPanelLCD : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPanelLCD();
|
||||
virtual ~LLPanelLCD();
|
||||
|
||||
virtual BOOL postBuild();
|
||||
virtual void refresh();
|
||||
void apply();
|
||||
void cancel();
|
||||
|
||||
protected:
|
||||
S32 mLCDDestination;
|
||||
BOOL mDisplayChat;
|
||||
BOOL mDisplayRegion;
|
||||
BOOL mDisplayDebug;
|
||||
BOOL mDisplayDebugConsole;
|
||||
BOOL mDisplayLinden;
|
||||
BOOL mDisplayIM;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -121,7 +121,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
|
||||
|
||||
// BUG? Check for all objects being editable?
|
||||
bool editable = gAgent.isGodlike()
|
||||
|| (objectp->permModify()
|
||||
|| (objectp->permModify() && !objectp->isPermanentEnforced()
|
||||
&& ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488
|
||||
BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
|
||||
|
||||
@@ -150,6 +150,9 @@ void LLPanelContents::getState(LLViewerObject *objectp )
|
||||
all_volume &&
|
||||
((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
|
||||
|| (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)));
|
||||
|
||||
getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced());
|
||||
mPanelInventory->setEnabled(!objectp->isPermanentEnforced());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ void LLPanelFace::getState()
|
||||
&& objectp->getPCode() == LL_PCODE_VOLUME
|
||||
&& objectp->permModify())
|
||||
{
|
||||
BOOL editable = objectp->permModify();
|
||||
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
|
||||
|
||||
|
||||
// only turn on auto-adjust button if there is a media renderer and the media is loaded
|
||||
|
||||
@@ -394,7 +394,6 @@ LLPanelObject::LLPanelObject(const std::string& name)
|
||||
mIsPhysical(FALSE),
|
||||
mIsTemporary(FALSE),
|
||||
mIsPhantom(FALSE),
|
||||
mCastShadows(TRUE),
|
||||
mSelectedType(MI_BOX)
|
||||
{
|
||||
}
|
||||
@@ -478,10 +477,10 @@ void LLPanelObject::getState( )
|
||||
}
|
||||
|
||||
// can move or rotate only linked group with move permissions, or sub-object with move and modify perms
|
||||
BOOL enable_move = objectp->permMove() && ((!objectp->isAttachment() && objectp->permModify()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_scale = objectp->permMove() && objectp->permModify();
|
||||
BOOL enable_rotate = objectp->permMove() && ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_link = objectp->permMove() && ((!objectp->isAttachment() && objectp->permModify()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify();
|
||||
BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
|
||||
|
||||
childSetEnabled("build_math_constants",true);
|
||||
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
|
||||
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
|
||||
@@ -528,8 +527,8 @@ void LLPanelObject::getState( )
|
||||
mCtrlPosX->setEnabled(enable_move);
|
||||
mCtrlPosY->setEnabled(enable_move);
|
||||
mCtrlPosZ->setEnabled(enable_move);
|
||||
mBtnLinkObj->setEnabled((enable_link && !single_volume));
|
||||
mBtnUnlinkObj->setEnabled((enable_link && (selected_count > 1)));
|
||||
mBtnLinkObj->setEnabled((enable_move && !single_volume));
|
||||
mBtnUnlinkObj->setEnabled((enable_move && (selected_count > 1)));
|
||||
mBtnCopyPos->setEnabled(enable_move);
|
||||
mBtnPastePos->setEnabled(enable_move);
|
||||
mBtnPastePosClip->setEnabled(enable_move);
|
||||
@@ -624,9 +623,15 @@ void LLPanelObject::getState( )
|
||||
childSetVisible("select_single", TRUE);
|
||||
childSetEnabled("select_single", TRUE);
|
||||
}
|
||||
BOOL is_flexible = volobjp && volobjp->isFlexible();
|
||||
BOOL is_permanent = root_objectp->flagObjectPermanent();
|
||||
BOOL is_permanent_enforced = root_objectp->isPermanentEnforced();
|
||||
BOOL is_character = root_objectp->flagCharacter();
|
||||
llassert(!is_permanent || !is_character); // should never have a permanent object that is also a character
|
||||
|
||||
// Lock checkbox - only modifiable if you own the object.
|
||||
BOOL self_owned = (gAgent.getID() == owner_id);
|
||||
mCheckLock->setEnabled( roots_selected > 0 && self_owned );
|
||||
mCheckLock->setEnabled( roots_selected > 0 && self_owned && !is_permanent_enforced);
|
||||
|
||||
// More lock and debit checkbox - get the values
|
||||
BOOL valid;
|
||||
@@ -656,29 +661,27 @@ void LLPanelObject::getState( )
|
||||
}
|
||||
}
|
||||
|
||||
BOOL is_flexible = volobjp && volobjp->isFlexible();
|
||||
|
||||
// Physics checkbox
|
||||
mIsPhysical = root_objectp->usePhysics();
|
||||
mIsPhysical = root_objectp->flagUsePhysics();
|
||||
llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical
|
||||
|
||||
mCheckPhysics->set( mIsPhysical );
|
||||
mCheckPhysics->setEnabled( roots_selected>0
|
||||
&& (editable || gAgent.isGodlike())
|
||||
&& !is_flexible);
|
||||
&& !is_flexible && !is_permanent);
|
||||
|
||||
mIsTemporary = root_objectp->flagTemporaryOnRez();
|
||||
llassert(!is_permanent || !mIsTemporary); // should never has a permanent object that is also temporary
|
||||
|
||||
mCheckTemporary->set( mIsTemporary );
|
||||
mCheckTemporary->setEnabled( roots_selected>0 && editable );
|
||||
mCheckTemporary->setEnabled( roots_selected>0 && editable && !is_permanent);
|
||||
|
||||
mIsPhantom = root_objectp->flagPhantom();
|
||||
BOOL is_volume_detect = root_objectp->flagVolumeDetect();
|
||||
llassert(!is_character || !mIsPhantom); // should never have a character that is also a phantom
|
||||
mCheckPhantom->set( mIsPhantom );
|
||||
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
|
||||
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced && !is_character && !is_volume_detect);
|
||||
|
||||
#if 0 // 1.9.2
|
||||
mCastShadows = root_objectp->flagCastShadows();
|
||||
mCheckCastShadows->set( mCastShadows );
|
||||
mCheckCastShadows->setEnabled( roots_selected==1 && editable );
|
||||
#endif
|
||||
|
||||
// Update material part
|
||||
// slightly inefficient - materials are unique per object, not per TE
|
||||
U8 material_code = 0;
|
||||
@@ -731,6 +734,7 @@ void LLPanelObject::getState( )
|
||||
BOOL hole_enabled = FALSE;
|
||||
F32 scale_x=1.f, scale_y=1.f;
|
||||
BOOL isMesh = FALSE;
|
||||
|
||||
if( !objectp || !objectp->getVolume() || !editable || !single_volume)
|
||||
{
|
||||
// Clear out all geometry fields.
|
||||
@@ -759,11 +763,10 @@ void LLPanelObject::getState( )
|
||||
{
|
||||
// Only allowed to change these parameters for objects
|
||||
// that you have permissions on AND are not attachments.
|
||||
enabled = root_objectp->permModify();
|
||||
|
||||
const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
|
||||
|
||||
enabled = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
|
||||
|
||||
// Volume type
|
||||
const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
|
||||
U8 path = volume_params.getPathParams().getCurveType();
|
||||
U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
|
||||
U8 profile = profile_and_hole & LL_PCODE_PROFILE_MASK;
|
||||
@@ -1525,22 +1528,6 @@ void LLPanelObject::sendIsPhantom()
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelObject::sendCastShadows()
|
||||
{
|
||||
BOOL value = mCheckCastShadows->get();
|
||||
if( mCastShadows != value )
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionUpdateCastShadows(value);
|
||||
mCastShadows = value;
|
||||
|
||||
llinfos << "update cast shadows sent" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "update cast shadows not changed" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
|
||||
{
|
||||
@@ -2369,10 +2356,6 @@ void LLPanelObject::clearCtrls()
|
||||
mCheckTemporary ->setEnabled( FALSE );
|
||||
mCheckPhantom ->set(FALSE);
|
||||
mCheckPhantom ->setEnabled( FALSE );
|
||||
#if 0 // 1.9.2
|
||||
mCheckCastShadows->set(FALSE);
|
||||
mCheckCastShadows->setEnabled( FALSE );
|
||||
#endif
|
||||
mComboMaterial ->setEnabled( FALSE );
|
||||
mLabelMaterial ->setEnabled( FALSE );
|
||||
// Disable text labels
|
||||
@@ -2468,14 +2451,6 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata )
|
||||
self->sendIsPhantom();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata )
|
||||
{
|
||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
||||
self->sendCastShadows();
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
|
||||
@@ -72,7 +72,6 @@ public:
|
||||
static void onCommitPhysics( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitTemporary( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitPhantom( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitCastShadows( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onLinkObj( void* user_data);
|
||||
static void onUnlinkObj( void* user_data);
|
||||
@@ -110,7 +109,6 @@ protected:
|
||||
void sendIsPhysical();
|
||||
void sendIsTemporary();
|
||||
void sendIsPhantom();
|
||||
void sendCastShadows();
|
||||
void sendSculpt();
|
||||
|
||||
void getVolumeParams(LLVolumeParams& volume_params);
|
||||
@@ -207,7 +205,6 @@ protected:
|
||||
LLCheckBoxCtrl *mCheckPhysics;
|
||||
LLCheckBoxCtrl *mCheckTemporary;
|
||||
LLCheckBoxCtrl *mCheckPhantom;
|
||||
LLCheckBoxCtrl *mCheckCastShadows;
|
||||
|
||||
LLTextureCtrl *mCtrlSculptTexture;
|
||||
LLTextBox *mLabelSculptType;
|
||||
@@ -222,7 +219,6 @@ protected:
|
||||
BOOL mIsPhysical; // to avoid sending "physical" when not changed
|
||||
BOOL mIsTemporary; // to avoid sending "temporary" when not changed
|
||||
BOOL mIsPhantom; // to avoid sending "phantom" when not changed
|
||||
BOOL mCastShadows; // to avoid sending "cast shadows" when not changed
|
||||
S32 mSelectedType; // So we know what selected type we last were
|
||||
|
||||
LLUUID mSculptTextureRevert; // so we can revert the sculpt texture on cancel
|
||||
|
||||
281
indra/newview/llpanelpathfindingrebakenavmesh.cpp
Normal file
281
indra/newview/llpanelpathfindingrebakenavmesh.cpp
Normal file
@@ -0,0 +1,281 @@
|
||||
/**
|
||||
* @file llpanelpathfindingrebakenavmesh.cpp
|
||||
* @brief Implementation of llpanelpathfindingrebakenavmesh
|
||||
* @author Prep@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpanelpathfindingrebakenavmesh.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "llenvmanager.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanel.h"
|
||||
#include "llpathfindingmanager.h"
|
||||
#include "llpathfindingnavmesh.h"
|
||||
#include "llpathfindingnavmeshstatus.h"
|
||||
#include "lltoolbar.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh* LLPanelPathfindingRebakeNavmesh::getInstance()
|
||||
{
|
||||
static LLPanelPathfindingRebakeNavmesh* panel = getPanel();
|
||||
return panel;
|
||||
}
|
||||
|
||||
BOOL LLPanelPathfindingRebakeNavmesh::postBuild()
|
||||
{
|
||||
//Rebake button
|
||||
mNavMeshRebakeButton = getChild<LLButton>("navmesh_btn");
|
||||
llassert(mNavMeshRebakeButton != NULL);
|
||||
mNavMeshRebakeButton->setCommitCallback(boost::bind(&LLPanelPathfindingRebakeNavmesh::onNavMeshRebakeClick, this));
|
||||
//LLHints::registerHintTarget("navmesh_btn", mNavMeshRebakeButton->getHandle());
|
||||
|
||||
//Sending rebake request
|
||||
mNavMeshSendingButton = findChild<LLButton>("navmesh_btn_sending");
|
||||
llassert(mNavMeshSendingButton != NULL);
|
||||
//LLHints::registerHintTarget("navmesh_btn_sending", mNavMeshSendingButton->getHandle());
|
||||
|
||||
//rebaking...
|
||||
mNavMeshBakingButton = findChild<LLButton>("navmesh_btn_baking");
|
||||
llassert(mNavMeshBakingButton != NULL);
|
||||
//LLHints::registerHintTarget("navmesh_btn_baking", mNavMeshBakingButton->getHandle());
|
||||
|
||||
setMode(kRebakeNavMesh_Default);
|
||||
|
||||
createNavMeshStatusListenerForCurrentRegion();
|
||||
|
||||
if ( !mRegionCrossingSlot.connected() )
|
||||
{
|
||||
mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this));
|
||||
}
|
||||
|
||||
if (!mAgentStateSlot.connected())
|
||||
{
|
||||
mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleAgentState, this, _1));
|
||||
}
|
||||
LLPathfindingManager::getInstance()->requestGetAgentState();
|
||||
|
||||
return LLPanel::postBuild();
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::draw()
|
||||
{
|
||||
if (doDraw())
|
||||
{
|
||||
updatePosition();
|
||||
LLPanel::draw();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLPanelPathfindingRebakeNavmesh::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
|
||||
{
|
||||
gViewerWindow->unblockToolTips();
|
||||
|
||||
if (mNavMeshRebakeButton->getVisible())
|
||||
{
|
||||
msg=mNavMeshRebakeButton->getToolTip();
|
||||
//LLToolTipMgr::instance().show(mNavMeshRebakeButton->getToolTip());
|
||||
}
|
||||
else if (mNavMeshSendingButton->getVisible())
|
||||
{
|
||||
msg=mNavMeshSendingButton->getToolTip();
|
||||
//LLToolTipMgr::instance().show(mNavMeshSendingButton->getToolTip());
|
||||
}
|
||||
else if (mNavMeshBakingButton->getVisible())
|
||||
{
|
||||
msg=mNavMeshBakingButton->getToolTip();
|
||||
//LLToolTipMgr::instance().show(mNavMeshBakingButton->getToolTip());
|
||||
}
|
||||
|
||||
// Convert rect local to screen coordinates
|
||||
localPointToScreen(
|
||||
0, 0,
|
||||
&(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
|
||||
localPointToScreen(
|
||||
getRect().getWidth(), getRect().getHeight(),
|
||||
&(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
|
||||
return true;//LLPanel::handleToolTip(x, y, mask);
|
||||
}
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh::LLPanelPathfindingRebakeNavmesh()
|
||||
: LLPanel(),
|
||||
mCanRebakeRegion(FALSE),
|
||||
mRebakeNavMeshMode(kRebakeNavMesh_Default),
|
||||
mNavMeshRebakeButton(NULL),
|
||||
mNavMeshSendingButton(NULL),
|
||||
mNavMeshBakingButton(NULL),
|
||||
mNavMeshSlot(),
|
||||
mRegionCrossingSlot(),
|
||||
mAgentStateSlot()
|
||||
{
|
||||
// make sure we have the only instance of this class
|
||||
static bool b = true;
|
||||
llassert_always(b);
|
||||
b=false;
|
||||
}
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh::~LLPanelPathfindingRebakeNavmesh()
|
||||
{
|
||||
}
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh* LLPanelPathfindingRebakeNavmesh::getPanel()
|
||||
{
|
||||
LLPanelPathfindingRebakeNavmesh* panel = new LLPanelPathfindingRebakeNavmesh();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel,"panel_navmesh_rebake.xml");
|
||||
return panel;
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::setMode(ERebakeNavMeshMode pRebakeNavMeshMode)
|
||||
{
|
||||
if (pRebakeNavMeshMode == kRebakeNavMesh_Available)
|
||||
{
|
||||
LLNotificationsUtil::add("PathfindingRebakeNavmesh");
|
||||
}
|
||||
mNavMeshRebakeButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_Available);
|
||||
mNavMeshSendingButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_RequestSent);
|
||||
mNavMeshBakingButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_InProgress);
|
||||
mRebakeNavMeshMode = pRebakeNavMeshMode;
|
||||
}
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh::ERebakeNavMeshMode LLPanelPathfindingRebakeNavmesh::getMode() const
|
||||
{
|
||||
return mRebakeNavMeshMode;
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::onNavMeshRebakeClick()
|
||||
{
|
||||
setMode(kRebakeNavMesh_RequestSent);
|
||||
LLPathfindingManager::getInstance()->requestRebakeNavMesh(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleRebakeNavMeshResponse, this, _1));
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegion)
|
||||
{
|
||||
mCanRebakeRegion = pCanRebakeRegion;
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus)
|
||||
{
|
||||
if (getMode() == kRebakeNavMesh_RequestSent)
|
||||
{
|
||||
setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
|
||||
}
|
||||
|
||||
if (!pResponseStatus)
|
||||
{
|
||||
LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus)
|
||||
{
|
||||
ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
|
||||
if (pNavMeshStatus.isValid())
|
||||
{
|
||||
switch (pNavMeshStatus.getStatus())
|
||||
{
|
||||
case LLPathfindingNavMeshStatus::kPending :
|
||||
case LLPathfindingNavMeshStatus::kRepending :
|
||||
rebakeNavMeshMode = kRebakeNavMesh_Available;
|
||||
break;
|
||||
case LLPathfindingNavMeshStatus::kBuilding :
|
||||
rebakeNavMeshMode = kRebakeNavMesh_InProgress;
|
||||
break;
|
||||
case LLPathfindingNavMeshStatus::kComplete :
|
||||
rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
|
||||
break;
|
||||
default :
|
||||
rebakeNavMeshMode = kRebakeNavMesh_Default;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setMode(rebakeNavMeshMode);
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed()
|
||||
{
|
||||
createNavMeshStatusListenerForCurrentRegion();
|
||||
mCanRebakeRegion = FALSE;
|
||||
LLPathfindingManager::getInstance()->requestGetAgentState();
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion()
|
||||
{
|
||||
if (mNavMeshSlot.connected())
|
||||
{
|
||||
mNavMeshSlot.disconnect();
|
||||
}
|
||||
|
||||
LLViewerRegion *currentRegion = gAgent.getRegion();
|
||||
if (currentRegion != NULL)
|
||||
{
|
||||
mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus, this, _2));
|
||||
LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelPathfindingRebakeNavmesh::doDraw() const
|
||||
{
|
||||
return (mCanRebakeRegion && (mRebakeNavMeshMode != kRebakeNavMesh_NotAvailable));
|
||||
}
|
||||
|
||||
void LLPanelPathfindingRebakeNavmesh::updatePosition()
|
||||
{
|
||||
#if 0
|
||||
S32 y_pos = 0;
|
||||
S32 bottom_tb_center = 0;
|
||||
|
||||
if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
|
||||
{
|
||||
y_pos = toolbar_bottom->getRect().getHeight();
|
||||
bottom_tb_center = toolbar_bottom->getRect().getCenterX();
|
||||
}
|
||||
|
||||
S32 left_tb_width = 0;
|
||||
if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
|
||||
{
|
||||
left_tb_width = toolbar_left->getRect().getWidth();
|
||||
}
|
||||
|
||||
if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
|
||||
{
|
||||
panel_ssf_container->setOrigin(0, y_pos);
|
||||
}
|
||||
|
||||
S32 x_pos = bottom_tb_center-getRect().getWidth()/2 - left_tb_width + 113 /* width of stand/fly button *//* + 10 *//* margin */;
|
||||
|
||||
/*setOrigin( x_pos, 0);*/
|
||||
#endif
|
||||
}
|
||||
96
indra/newview/llpanelpathfindingrebakenavmesh.h
Normal file
96
indra/newview/llpanelpathfindingrebakenavmesh.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* @file llpanelpathfindingrebakenavmesh.h
|
||||
* @brief Header file for llpanelpathfindingrebakenavmesh
|
||||
* @author Prep@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPANELPATHFINDINGREBAKENAVMESH_H
|
||||
#define LL_LLPANELPATHFINDINGREBAKENAVMESH_H
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "llpathfindingmanager.h"
|
||||
#include "llpathfindingnavmesh.h"
|
||||
|
||||
class LLButton;
|
||||
class LLPathfindingNavMeshStatus;
|
||||
|
||||
class LLPanelPathfindingRebakeNavmesh : public LLPanel
|
||||
{
|
||||
|
||||
LOG_CLASS(LLPanelPathfindingRebakeNavmesh);
|
||||
|
||||
public:
|
||||
static LLPanelPathfindingRebakeNavmesh* getInstance();
|
||||
|
||||
virtual BOOL postBuild();
|
||||
|
||||
virtual void draw();
|
||||
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
typedef enum
|
||||
{
|
||||
kRebakeNavMesh_Available,
|
||||
kRebakeNavMesh_RequestSent,
|
||||
kRebakeNavMesh_InProgress,
|
||||
kRebakeNavMesh_NotAvailable,
|
||||
kRebakeNavMesh_Default = kRebakeNavMesh_NotAvailable
|
||||
} ERebakeNavMeshMode;
|
||||
|
||||
LLPanelPathfindingRebakeNavmesh();
|
||||
virtual ~LLPanelPathfindingRebakeNavmesh();
|
||||
|
||||
static LLPanelPathfindingRebakeNavmesh* getPanel();
|
||||
|
||||
void setMode(ERebakeNavMeshMode pRebakeNavMeshMode);
|
||||
ERebakeNavMeshMode getMode() const;
|
||||
|
||||
void onNavMeshRebakeClick();
|
||||
|
||||
void handleAgentState(BOOL pCanRebakeRegion);
|
||||
void handleRebakeNavMeshResponse(bool pResponseStatus);
|
||||
void handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
void handleRegionBoundaryCrossed();
|
||||
|
||||
void createNavMeshStatusListenerForCurrentRegion();
|
||||
|
||||
bool doDraw() const;
|
||||
void updatePosition();
|
||||
|
||||
BOOL mCanRebakeRegion;
|
||||
ERebakeNavMeshMode mRebakeNavMeshMode;
|
||||
|
||||
LLButton* mNavMeshRebakeButton;
|
||||
LLButton* mNavMeshSendingButton;
|
||||
LLButton* mNavMeshBakingButton;
|
||||
|
||||
LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot;
|
||||
boost::signals2::connection mRegionCrossingSlot;
|
||||
LLPathfindingManager::agent_state_slot_t mAgentStateSlot;
|
||||
};
|
||||
|
||||
#endif // LL_LLPANELPATHFINDINGREBAKENAVMESH_H
|
||||
@@ -66,6 +66,7 @@
|
||||
#include "llviewercontrol.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "roles_constants.h"
|
||||
#include "lltrans.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
@@ -280,6 +281,10 @@ void LLPanelPermissions::refresh()
|
||||
BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
|
||||
&& LLSelectMgr::getInstance()->selectGetRootsModify())
|
||||
|| LLSelectMgr::getInstance()->selectGetModify();
|
||||
BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
|
||||
&& LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
|
||||
|| LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
|
||||
|
||||
const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
|
||||
S32 string_index = 0;
|
||||
std::string MODIFY_INFO_STRINGS[] =
|
||||
@@ -287,12 +292,18 @@ void LLPanelPermissions::refresh()
|
||||
getString("text modify info 1"),
|
||||
getString("text modify info 2"),
|
||||
getString("text modify info 3"),
|
||||
getString("text modify info 4")
|
||||
getString("text modify info 4"),
|
||||
getString("text modify info 5"),
|
||||
getString("text modify info 6")
|
||||
};
|
||||
if(!is_perm_modify)
|
||||
{
|
||||
string_index += 2;
|
||||
}
|
||||
else if (!is_nonpermanent_enforced)
|
||||
{
|
||||
string_index += 4;
|
||||
}
|
||||
if(!is_one_object)
|
||||
{
|
||||
++string_index;
|
||||
@@ -300,6 +311,34 @@ void LLPanelPermissions::refresh()
|
||||
childSetEnabled("perm_modify",true);
|
||||
childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]);
|
||||
|
||||
std::string pfAttrName;
|
||||
|
||||
if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
|
||||
&& LLSelectMgr::getInstance()->selectGetRootsNonPathfinding())
|
||||
|| LLSelectMgr::getInstance()->selectGetNonPathfinding())
|
||||
{
|
||||
pfAttrName = "Pathfinding_Object_Attr_None";
|
||||
}
|
||||
else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
|
||||
&& LLSelectMgr::getInstance()->selectGetRootsPermanent())
|
||||
|| LLSelectMgr::getInstance()->selectGetPermanent())
|
||||
{
|
||||
pfAttrName = "Pathfinding_Object_Attr_Permanent";
|
||||
}
|
||||
else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
|
||||
&& LLSelectMgr::getInstance()->selectGetRootsCharacter())
|
||||
|| LLSelectMgr::getInstance()->selectGetCharacter())
|
||||
{
|
||||
pfAttrName = "Pathfinding_Object_Attr_Character";
|
||||
}
|
||||
else
|
||||
{
|
||||
pfAttrName = "Pathfinding_Object_Attr_MultiSelect";
|
||||
}
|
||||
|
||||
getChildView("pathfinding_attributes_value")->setEnabled(TRUE);
|
||||
getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLTrans::getString(pfAttrName));
|
||||
|
||||
childSetEnabled("Permissions:",true);
|
||||
|
||||
// Update creator text field
|
||||
@@ -394,12 +433,12 @@ void LLPanelPermissions::refresh()
|
||||
}
|
||||
}
|
||||
|
||||
childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID()));
|
||||
childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
|
||||
childSetEnabled("button open group", group_id.notNull());
|
||||
|
||||
// figure out the contents of the name, description, & category
|
||||
BOOL edit_name_desc = FALSE;
|
||||
if(is_one_object && objectp->permModify())
|
||||
if(is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
|
||||
{
|
||||
edit_name_desc = TRUE;
|
||||
}
|
||||
@@ -628,15 +667,13 @@ void LLPanelPermissions::refresh()
|
||||
bool has_change_perm_ability = false;
|
||||
bool has_change_sale_ability = false;
|
||||
|
||||
if(valid_base_perms
|
||||
&& (self_owned
|
||||
|| (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
|
||||
if(valid_base_perms && is_nonpermanent_enforced &&
|
||||
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
|
||||
{
|
||||
has_change_perm_ability = true;
|
||||
}
|
||||
if(valid_base_perms
|
||||
&& (self_owned
|
||||
|| (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
|
||||
if(valid_base_perms && is_nonpermanent_enforced &&
|
||||
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
|
||||
{
|
||||
has_change_sale_ability = true;
|
||||
}
|
||||
@@ -847,8 +884,8 @@ void LLPanelPermissions::refresh()
|
||||
ComboClickAction->setCurrentByIndex((S32)click_action);
|
||||
}
|
||||
}
|
||||
childSetEnabled("label click action",is_perm_modify && all_volume);
|
||||
childSetEnabled("clickaction",is_perm_modify && all_volume);
|
||||
childSetEnabled("label click action",is_perm_modify && is_nonpermanent_enforced && all_volume);
|
||||
childSetEnabled("clickaction",is_perm_modify && is_nonpermanent_enforced && all_volume);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,13 +83,17 @@
|
||||
#include "llviewercontrol.h"
|
||||
#include "llmeshrepository.h"
|
||||
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
// "Features" Tab
|
||||
|
||||
BOOL LLPanelVolume::postBuild()
|
||||
{
|
||||
// Flexible Objects Parameters
|
||||
{
|
||||
childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this);
|
||||
getChild<LLCheckboxCtrl>("Flexible1D Checkbox Ctrl")->setCommitCallback(boost::bind(&LLPanelVolume::onCommitIsFlexible, this, _1, _2), NULL);
|
||||
childSetCommitCallback("FlexNumSections",onCommitFlexible,this);
|
||||
getChild<LLUICtrl>("FlexNumSections")->setValidateBeforeCommit(precommitValidate);
|
||||
childSetCommitCallback("FlexGravity",onCommitFlexible,this);
|
||||
@@ -246,7 +250,7 @@ void LLPanelVolume::getState( )
|
||||
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
|
||||
|
||||
// BUG? Check for all objects being editable?
|
||||
BOOL editable = root_objectp->permModify();
|
||||
BOOL editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
|
||||
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
|
||||
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
|
||||
|
||||
@@ -344,7 +348,7 @@ void LLPanelVolume::getState( )
|
||||
getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible);
|
||||
if (is_flexible || (volobjp && volobjp->canBeFlexible()))
|
||||
{
|
||||
getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh());
|
||||
getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh() && !objectp->isPermanentEnforced());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -449,7 +453,7 @@ void LLPanelVolume::getState( )
|
||||
|
||||
mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));
|
||||
mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType()));
|
||||
mComboPhysicsShapeType->setEnabled(editable);
|
||||
mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()));
|
||||
|
||||
mObject = objectp;
|
||||
mRootObject = root_objectp;
|
||||
@@ -810,10 +814,26 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata )
|
||||
self->refresh();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelVolume::onCommitIsFlexible( LLUICtrl* ctrl, void* userdata )
|
||||
void LLPanelVolume::onCommitIsFlexible(LLUICtrl *, void*)
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
self->sendIsFlexible();
|
||||
if (mObject->flagObjectPermanent())
|
||||
{
|
||||
LLNotificationsUtil::add("PathfindingLinksets_ChangeToFlexiblePath", LLSD(), LLSD(), boost::bind(&LLPanelVolume::handleResponseChangeToFlexible, this, _1, _2));
|
||||
}
|
||||
else
|
||||
{
|
||||
sendIsFlexible();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVolume::handleResponseChangeToFlexible(const LLSD &pNotification, const LLSD &pResponse)
|
||||
{
|
||||
if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0)
|
||||
{
|
||||
sendIsFlexible();
|
||||
}
|
||||
else
|
||||
{
|
||||
getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
static void onCommitIsLight( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitLight( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata);
|
||||
void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitFlexible( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
@@ -89,6 +89,8 @@ protected:
|
||||
void sendPhysicsFriction(LLUICtrl* ctrl, void* userdata);
|
||||
void sendPhysicsRestitution(LLUICtrl* ctrl, void* userdata);
|
||||
void sendPhysicsDensity(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
void handleResponseChangeToFlexible(const LLSD &pNotification, const LLSD &pResponse);
|
||||
/*
|
||||
LLTextBox* mLabelSelectSingleMessage;
|
||||
// Light
|
||||
|
||||
99
indra/newview/llpathfindingcharacter.cpp
Normal file
99
indra/newview/llpathfindingcharacter.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* @file llpathfindingcharacter.cpp
|
||||
* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding.
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingcharacter.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#define CHARACTER_CPU_TIME_FIELD "cpu_time"
|
||||
#define CHARACTER_HORIZONTAL_FIELD "horizontal"
|
||||
#define CHARACTER_LENGTH_FIELD "length"
|
||||
#define CHARACTER_RADIUS_FIELD "radius"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingCharacter
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData)
|
||||
: LLPathfindingObject(pUUID, pCharacterData),
|
||||
mCPUTime(0U),
|
||||
mIsHorizontal(FALSE),
|
||||
mLength(0.0f),
|
||||
mRadius(0.0f)
|
||||
{
|
||||
parseCharacterData(pCharacterData);
|
||||
}
|
||||
|
||||
LLPathfindingCharacter::LLPathfindingCharacter(const LLPathfindingCharacter& pOther)
|
||||
: LLPathfindingObject(pOther),
|
||||
mCPUTime(pOther.mCPUTime),
|
||||
mIsHorizontal(pOther.mIsHorizontal),
|
||||
mLength(pOther.mLength),
|
||||
mRadius(pOther.mRadius)
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingCharacter::~LLPathfindingCharacter()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingCharacter& LLPathfindingCharacter::operator =(const LLPathfindingCharacter& pOther)
|
||||
{
|
||||
dynamic_cast<LLPathfindingObject &>(*this) = pOther;
|
||||
|
||||
mCPUTime = pOther.mCPUTime;
|
||||
mIsHorizontal = pOther.mIsHorizontal;
|
||||
mLength = pOther.mLength;
|
||||
mRadius = pOther.mRadius;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData)
|
||||
{
|
||||
llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD));
|
||||
llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal());
|
||||
mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal();
|
||||
|
||||
llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD));
|
||||
llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean());
|
||||
mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean();
|
||||
|
||||
llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD));
|
||||
llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal());
|
||||
mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal();
|
||||
|
||||
llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD));
|
||||
llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal());
|
||||
mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal();
|
||||
}
|
||||
63
indra/newview/llpathfindingcharacter.h
Normal file
63
indra/newview/llpathfindingcharacter.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @file llpathfindingcharacter.h
|
||||
* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding.
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGCHARACTER_H
|
||||
#define LL_LLPATHFINDINGCHARACTER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LLPathfindingCharacter : public LLPathfindingObject
|
||||
{
|
||||
public:
|
||||
LLPathfindingCharacter(const std::string &pUUID, const LLSD &pCharacterData);
|
||||
LLPathfindingCharacter(const LLPathfindingCharacter& pOther);
|
||||
virtual ~LLPathfindingCharacter();
|
||||
|
||||
LLPathfindingCharacter& operator =(const LLPathfindingCharacter& pOther);
|
||||
|
||||
inline F32 getCPUTime() const {return mCPUTime;};
|
||||
|
||||
inline BOOL isHorizontal() const {return mIsHorizontal;};
|
||||
inline F32 getLength() const {return mLength;};
|
||||
inline F32 getRadius() const {return mRadius;};
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void parseCharacterData(const LLSD &pCharacterData);
|
||||
|
||||
F32 mCPUTime;
|
||||
|
||||
BOOL mIsHorizontal;
|
||||
F32 mLength;
|
||||
F32 mRadius;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGCHARACTER_H
|
||||
69
indra/newview/llpathfindingcharacterlist.cpp
Normal file
69
indra/newview/llpathfindingcharacterlist.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @file llpathfindingcharacterlist.cpp
|
||||
* @brief Implementation of llpathfindingcharacterlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingcharacterlist.h"
|
||||
|
||||
#include "llpathfindingcharacter.h"
|
||||
#include "llpathfindingobject.h"
|
||||
#include "llpathfindingobjectlist.h"
|
||||
#include "llsd.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingCharacterList
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingCharacterList::LLPathfindingCharacterList()
|
||||
: LLPathfindingObjectList()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingCharacterList::LLPathfindingCharacterList(const LLSD& pCharacterListData)
|
||||
: LLPathfindingObjectList()
|
||||
{
|
||||
parseCharacterListData(pCharacterListData);
|
||||
}
|
||||
|
||||
LLPathfindingCharacterList::~LLPathfindingCharacterList()
|
||||
{
|
||||
}
|
||||
|
||||
void LLPathfindingCharacterList::parseCharacterListData(const LLSD& pCharacterListData)
|
||||
{
|
||||
LLPathfindingObjectMap &objectMap = getObjectMap();
|
||||
|
||||
for (LLSD::map_const_iterator characterDataIter = pCharacterListData.beginMap();
|
||||
characterDataIter != pCharacterListData.endMap(); ++characterDataIter)
|
||||
{
|
||||
const std::string& uuid(characterDataIter->first);
|
||||
const LLSD& characterData = characterDataIter->second;
|
||||
LLPathfindingObjectPtr character(new LLPathfindingCharacter(uuid, characterData));
|
||||
objectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(uuid, character));
|
||||
}
|
||||
}
|
||||
47
indra/newview/llpathfindingcharacterlist.h
Normal file
47
indra/newview/llpathfindingcharacterlist.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @file llpathfindingcharacterlist.h
|
||||
* @brief Header file for llpathfindingcharacterlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGCHARACTERLIST_H
|
||||
#define LL_LLPATHFINDINGCHARACTERLIST_H
|
||||
|
||||
#include "llpathfindingobjectlist.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LLPathfindingCharacterList : public LLPathfindingObjectList
|
||||
{
|
||||
public:
|
||||
LLPathfindingCharacterList();
|
||||
LLPathfindingCharacterList(const LLSD& pCharacterListData);
|
||||
virtual ~LLPathfindingCharacterList();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void parseCharacterListData(const LLSD& pCharacterListData);
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGCHARACTERLIST_H
|
||||
387
indra/newview/llpathfindinglinkset.cpp
Normal file
387
indra/newview/llpathfindinglinkset.cpp
Normal file
@@ -0,0 +1,387 @@
|
||||
/**
|
||||
* @file llpathfindinglinkset.cpp
|
||||
* @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding.
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindinglinkset.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#define LINKSET_LAND_IMPACT_FIELD "landimpact"
|
||||
#define LINKSET_MODIFIABLE_FIELD "modifiable"
|
||||
#define LINKSET_CATEGORY_FIELD "navmesh_category"
|
||||
#define LINKSET_CAN_BE_VOLUME "can_be_volume"
|
||||
#define LINKSET_PHANTOM_FIELD "phantom"
|
||||
#define LINKSET_WALKABILITY_A_FIELD "A"
|
||||
#define LINKSET_WALKABILITY_B_FIELD "B"
|
||||
#define LINKSET_WALKABILITY_C_FIELD "C"
|
||||
#define LINKSET_WALKABILITY_D_FIELD "D"
|
||||
|
||||
#define LINKSET_CATEGORY_VALUE_INCLUDE 0
|
||||
#define LINKSET_CATEGORY_VALUE_EXCLUDE 1
|
||||
#define LINKSET_CATEGORY_VALUE_IGNORE 2
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingLinkset
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
const S32 LLPathfindingLinkset::MIN_WALKABILITY_VALUE(0);
|
||||
const S32 LLPathfindingLinkset::MAX_WALKABILITY_VALUE(100);
|
||||
|
||||
LLPathfindingLinkset::LLPathfindingLinkset(const LLSD& pTerrainData)
|
||||
: LLPathfindingObject(),
|
||||
mIsTerrain(true),
|
||||
mLandImpact(0U),
|
||||
mIsModifiable(FALSE),
|
||||
mCanBeVolume(FALSE),
|
||||
mLinksetUse(kUnknown),
|
||||
mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE)
|
||||
{
|
||||
parsePathfindingData(pTerrainData);
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& pLinksetData)
|
||||
: LLPathfindingObject(pUUID, pLinksetData),
|
||||
mIsTerrain(false),
|
||||
mLandImpact(0U),
|
||||
mIsModifiable(TRUE),
|
||||
mCanBeVolume(TRUE),
|
||||
mLinksetUse(kUnknown),
|
||||
mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE),
|
||||
mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE)
|
||||
{
|
||||
parseLinksetData(pLinksetData);
|
||||
parsePathfindingData(pLinksetData);
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther)
|
||||
: LLPathfindingObject(pOther),
|
||||
mIsTerrain(pOther.mIsTerrain),
|
||||
mLandImpact(pOther.mLandImpact),
|
||||
mIsModifiable(pOther.mIsModifiable),
|
||||
mCanBeVolume(pOther.mCanBeVolume),
|
||||
mLinksetUse(pOther.mLinksetUse),
|
||||
mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA),
|
||||
mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB),
|
||||
mWalkabilityCoefficientC(pOther.mWalkabilityCoefficientC),
|
||||
mWalkabilityCoefficientD(pOther.mWalkabilityCoefficientD)
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::~LLPathfindingLinkset()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkset& pOther)
|
||||
{
|
||||
dynamic_cast<LLPathfindingObject &>(*this) = pOther;
|
||||
|
||||
mIsTerrain = pOther.mIsTerrain;
|
||||
mLandImpact = pOther.mLandImpact;
|
||||
mIsModifiable = pOther.mIsModifiable;
|
||||
mCanBeVolume = pOther.mCanBeVolume;
|
||||
mLinksetUse = pOther.mLinksetUse;
|
||||
mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA;
|
||||
mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB;
|
||||
mWalkabilityCoefficientC = pOther.mWalkabilityCoefficientC;
|
||||
mWalkabilityCoefficientD = pOther.mWalkabilityCoefficientD;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL LLPathfindingLinkset::isPhantom() const
|
||||
{
|
||||
return isPhantom(getLinksetUse());
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::ELinksetUse LLPathfindingLinkset::getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse)
|
||||
{
|
||||
BOOL isPhantom = LLPathfindingLinkset::isPhantom(pLinksetUse);
|
||||
ENavMeshGenerationCategory navMeshGenerationCategory = getNavMeshGenerationCategory(pLinksetUse);
|
||||
|
||||
return getLinksetUse(!isPhantom, navMeshGenerationCategory);
|
||||
}
|
||||
|
||||
bool LLPathfindingLinkset::isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const
|
||||
{
|
||||
return (!isModifiable() && (isPhantom() != isPhantom(pLinksetUse)));
|
||||
}
|
||||
|
||||
bool LLPathfindingLinkset::isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const
|
||||
{
|
||||
return (!canBeVolume() && ((pLinksetUse == kMaterialVolume) || (pLinksetUse == kExclusionVolume)));
|
||||
}
|
||||
|
||||
LLSD LLPathfindingLinkset::encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
|
||||
{
|
||||
LLSD itemData;
|
||||
|
||||
if (!isTerrain() && (pLinksetUse != kUnknown) && (getLinksetUse() != pLinksetUse) &&
|
||||
(canBeVolume() || ((pLinksetUse != kMaterialVolume) && (pLinksetUse != kExclusionVolume))))
|
||||
{
|
||||
if (isModifiable())
|
||||
{
|
||||
itemData[LINKSET_PHANTOM_FIELD] = static_cast<bool>(isPhantom(pLinksetUse));
|
||||
}
|
||||
|
||||
itemData[LINKSET_CATEGORY_FIELD] = convertCategoryToLLSD(getNavMeshGenerationCategory(pLinksetUse));
|
||||
}
|
||||
|
||||
if (mWalkabilityCoefficientA != pA)
|
||||
{
|
||||
itemData[LINKSET_WALKABILITY_A_FIELD] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
|
||||
}
|
||||
|
||||
if (mWalkabilityCoefficientB != pB)
|
||||
{
|
||||
itemData[LINKSET_WALKABILITY_B_FIELD] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
|
||||
}
|
||||
|
||||
if (mWalkabilityCoefficientC != pC)
|
||||
{
|
||||
itemData[LINKSET_WALKABILITY_C_FIELD] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
|
||||
}
|
||||
|
||||
if (mWalkabilityCoefficientD != pD)
|
||||
{
|
||||
itemData[LINKSET_WALKABILITY_D_FIELD] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
|
||||
}
|
||||
|
||||
return itemData;
|
||||
}
|
||||
|
||||
void LLPathfindingLinkset::parseLinksetData(const LLSD &pLinksetData)
|
||||
{
|
||||
llassert(pLinksetData.has(LINKSET_LAND_IMPACT_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).isInteger());
|
||||
llassert(pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).asInteger() >= 0);
|
||||
mLandImpact = pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).asInteger();
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_MODIFIABLE_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_MODIFIABLE_FIELD).isBoolean());
|
||||
mIsModifiable = pLinksetData.get(LINKSET_MODIFIABLE_FIELD).asBoolean();
|
||||
}
|
||||
|
||||
void LLPathfindingLinkset::parsePathfindingData(const LLSD &pLinksetData)
|
||||
{
|
||||
bool isPhantom = false;
|
||||
if (pLinksetData.has(LINKSET_PHANTOM_FIELD))
|
||||
{
|
||||
llassert(pLinksetData.get(LINKSET_PHANTOM_FIELD).isBoolean());
|
||||
isPhantom = pLinksetData.get(LINKSET_PHANTOM_FIELD).asBoolean();
|
||||
}
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_CATEGORY_FIELD));
|
||||
mLinksetUse = getLinksetUse(isPhantom, convertCategoryFromLLSD(pLinksetData.get(LINKSET_CATEGORY_FIELD)));
|
||||
|
||||
if (pLinksetData.has(LINKSET_CAN_BE_VOLUME))
|
||||
{
|
||||
llassert(pLinksetData.get(LINKSET_CAN_BE_VOLUME).isBoolean());
|
||||
mCanBeVolume = pLinksetData.get(LINKSET_CAN_BE_VOLUME).asBoolean();
|
||||
}
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_WALKABILITY_A_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_WALKABILITY_A_FIELD).isInteger());
|
||||
mWalkabilityCoefficientA = pLinksetData.get(LINKSET_WALKABILITY_A_FIELD).asInteger();
|
||||
llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE);
|
||||
llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE);
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_WALKABILITY_B_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_WALKABILITY_B_FIELD).isInteger());
|
||||
mWalkabilityCoefficientB = pLinksetData.get(LINKSET_WALKABILITY_B_FIELD).asInteger();
|
||||
llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE);
|
||||
llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE);
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_WALKABILITY_C_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_WALKABILITY_C_FIELD).isInteger());
|
||||
mWalkabilityCoefficientC = pLinksetData.get(LINKSET_WALKABILITY_C_FIELD).asInteger();
|
||||
llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE);
|
||||
llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE);
|
||||
|
||||
llassert(pLinksetData.has(LINKSET_WALKABILITY_D_FIELD));
|
||||
llassert(pLinksetData.get(LINKSET_WALKABILITY_D_FIELD).isInteger());
|
||||
mWalkabilityCoefficientD = pLinksetData.get(LINKSET_WALKABILITY_D_FIELD).asInteger();
|
||||
llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE);
|
||||
llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE);
|
||||
}
|
||||
|
||||
BOOL LLPathfindingLinkset::isPhantom(ELinksetUse pLinksetUse)
|
||||
{
|
||||
BOOL retVal;
|
||||
|
||||
switch (pLinksetUse)
|
||||
{
|
||||
case kWalkable :
|
||||
case kStaticObstacle :
|
||||
case kDynamicObstacle :
|
||||
retVal = false;
|
||||
break;
|
||||
case kMaterialVolume :
|
||||
case kExclusionVolume :
|
||||
case kDynamicPhantom :
|
||||
retVal = true;
|
||||
break;
|
||||
case kUnknown :
|
||||
default :
|
||||
retVal = false;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::ELinksetUse LLPathfindingLinkset::getLinksetUse(bool pIsPhantom, ENavMeshGenerationCategory pNavMeshGenerationCategory)
|
||||
{
|
||||
ELinksetUse linksetUse = kUnknown;
|
||||
|
||||
if (pIsPhantom)
|
||||
{
|
||||
switch (pNavMeshGenerationCategory)
|
||||
{
|
||||
case kNavMeshGenerationIgnore :
|
||||
linksetUse = kDynamicPhantom;
|
||||
break;
|
||||
case kNavMeshGenerationInclude :
|
||||
linksetUse = kMaterialVolume;
|
||||
break;
|
||||
case kNavMeshGenerationExclude :
|
||||
linksetUse = kExclusionVolume;
|
||||
break;
|
||||
default :
|
||||
linksetUse = kUnknown;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (pNavMeshGenerationCategory)
|
||||
{
|
||||
case kNavMeshGenerationIgnore :
|
||||
linksetUse = kDynamicObstacle;
|
||||
break;
|
||||
case kNavMeshGenerationInclude :
|
||||
linksetUse = kWalkable;
|
||||
break;
|
||||
case kNavMeshGenerationExclude :
|
||||
linksetUse = kStaticObstacle;
|
||||
break;
|
||||
default :
|
||||
linksetUse = kUnknown;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return linksetUse;
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::ENavMeshGenerationCategory LLPathfindingLinkset::getNavMeshGenerationCategory(ELinksetUse pLinksetUse)
|
||||
{
|
||||
ENavMeshGenerationCategory navMeshGenerationCategory;
|
||||
switch (pLinksetUse)
|
||||
{
|
||||
case kWalkable :
|
||||
case kMaterialVolume :
|
||||
navMeshGenerationCategory = kNavMeshGenerationInclude;
|
||||
break;
|
||||
case kStaticObstacle :
|
||||
case kExclusionVolume :
|
||||
navMeshGenerationCategory = kNavMeshGenerationExclude;
|
||||
break;
|
||||
case kDynamicObstacle :
|
||||
case kDynamicPhantom :
|
||||
navMeshGenerationCategory = kNavMeshGenerationIgnore;
|
||||
break;
|
||||
case kUnknown :
|
||||
default :
|
||||
navMeshGenerationCategory = kNavMeshGenerationIgnore;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return navMeshGenerationCategory;
|
||||
}
|
||||
|
||||
LLSD LLPathfindingLinkset::convertCategoryToLLSD(ENavMeshGenerationCategory pNavMeshGenerationCategory)
|
||||
{
|
||||
LLSD llsd;
|
||||
|
||||
switch (pNavMeshGenerationCategory)
|
||||
{
|
||||
case kNavMeshGenerationIgnore :
|
||||
llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_IGNORE);
|
||||
break;
|
||||
case kNavMeshGenerationInclude :
|
||||
llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_INCLUDE);
|
||||
break;
|
||||
case kNavMeshGenerationExclude :
|
||||
llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_EXCLUDE);
|
||||
break;
|
||||
default :
|
||||
llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_IGNORE);
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return llsd;
|
||||
}
|
||||
|
||||
LLPathfindingLinkset::ENavMeshGenerationCategory LLPathfindingLinkset::convertCategoryFromLLSD(const LLSD &llsd)
|
||||
{
|
||||
ENavMeshGenerationCategory navMeshGenerationCategory;
|
||||
|
||||
llassert(llsd.isInteger());
|
||||
switch (llsd.asInteger())
|
||||
{
|
||||
case LINKSET_CATEGORY_VALUE_IGNORE :
|
||||
navMeshGenerationCategory = kNavMeshGenerationIgnore;
|
||||
break;
|
||||
case LINKSET_CATEGORY_VALUE_INCLUDE :
|
||||
navMeshGenerationCategory = kNavMeshGenerationInclude;
|
||||
break;
|
||||
case LINKSET_CATEGORY_VALUE_EXCLUDE :
|
||||
navMeshGenerationCategory = kNavMeshGenerationExclude;
|
||||
break;
|
||||
default :
|
||||
navMeshGenerationCategory = kNavMeshGenerationIgnore;
|
||||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return navMeshGenerationCategory;
|
||||
}
|
||||
108
indra/newview/llpathfindinglinkset.h
Normal file
108
indra/newview/llpathfindinglinkset.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* @file llpathfindinglinkset.h
|
||||
* @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding.
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGLINKSET_H
|
||||
#define LL_LLPATHFINDINGLINKSET_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LLPathfindingLinkset : public LLPathfindingObject
|
||||
{
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
kUnknown,
|
||||
kWalkable,
|
||||
kStaticObstacle,
|
||||
kDynamicObstacle,
|
||||
kMaterialVolume,
|
||||
kExclusionVolume,
|
||||
kDynamicPhantom
|
||||
} ELinksetUse;
|
||||
|
||||
LLPathfindingLinkset(const LLSD &pTerrainData);
|
||||
LLPathfindingLinkset(const std::string &pUUID, const LLSD &pLinksetData);
|
||||
LLPathfindingLinkset(const LLPathfindingLinkset& pOther);
|
||||
virtual ~LLPathfindingLinkset();
|
||||
|
||||
LLPathfindingLinkset& operator = (const LLPathfindingLinkset& pOther);
|
||||
|
||||
inline bool isTerrain() const {return mIsTerrain;};
|
||||
inline U32 getLandImpact() const {return mLandImpact;};
|
||||
BOOL isModifiable() const {return mIsModifiable;};
|
||||
BOOL isPhantom() const;
|
||||
BOOL canBeVolume() const {return mCanBeVolume;};
|
||||
static ELinksetUse getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse);
|
||||
|
||||
inline ELinksetUse getLinksetUse() const {return mLinksetUse;};
|
||||
|
||||
inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;};
|
||||
inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;};
|
||||
inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;};
|
||||
inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;};
|
||||
|
||||
bool isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const;
|
||||
bool isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const;
|
||||
LLSD encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
|
||||
|
||||
static const S32 MIN_WALKABILITY_VALUE;
|
||||
static const S32 MAX_WALKABILITY_VALUE;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
typedef enum
|
||||
{
|
||||
kNavMeshGenerationIgnore,
|
||||
kNavMeshGenerationInclude,
|
||||
kNavMeshGenerationExclude
|
||||
} ENavMeshGenerationCategory;
|
||||
|
||||
void parseLinksetData(const LLSD &pLinksetData);
|
||||
void parsePathfindingData(const LLSD &pLinksetData);
|
||||
|
||||
static BOOL isPhantom(ELinksetUse pLinksetUse);
|
||||
static ELinksetUse getLinksetUse(bool pIsPhantom, ENavMeshGenerationCategory pNavMeshGenerationCategory);
|
||||
static ENavMeshGenerationCategory getNavMeshGenerationCategory(ELinksetUse pLinksetUse);
|
||||
static LLSD convertCategoryToLLSD(ENavMeshGenerationCategory pNavMeshGenerationCategory);
|
||||
static ENavMeshGenerationCategory convertCategoryFromLLSD(const LLSD &llsd);
|
||||
|
||||
bool mIsTerrain;
|
||||
U32 mLandImpact;
|
||||
BOOL mIsModifiable;
|
||||
BOOL mCanBeVolume;
|
||||
ELinksetUse mLinksetUse;
|
||||
S32 mWalkabilityCoefficientA;
|
||||
S32 mWalkabilityCoefficientB;
|
||||
S32 mWalkabilityCoefficientC;
|
||||
S32 mWalkabilityCoefficientD;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGLINKSET_H
|
||||
196
indra/newview/llpathfindinglinksetlist.cpp
Normal file
196
indra/newview/llpathfindinglinksetlist.cpp
Normal file
@@ -0,0 +1,196 @@
|
||||
/**
|
||||
* @file llpathfindinglinksetlist.cpp
|
||||
* @brief Implementation of llpathfindinglinksetlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindinglinksetlist.h"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include "llpathfindinglinkset.h"
|
||||
#include "llpathfindingobject.h"
|
||||
#include "llpathfindingobjectlist.h"
|
||||
#include "llsd.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingLinksetList
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingLinksetList::LLPathfindingLinksetList()
|
||||
: LLPathfindingObjectList()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingLinksetList::LLPathfindingLinksetList(const LLSD& pLinksetListData)
|
||||
: LLPathfindingObjectList()
|
||||
{
|
||||
parseLinksetListData(pLinksetListData);
|
||||
}
|
||||
|
||||
LLPathfindingLinksetList::~LLPathfindingLinksetList()
|
||||
{
|
||||
}
|
||||
|
||||
LLSD LLPathfindingLinksetList::encodeObjectFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
|
||||
{
|
||||
LLSD listData;
|
||||
|
||||
for (const_iterator linksetIter = begin(); linksetIter != end(); ++linksetIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr objectPtr = linksetIter->second;
|
||||
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
|
||||
|
||||
if (!linkset->isTerrain())
|
||||
{
|
||||
LLSD linksetData = linkset->encodeAlteredFields(pLinksetUse, pA, pB, pC, pD);
|
||||
if (!linksetData.isUndefined())
|
||||
{
|
||||
const std::string& uuid(linksetIter->first);
|
||||
listData[uuid] = linksetData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return listData;
|
||||
}
|
||||
|
||||
LLSD LLPathfindingLinksetList::encodeTerrainFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
|
||||
{
|
||||
LLSD terrainData;
|
||||
|
||||
for (const_iterator linksetIter = begin(); linksetIter != end(); ++linksetIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr objectPtr = linksetIter->second;
|
||||
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
|
||||
|
||||
if (linkset->isTerrain())
|
||||
{
|
||||
terrainData = linkset->encodeAlteredFields(pLinksetUse, pA, pB, pC, pD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return terrainData;
|
||||
}
|
||||
|
||||
bool LLPathfindingLinksetList::isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
|
||||
{
|
||||
bool isShowWarning = false;
|
||||
|
||||
for (const_iterator objectIter = begin(); !isShowWarning && (objectIter != end()); ++objectIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr objectPtr = objectIter->second;
|
||||
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
|
||||
isShowWarning = linkset->isShowUnmodifiablePhantomWarning(pLinksetUse);
|
||||
}
|
||||
|
||||
return isShowWarning;
|
||||
}
|
||||
|
||||
bool LLPathfindingLinksetList::isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
|
||||
{
|
||||
bool isShowWarning = false;
|
||||
|
||||
for (const_iterator objectIter = begin(); !isShowWarning && (objectIter != end()); ++objectIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr objectPtr = objectIter->second;
|
||||
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
|
||||
isShowWarning = linkset->isShowCannotBeVolumeWarning(pLinksetUse);
|
||||
}
|
||||
|
||||
return isShowWarning;
|
||||
}
|
||||
|
||||
void LLPathfindingLinksetList::determinePossibleStates(BOOL &pCanBeWalkable, BOOL &pCanBeStaticObstacle, BOOL &pCanBeDynamicObstacle,
|
||||
BOOL &pCanBeMaterialVolume, BOOL &pCanBeExclusionVolume, BOOL &pCanBeDynamicPhantom) const
|
||||
{
|
||||
pCanBeWalkable = FALSE;
|
||||
pCanBeStaticObstacle = FALSE;
|
||||
pCanBeDynamicObstacle = FALSE;
|
||||
pCanBeMaterialVolume = FALSE;
|
||||
pCanBeExclusionVolume = FALSE;
|
||||
pCanBeDynamicPhantom = FALSE;
|
||||
|
||||
for (const_iterator objectIter = begin();
|
||||
!(pCanBeWalkable && pCanBeStaticObstacle && pCanBeDynamicObstacle && pCanBeMaterialVolume && pCanBeExclusionVolume && pCanBeDynamicPhantom) && (objectIter != end());
|
||||
++objectIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr objectPtr = objectIter->second;
|
||||
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
|
||||
|
||||
if (linkset->isTerrain())
|
||||
{
|
||||
pCanBeWalkable = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (linkset->isModifiable())
|
||||
{
|
||||
pCanBeWalkable = TRUE;
|
||||
pCanBeStaticObstacle = TRUE;
|
||||
pCanBeDynamicObstacle = TRUE;
|
||||
pCanBeDynamicPhantom = TRUE;
|
||||
if (linkset->canBeVolume())
|
||||
{
|
||||
pCanBeMaterialVolume = TRUE;
|
||||
pCanBeExclusionVolume = TRUE;
|
||||
}
|
||||
}
|
||||
else if (linkset->isPhantom())
|
||||
{
|
||||
pCanBeDynamicPhantom = TRUE;
|
||||
if (linkset->canBeVolume())
|
||||
{
|
||||
pCanBeMaterialVolume = TRUE;
|
||||
pCanBeExclusionVolume = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pCanBeWalkable = TRUE;
|
||||
pCanBeStaticObstacle = TRUE;
|
||||
pCanBeDynamicObstacle = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingLinksetList::parseLinksetListData(const LLSD& pLinksetListData)
|
||||
{
|
||||
LLPathfindingObjectMap &objectMap = getObjectMap();
|
||||
|
||||
for (LLSD::map_const_iterator linksetDataIter = pLinksetListData.beginMap();
|
||||
linksetDataIter != pLinksetListData.endMap(); ++linksetDataIter)
|
||||
{
|
||||
const std::string& uuid(linksetDataIter->first);
|
||||
const LLSD& linksetData = linksetDataIter->second;
|
||||
LLPathfindingObjectPtr linksetPtr(new LLPathfindingLinkset(uuid, linksetData));
|
||||
objectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(uuid, linksetPtr));
|
||||
}
|
||||
}
|
||||
57
indra/newview/llpathfindinglinksetlist.h
Normal file
57
indra/newview/llpathfindinglinksetlist.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @file llpathfindinglinksetlist.h
|
||||
* @brief Header file for llpathfindinglinksetlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGLINKSETLIST_H
|
||||
#define LL_LLPATHFINDINGLINKSETLIST_H
|
||||
|
||||
#include "llpathfindinglinkset.h"
|
||||
#include "llpathfindingobjectlist.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LLPathfindingLinksetList : public LLPathfindingObjectList
|
||||
{
|
||||
public:
|
||||
LLPathfindingLinksetList();
|
||||
LLPathfindingLinksetList(const LLSD& pLinksetListData);
|
||||
virtual ~LLPathfindingLinksetList();
|
||||
|
||||
LLSD encodeObjectFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
|
||||
LLSD encodeTerrainFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
|
||||
|
||||
bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
|
||||
bool isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
|
||||
|
||||
void determinePossibleStates(BOOL &pCanBeWalkable, BOOL &pCanBeStaticObstacle, BOOL &pCanBeDynamicObstacle,
|
||||
BOOL &pCanBeMaterialVolume, BOOL &pCanBeExclusionVolume, BOOL &pCanBeDynamicPhantom) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void parseLinksetListData(const LLSD& pLinksetListData);
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGLINKSETLIST_H
|
||||
1050
indra/newview/llpathfindingmanager.cpp
Normal file
1050
indra/newview/llpathfindingmanager.cpp
Normal file
File diff suppressed because it is too large
Load Diff
127
indra/newview/llpathfindingmanager.h
Normal file
127
indra/newview/llpathfindingmanager.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* @file llpathfindingmanager.h
|
||||
* @brief Header file for llpathfindingmanager
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGMANAGER_H
|
||||
#define LL_LLPATHFINDINGMANAGER_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llpathfindinglinkset.h"
|
||||
#include "llpathfindingobjectlist.h"
|
||||
#include "llpathfindingnavmesh.h"
|
||||
#include "llsingleton.h"
|
||||
|
||||
class LLPathfindingNavMeshStatus;
|
||||
class LLUUID;
|
||||
class LLViewerRegion;
|
||||
|
||||
class LLPathfindingManager : public LLSingleton<LLPathfindingManager>
|
||||
{
|
||||
friend class LLNavMeshSimStateChangeNode;
|
||||
friend class NavMeshStatusResponder;
|
||||
friend class LLAgentStateChangeNode;
|
||||
friend class AgentStateResponder;
|
||||
public:
|
||||
typedef enum {
|
||||
kRequestStarted,
|
||||
kRequestCompleted,
|
||||
kRequestNotEnabled,
|
||||
kRequestError
|
||||
} ERequestStatus;
|
||||
|
||||
LLPathfindingManager();
|
||||
virtual ~LLPathfindingManager();
|
||||
|
||||
void initSystem();
|
||||
void quitSystem();
|
||||
|
||||
bool isPathfindingViewEnabled() const;
|
||||
bool isPathfindingEnabledForCurrentRegion() const;
|
||||
bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const;
|
||||
|
||||
bool isAllowViewTerrainProperties() const;
|
||||
|
||||
LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback);
|
||||
void requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly);
|
||||
|
||||
typedef U32 request_id_t;
|
||||
typedef boost::function<void (request_id_t, ERequestStatus, LLPathfindingObjectListPtr)> object_request_callback_t;
|
||||
|
||||
void requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const;
|
||||
void requestSetLinksets(request_id_t pRequestId, const LLPathfindingObjectListPtr &pLinksetListPtr, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, object_request_callback_t pLinksetsCallback) const;
|
||||
|
||||
void requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const;
|
||||
|
||||
typedef boost::function<void (BOOL)> agent_state_callback_t;
|
||||
typedef boost::signals2::signal<void (BOOL)> agent_state_signal_t;
|
||||
typedef boost::signals2::connection agent_state_slot_t;
|
||||
|
||||
agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback);
|
||||
void requestGetAgentState();
|
||||
|
||||
typedef boost::function<void (bool)> rebake_navmesh_callback_t;
|
||||
void requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
typedef std::map<LLUUID, LLPathfindingNavMeshPtr> NavMeshMap;
|
||||
|
||||
void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
|
||||
void handleDeferredGetAgentStateForRegion(const LLUUID &pRegionUUID);
|
||||
void handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID, bool pIsGetStatusOnly);
|
||||
void handleDeferredGetLinksetsForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const;
|
||||
void handleDeferredGetCharactersForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pCharactersCallback) const;
|
||||
|
||||
void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
|
||||
void handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
|
||||
void handleAgentState(BOOL pCanRebakeRegion);
|
||||
|
||||
LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID);
|
||||
LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion);
|
||||
|
||||
std::string getNavMeshStatusURLForCurrentRegion() const;
|
||||
std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const;
|
||||
std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const;
|
||||
std::string getObjectLinksetsURLForCurrentRegion() const;
|
||||
std::string getTerrainLinksetsURLForCurrentRegion() const;
|
||||
std::string getCharactersURLForCurrentRegion() const;
|
||||
std::string getAgentStateURLForRegion(LLViewerRegion *pRegion) const;
|
||||
std::string getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const;
|
||||
std::string getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const;
|
||||
LLViewerRegion *getCurrentRegion() const;
|
||||
|
||||
NavMeshMap mNavMeshMap;
|
||||
agent_state_signal_t mAgentStateSignal;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGMANAGER_H
|
||||
205
indra/newview/llpathfindingnavmesh.cpp
Normal file
205
indra/newview/llpathfindingnavmesh.cpp
Normal file
@@ -0,0 +1,205 @@
|
||||
/**
|
||||
* @file llpathfindingnavmesh.cpp
|
||||
* @brief Implementation of llpathfindingnavmesh
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingnavmesh.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llpathfindingnavmeshstatus.h"
|
||||
#include "llsd.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "lluuid.h"
|
||||
|
||||
#define NAVMESH_VERSION_FIELD "navmesh_version"
|
||||
#define NAVMESH_DATA_FIELD "navmesh_data"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingNavMesh
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID)
|
||||
: mNavMeshStatus(pRegionUUID),
|
||||
mNavMeshRequestStatus(kNavMeshRequestUnknown),
|
||||
mNavMeshSignal(),
|
||||
mNavMeshData()
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMesh::~LLPathfindingNavMesh()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListener(navmesh_callback_t pNavMeshCallback)
|
||||
{
|
||||
return mNavMeshSignal.connect(pNavMeshCallback);
|
||||
}
|
||||
|
||||
bool LLPathfindingNavMesh::hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const
|
||||
{
|
||||
return ((mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) &&
|
||||
((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) ||
|
||||
((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty())));
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshWaitForRegionLoad()
|
||||
{
|
||||
setRequestStatus(kNavMeshRequestWaiting);
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshCheckVersion()
|
||||
{
|
||||
setRequestStatus(kNavMeshRequestChecking);
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus)
|
||||
{
|
||||
llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
|
||||
llassert(mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion());
|
||||
mNavMeshStatus = pNavMeshStatus;
|
||||
if (mNavMeshRequestStatus == kNavMeshRequestChecking)
|
||||
{
|
||||
llassert(!mNavMeshData.empty());
|
||||
setRequestStatus(kNavMeshRequestCompleted);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendStatus();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus)
|
||||
{
|
||||
llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
|
||||
if (mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion())
|
||||
{
|
||||
mNavMeshStatus = pNavMeshStatus;
|
||||
sendStatus();
|
||||
}
|
||||
else
|
||||
{
|
||||
mNavMeshData.clear();
|
||||
mNavMeshStatus = pNavMeshStatus;
|
||||
setRequestStatus(kNavMeshRequestNeedsUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus)
|
||||
{
|
||||
llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
|
||||
mNavMeshStatus = pNavMeshStatus;
|
||||
setRequestStatus(kNavMeshRequestStarted);
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion)
|
||||
{
|
||||
llassert(pContent.has(NAVMESH_VERSION_FIELD));
|
||||
if (pContent.has(NAVMESH_VERSION_FIELD))
|
||||
{
|
||||
llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger());
|
||||
llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0);
|
||||
U32 embeddedNavMeshVersion = static_cast<U32>(pContent.get(NAVMESH_VERSION_FIELD).asInteger());
|
||||
llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur?
|
||||
if (embeddedNavMeshVersion != pNavMeshVersion)
|
||||
{
|
||||
llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl;
|
||||
pNavMeshVersion = embeddedNavMeshVersion;
|
||||
}
|
||||
}
|
||||
|
||||
if (mNavMeshStatus.getVersion() == pNavMeshVersion)
|
||||
{
|
||||
ENavMeshRequestStatus status;
|
||||
if ( pContent.has(NAVMESH_DATA_FIELD) )
|
||||
{
|
||||
const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary();
|
||||
unsigned int binSize = value.size();
|
||||
std::string newStr(reinterpret_cast<const char *>(&value[0]), binSize);
|
||||
std::istringstream streamdecomp( newStr );
|
||||
unsigned int decompBinSize = 0;
|
||||
bool valid = false;
|
||||
U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ;
|
||||
if ( !valid )
|
||||
{
|
||||
llwarns << "Unable to decompress the navmesh llsd." << llendl;
|
||||
status = kNavMeshRequestError;
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(pUncompressedNavMeshContainer);
|
||||
mNavMeshData.resize( decompBinSize );
|
||||
memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize );
|
||||
status = kNavMeshRequestCompleted;
|
||||
}
|
||||
if ( pUncompressedNavMeshContainer )
|
||||
{
|
||||
free( pUncompressedNavMeshContainer );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "No mesh data received" << llendl;
|
||||
status = kNavMeshRequestError;
|
||||
}
|
||||
setRequestStatus(status);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshNotEnabled()
|
||||
{
|
||||
mNavMeshData.clear();
|
||||
setRequestStatus(kNavMeshRequestNotEnabled);
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshError()
|
||||
{
|
||||
mNavMeshData.clear();
|
||||
setRequestStatus(kNavMeshRequestError);
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion)
|
||||
{
|
||||
llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
|
||||
if (mNavMeshStatus.getVersion() == pNavMeshVersion)
|
||||
{
|
||||
handleNavMeshError();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus)
|
||||
{
|
||||
mNavMeshRequestStatus = pNavMeshRequestStatus;
|
||||
sendStatus();
|
||||
}
|
||||
|
||||
void LLPathfindingNavMesh::sendStatus()
|
||||
{
|
||||
mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData);
|
||||
}
|
||||
91
indra/newview/llpathfindingnavmesh.h
Normal file
91
indra/newview/llpathfindingnavmesh.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* @file llpathfindingnavmesh.h
|
||||
* @brief Header file for llpathfindingnavmesh
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGNAVMESH_H
|
||||
#define LL_LLPATHFINDINGNAVMESH_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llpathfindingnavmeshstatus.h"
|
||||
#include "llsd.h"
|
||||
|
||||
class LLPathfindingNavMesh;
|
||||
class LLUUID;
|
||||
|
||||
typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr;
|
||||
|
||||
class LLPathfindingNavMesh
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
kNavMeshRequestUnknown,
|
||||
kNavMeshRequestWaiting,
|
||||
kNavMeshRequestChecking,
|
||||
kNavMeshRequestNeedsUpdate,
|
||||
kNavMeshRequestStarted,
|
||||
kNavMeshRequestCompleted,
|
||||
kNavMeshRequestNotEnabled,
|
||||
kNavMeshRequestError
|
||||
} ENavMeshRequestStatus;
|
||||
|
||||
typedef boost::function<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)> navmesh_callback_t;
|
||||
typedef boost::signals2::signal<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)> navmesh_signal_t;
|
||||
typedef boost::signals2::connection navmesh_slot_t;
|
||||
|
||||
LLPathfindingNavMesh(const LLUUID &pRegionUUID);
|
||||
virtual ~LLPathfindingNavMesh();
|
||||
|
||||
navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback);
|
||||
|
||||
bool hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const;
|
||||
|
||||
void handleNavMeshWaitForRegionLoad();
|
||||
void handleNavMeshCheckVersion();
|
||||
void handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
void handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
void handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus);
|
||||
void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion);
|
||||
void handleNavMeshNotEnabled();
|
||||
void handleNavMeshError();
|
||||
void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus);
|
||||
void sendStatus();
|
||||
|
||||
LLPathfindingNavMeshStatus mNavMeshStatus;
|
||||
ENavMeshRequestStatus mNavMeshRequestStatus;
|
||||
navmesh_signal_t mNavMeshSignal;
|
||||
LLSD::Binary mNavMeshData;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGNAVMESH_H
|
||||
145
indra/newview/llpathfindingnavmeshstatus.cpp
Normal file
145
indra/newview/llpathfindingnavmeshstatus.cpp
Normal file
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* @file llpathfindingnavmeshstatus.cpp
|
||||
* @brief Implementation of llpathfindingnavmeshstatus
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingnavmeshstatus.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llsd.h"
|
||||
#include "llstring.h"
|
||||
#include "lluuid.h"
|
||||
|
||||
#define REGION_FIELD "region_id"
|
||||
#define STATUS_FIELD "status"
|
||||
#define VERSION_FIELD "version"
|
||||
|
||||
const std::string LLPathfindingNavMeshStatus::sStatusPending("pending");
|
||||
const std::string LLPathfindingNavMeshStatus::sStatusBuilding("building");
|
||||
const std::string LLPathfindingNavMeshStatus::sStatusComplete("complete");
|
||||
const std::string LLPathfindingNavMeshStatus::sStatusRepending("repending");
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingNavMeshStatus
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus()
|
||||
: mIsValid(false),
|
||||
mRegionUUID(),
|
||||
mVersion(0U),
|
||||
mStatus(kComplete)
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID)
|
||||
: mIsValid(false),
|
||||
mRegionUUID(pRegionUUID),
|
||||
mVersion(0U),
|
||||
mStatus(kComplete)
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent)
|
||||
: mIsValid(true),
|
||||
mRegionUUID(pRegionUUID),
|
||||
mVersion(0U),
|
||||
mStatus(kComplete)
|
||||
{
|
||||
parseStatus(pContent);
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLSD &pContent)
|
||||
: mIsValid(true),
|
||||
mRegionUUID(),
|
||||
mVersion(0U),
|
||||
mStatus(kComplete)
|
||||
{
|
||||
llassert(pContent.has(REGION_FIELD));
|
||||
llassert(pContent.get(REGION_FIELD).isUUID());
|
||||
mRegionUUID = pContent.get(REGION_FIELD).asUUID();
|
||||
|
||||
parseStatus(pContent);
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther)
|
||||
: mIsValid(pOther.mIsValid),
|
||||
mRegionUUID(pOther.mRegionUUID),
|
||||
mVersion(pOther.mVersion),
|
||||
mStatus(pOther.mStatus)
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus::~LLPathfindingNavMeshStatus()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingNavMeshStatus &LLPathfindingNavMeshStatus::operator =(const LLPathfindingNavMeshStatus &pOther)
|
||||
{
|
||||
mIsValid = pOther.mIsValid;
|
||||
mRegionUUID = pOther.mRegionUUID;
|
||||
mVersion = pOther.mVersion;
|
||||
mStatus = pOther.mStatus;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void LLPathfindingNavMeshStatus::parseStatus(const LLSD &pContent)
|
||||
{
|
||||
llassert(pContent.has(VERSION_FIELD));
|
||||
llassert(pContent.get(VERSION_FIELD).isInteger());
|
||||
llassert(pContent.get(VERSION_FIELD).asInteger() >= 0);
|
||||
mVersion = static_cast<U32>(pContent.get(VERSION_FIELD).asInteger());
|
||||
|
||||
llassert(pContent.has(STATUS_FIELD));
|
||||
llassert(pContent.get(STATUS_FIELD).isString());
|
||||
std::string status = pContent.get(STATUS_FIELD).asString();
|
||||
|
||||
if (LLStringUtil::compareStrings(status, sStatusPending) == 0)
|
||||
{
|
||||
mStatus = kPending;
|
||||
}
|
||||
else if (LLStringUtil::compareStrings(status, sStatusBuilding) == 0)
|
||||
{
|
||||
mStatus = kBuilding;
|
||||
}
|
||||
else if (LLStringUtil::compareStrings(status, sStatusComplete) == 0)
|
||||
{
|
||||
mStatus = kComplete;
|
||||
}
|
||||
else if (LLStringUtil::compareStrings(status, sStatusRepending) == 0)
|
||||
{
|
||||
mStatus = kRepending;
|
||||
}
|
||||
else
|
||||
{
|
||||
mStatus = kComplete;
|
||||
llassert(0);
|
||||
}
|
||||
}
|
||||
77
indra/newview/llpathfindingnavmeshstatus.h
Normal file
77
indra/newview/llpathfindingnavmeshstatus.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @file llpathfindingnavmeshstatus.h
|
||||
* @brief Header file for llpathfindingnavmeshstatus
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGNAVMESHSTATUS_H
|
||||
#define LL_LLPATHFINDINGNAVMESHSTATUS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "lluuid.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LLPathfindingNavMeshStatus
|
||||
{
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
kPending,
|
||||
kBuilding,
|
||||
kComplete,
|
||||
kRepending
|
||||
} ENavMeshStatus;
|
||||
|
||||
LLPathfindingNavMeshStatus();
|
||||
LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID);
|
||||
LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent);
|
||||
LLPathfindingNavMeshStatus(const LLSD &pContent);
|
||||
LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther);
|
||||
virtual ~LLPathfindingNavMeshStatus();
|
||||
|
||||
LLPathfindingNavMeshStatus &operator =(const LLPathfindingNavMeshStatus &pOther);
|
||||
|
||||
bool isValid() const {return mIsValid;};
|
||||
const LLUUID &getRegionUUID() const {return mRegionUUID;};
|
||||
U32 getVersion() const {return mVersion;};
|
||||
ENavMeshStatus getStatus() const {return mStatus;};
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void parseStatus(const LLSD &pContent);
|
||||
|
||||
bool mIsValid;
|
||||
LLUUID mRegionUUID;
|
||||
U32 mVersion;
|
||||
ENavMeshStatus mStatus;
|
||||
|
||||
static const std::string sStatusPending;
|
||||
static const std::string sStatusBuilding;
|
||||
static const std::string sStatusComplete;
|
||||
static const std::string sStatusRepending;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGNAVMESHSTATUS_H
|
||||
162
indra/newview/llpathfindingobject.cpp
Normal file
162
indra/newview/llpathfindingobject.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
* @file llpathfindingobject.cpp
|
||||
* @brief Implementation of llpathfindingobject
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingobject.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llavatarname.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llsd.h"
|
||||
#include "lluuid.h"
|
||||
#include "v3math.h"
|
||||
|
||||
#define PATHFINDING_OBJECT_NAME_FIELD "name"
|
||||
#define PATHFINDING_OBJECT_DESCRIPTION_FIELD "description"
|
||||
#define PATHFINDING_OBJECT_OWNER_FIELD "owner"
|
||||
#define PATHFINDING_OBJECT_POSITION_FIELD "position"
|
||||
#define PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD "owner_is_group"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingObject
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingObject::LLPathfindingObject()
|
||||
: mUUID(),
|
||||
mName(),
|
||||
mDescription(),
|
||||
mOwnerUUID(),
|
||||
mHasOwnerName(false),
|
||||
mOwnerName(),
|
||||
mIsGroupOwned(false),
|
||||
mLocation()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &pObjectData)
|
||||
: mUUID(pUUID),
|
||||
mName(),
|
||||
mDescription(),
|
||||
mOwnerUUID(),
|
||||
mHasOwnerName(false),
|
||||
mOwnerName(),
|
||||
mIsGroupOwned(false),
|
||||
mLocation()
|
||||
{
|
||||
parseObjectData(pObjectData);
|
||||
}
|
||||
|
||||
LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther)
|
||||
: mUUID(pOther.mUUID),
|
||||
mName(pOther.mName),
|
||||
mDescription(pOther.mDescription),
|
||||
mOwnerUUID(pOther.mOwnerUUID),
|
||||
mHasOwnerName(false),
|
||||
mOwnerName(),
|
||||
mIsGroupOwned(pOther.mIsGroupOwned),
|
||||
mLocation(pOther.mLocation)
|
||||
{
|
||||
fetchOwnerName();
|
||||
}
|
||||
|
||||
LLPathfindingObject::~LLPathfindingObject()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingObject &LLPathfindingObject::operator =(const LLPathfindingObject& pOther)
|
||||
{
|
||||
mUUID = pOther.mUUID;
|
||||
mName = pOther.mName;
|
||||
mDescription = pOther.mDescription;
|
||||
mOwnerUUID = pOther.mOwnerUUID;
|
||||
fetchOwnerName();
|
||||
mIsGroupOwned = pOther.mIsGroupOwned;
|
||||
mLocation = pOther.mLocation;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string LLPathfindingObject::getOwnerName() const
|
||||
{
|
||||
std::string ownerName;
|
||||
|
||||
if (hasOwner())
|
||||
{
|
||||
ownerName = mOwnerName.getCompleteName();
|
||||
}
|
||||
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
void LLPathfindingObject::parseObjectData(const LLSD &pObjectData)
|
||||
{
|
||||
llassert(pObjectData.has(PATHFINDING_OBJECT_NAME_FIELD));
|
||||
llassert(pObjectData.get(PATHFINDING_OBJECT_NAME_FIELD).isString());
|
||||
mName = pObjectData.get(PATHFINDING_OBJECT_NAME_FIELD).asString();
|
||||
|
||||
llassert(pObjectData.has(PATHFINDING_OBJECT_DESCRIPTION_FIELD));
|
||||
llassert(pObjectData.get(PATHFINDING_OBJECT_DESCRIPTION_FIELD).isString());
|
||||
mDescription = pObjectData.get(PATHFINDING_OBJECT_DESCRIPTION_FIELD).asString();
|
||||
|
||||
llassert(pObjectData.has(PATHFINDING_OBJECT_OWNER_FIELD));
|
||||
llassert(pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).isUUID());
|
||||
mOwnerUUID = pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).asUUID();
|
||||
fetchOwnerName();
|
||||
|
||||
if (pObjectData.has(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD))
|
||||
{
|
||||
llassert(pObjectData.get(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD).isBoolean());
|
||||
mIsGroupOwned = pObjectData.get(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD).asBoolean();
|
||||
}
|
||||
|
||||
llassert(pObjectData.has(PATHFINDING_OBJECT_POSITION_FIELD));
|
||||
llassert(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD).isArray());
|
||||
mLocation.setValue(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD));
|
||||
}
|
||||
|
||||
void LLPathfindingObject::fetchOwnerName()
|
||||
{
|
||||
mHasOwnerName = false;
|
||||
if (hasOwner())
|
||||
{
|
||||
mHasOwnerName = LLAvatarNameCache::get(mOwnerUUID, &mOwnerName);
|
||||
if (!mHasOwnerName)
|
||||
{
|
||||
LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName)
|
||||
{
|
||||
llassert(mOwnerUUID == pOwnerUUID);
|
||||
mOwnerName = pAvatarName;
|
||||
mHasOwnerName = true;
|
||||
}
|
||||
80
indra/newview/llpathfindingobject.h
Normal file
80
indra/newview/llpathfindingobject.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @file llpathfindingobject.h
|
||||
* @brief Header file for llpathfindingobject
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGOBJECT_H
|
||||
#define LL_LLPATHFINDINGOBJECT_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "llavatarname.h"
|
||||
#include "lluuid.h"
|
||||
#include "v3math.h"
|
||||
|
||||
class LLPathfindingObject;
|
||||
class LLSD;
|
||||
|
||||
typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr;
|
||||
|
||||
class LLPathfindingObject
|
||||
{
|
||||
public:
|
||||
LLPathfindingObject();
|
||||
LLPathfindingObject(const std::string &pUUID, const LLSD &pObjectData);
|
||||
LLPathfindingObject(const LLPathfindingObject& pOther);
|
||||
virtual ~LLPathfindingObject();
|
||||
|
||||
LLPathfindingObject& operator =(const LLPathfindingObject& pOther);
|
||||
|
||||
inline const LLUUID& getUUID() const {return mUUID;};
|
||||
inline const std::string& getName() const {return mName;};
|
||||
inline const std::string& getDescription() const {return mDescription;};
|
||||
inline BOOL hasOwner() const {return mOwnerUUID.notNull();};
|
||||
inline bool hasOwnerName() const {return mHasOwnerName;};
|
||||
std::string getOwnerName() const;
|
||||
inline BOOL isGroupOwned() const {return mIsGroupOwned;};
|
||||
inline const LLVector3& getLocation() const {return mLocation;};
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void parseObjectData(const LLSD &pObjectData);
|
||||
|
||||
void fetchOwnerName();
|
||||
void handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName);
|
||||
|
||||
LLUUID mUUID;
|
||||
std::string mName;
|
||||
std::string mDescription;
|
||||
LLUUID mOwnerUUID;
|
||||
bool mHasOwnerName;
|
||||
LLAvatarName mOwnerName;
|
||||
BOOL mIsGroupOwned;
|
||||
LLVector3 mLocation;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGOBJECT_H
|
||||
112
indra/newview/llpathfindingobjectlist.cpp
Normal file
112
indra/newview/llpathfindingobjectlist.cpp
Normal file
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* @file llpathfindingobjectlist.cpp
|
||||
* @brief Implementation of llpathfindingobjectlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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 "llpathfindingobjectlist.h"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// LLPathfindingObjectList
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
LLPathfindingObjectList::LLPathfindingObjectList()
|
||||
: mObjectMap()
|
||||
{
|
||||
}
|
||||
|
||||
LLPathfindingObjectList::~LLPathfindingObjectList()
|
||||
{
|
||||
}
|
||||
|
||||
bool LLPathfindingObjectList::isEmpty() const
|
||||
{
|
||||
return mObjectMap.empty();
|
||||
}
|
||||
|
||||
void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr)
|
||||
{
|
||||
if (pUpdateObjectPtr != NULL)
|
||||
{
|
||||
std::string updateObjectId = pUpdateObjectPtr->getUUID().asString();
|
||||
|
||||
LLPathfindingObjectMap::iterator foundObjectIter = mObjectMap.find(updateObjectId);
|
||||
if (foundObjectIter == mObjectMap.end())
|
||||
{
|
||||
mObjectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(updateObjectId, pUpdateObjectPtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
foundObjectIter->second = pUpdateObjectPtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPathfindingObjectList::update(LLPathfindingObjectListPtr pUpdateObjectListPtr)
|
||||
{
|
||||
if ((pUpdateObjectListPtr != NULL) && !pUpdateObjectListPtr->isEmpty())
|
||||
{
|
||||
for (LLPathfindingObjectMap::const_iterator updateObjectIter = pUpdateObjectListPtr->begin();
|
||||
updateObjectIter != pUpdateObjectListPtr->end(); ++updateObjectIter)
|
||||
{
|
||||
const LLPathfindingObjectPtr updateObjectPtr = updateObjectIter->second;
|
||||
update(updateObjectPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLPathfindingObjectPtr LLPathfindingObjectList::find(const std::string &pObjectId) const
|
||||
{
|
||||
LLPathfindingObjectPtr objectPtr;
|
||||
|
||||
LLPathfindingObjectMap::const_iterator objectIter = mObjectMap.find(pObjectId);
|
||||
if (objectIter != mObjectMap.end())
|
||||
{
|
||||
objectPtr = objectIter->second;
|
||||
}
|
||||
|
||||
return objectPtr;
|
||||
}
|
||||
|
||||
LLPathfindingObjectList::const_iterator LLPathfindingObjectList::begin() const
|
||||
{
|
||||
return mObjectMap.begin();
|
||||
}
|
||||
|
||||
LLPathfindingObjectList::const_iterator LLPathfindingObjectList::end() const
|
||||
{
|
||||
return mObjectMap.end();
|
||||
}
|
||||
|
||||
LLPathfindingObjectMap &LLPathfindingObjectList::getObjectMap()
|
||||
{
|
||||
return mObjectMap;
|
||||
}
|
||||
67
indra/newview/llpathfindingobjectlist.h
Normal file
67
indra/newview/llpathfindingobjectlist.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @file llpathfindingobjectlist.h
|
||||
* @brief Header file for llpathfindingobjectlist
|
||||
* @author Stinson@lindenlab.com
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, 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_LLPATHFINDINGOBJECTLIST_H
|
||||
#define LL_LLPATHFINDINGOBJECTLIST_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "llpathfindingobject.h"
|
||||
|
||||
class LLPathfindingObjectList;
|
||||
|
||||
typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr;
|
||||
typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap;
|
||||
|
||||
class LLPathfindingObjectList
|
||||
{
|
||||
public:
|
||||
LLPathfindingObjectList();
|
||||
virtual ~LLPathfindingObjectList();
|
||||
|
||||
bool isEmpty() const;
|
||||
|
||||
void update(LLPathfindingObjectPtr pUpdateObjectPtr);
|
||||
void update(LLPathfindingObjectListPtr pUpdateObjectListPtr);
|
||||
|
||||
LLPathfindingObjectPtr find(const std::string &pObjectId) const;
|
||||
|
||||
typedef LLPathfindingObjectMap::const_iterator const_iterator;
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
|
||||
|
||||
protected:
|
||||
LLPathfindingObjectMap &getObjectMap();
|
||||
|
||||
private:
|
||||
LLPathfindingObjectMap mObjectMap;
|
||||
};
|
||||
|
||||
#endif // LL_LLPATHFINDINGOBJECTLIST_H
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llphysicsmotion.cpp
|
||||
* @brief Implementation of LLPhysicsMotion class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -74,6 +68,19 @@ inline F64 llsgn(const F64 a)
|
||||
class LLPhysicsMotion
|
||||
{
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
SMOOTHING = 0,
|
||||
MASS,
|
||||
GRAVITY,
|
||||
SPRING,
|
||||
GAIN,
|
||||
DAMPING,
|
||||
DRAG,
|
||||
MAX_EFFECT,
|
||||
NUM_PARAMS
|
||||
} eParamName;
|
||||
|
||||
/*
|
||||
param_driver_name: The param that controls the params that are being affected by the physics.
|
||||
joint_name: The joint that the body part is attached to. The joint is
|
||||
@@ -107,8 +114,12 @@ public:
|
||||
mVelocity_local(0)
|
||||
{
|
||||
mJointState = new LLJointState;
|
||||
}
|
||||
|
||||
for (U32 i = 0; i < NUM_PARAMS; ++i)
|
||||
{
|
||||
mParamCache[i] = NULL;
|
||||
}
|
||||
}
|
||||
void getString(std::ostringstream &oss);
|
||||
|
||||
BOOL initialize();
|
||||
@@ -124,19 +135,46 @@ public:
|
||||
|
||||
void reset();
|
||||
protected:
|
||||
F32 getParamValue(const std::string& controller_key)
|
||||
{
|
||||
const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key);
|
||||
|
||||
F32 getParamValue(eParamName param)
|
||||
{
|
||||
static std::string controller_key[] =
|
||||
{
|
||||
"Smoothing",
|
||||
"Mass",
|
||||
"Gravity",
|
||||
"Spring",
|
||||
"Gain",
|
||||
"Damping",
|
||||
"Drag",
|
||||
"MaxEffect"
|
||||
};
|
||||
|
||||
if (!mParamCache[param])
|
||||
{
|
||||
const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key[param]);
|
||||
if (entry == mParamControllers.end())
|
||||
{
|
||||
return sDefaultController[controller_key];
|
||||
return sDefaultController[controller_key[param]];
|
||||
}
|
||||
const std::string& param_name = (*entry).second.c_str();
|
||||
return mCharacter->getVisualParamWeight(param_name.c_str());
|
||||
}
|
||||
mParamCache[param] = mCharacter->getVisualParam(param_name.c_str());
|
||||
}
|
||||
|
||||
if (mParamCache[param])
|
||||
{
|
||||
return mParamCache[param]->getWeight();
|
||||
}
|
||||
else
|
||||
{
|
||||
return sDefaultController[controller_key[param]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void setParamValue(LLViewerVisualParam *param,
|
||||
const F32 new_value_local,
|
||||
F32 behavior_maxeffect);
|
||||
F32 behavior_maxeffect);
|
||||
|
||||
F32 toLocal(const LLVector3 &world);
|
||||
F32 calculateVelocity_local();
|
||||
@@ -164,6 +202,8 @@ private:
|
||||
|
||||
F32 mLastTime;
|
||||
|
||||
LLVisualParam* mParamCache[NUM_PARAMS];
|
||||
|
||||
static default_controller_map_t sDefaultController;
|
||||
};
|
||||
|
||||
@@ -268,7 +308,7 @@ void LLPhysicsMotion::getString(std::ostringstream &oss)
|
||||
oss << " Controllers:" << std::endl;
|
||||
for(controller_map_t::const_iterator it = mParamControllers.begin(); it!= mParamControllers.end(); ++it)
|
||||
{
|
||||
oss << " mParamControllers[\"" << it->first << "\"] = \"" << it->second << "\" =" << getParamValue(it->first) << std::endl;
|
||||
oss << " mParamControllers[\"" << it->first << "\"] = \"" << it->second << "\" =" << mCharacter->getVisualParamWeight(it->first.c_str()) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,15 +614,16 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
|
||||
|
||||
LLJoint *joint = mJointState->getJoint();
|
||||
|
||||
const F32 behavior_mass = getParamValue("Mass");
|
||||
const F32 behavior_gravity = getParamValue("Gravity");
|
||||
const F32 behavior_spring = getParamValue("Spring");
|
||||
const F32 behavior_gain = getParamValue("Gain");
|
||||
const F32 behavior_damping = getParamValue("Damping");
|
||||
const F32 behavior_drag = getParamValue("Drag");
|
||||
const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts.
|
||||
const F32 behavior_mass = getParamValue(MASS);
|
||||
const F32 behavior_gravity = getParamValue(GRAVITY);
|
||||
const F32 behavior_spring = getParamValue(SPRING);
|
||||
const F32 behavior_gain = getParamValue(GAIN);
|
||||
const F32 behavior_damping = getParamValue(DAMPING);
|
||||
const F32 behavior_drag = getParamValue(DRAG);
|
||||
F32 behavior_maxeffect = getParamValue(MAX_EFFECT);
|
||||
|
||||
const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts.
|
||||
|
||||
F32 behavior_maxeffect = getParamValue("MaxEffect");
|
||||
if (physics_test)
|
||||
behavior_maxeffect = 1.0f;
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llphysicsmotion.h
|
||||
* @brief Implementation of LLPhysicsMotion class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -113,6 +107,7 @@ public:
|
||||
virtual void onDeactivate();
|
||||
|
||||
LLCharacter* getCharacter() { return mCharacter; }
|
||||
|
||||
protected:
|
||||
void addMotion(LLPhysicsMotion *motion);
|
||||
private:
|
||||
|
||||
@@ -229,16 +229,20 @@ U32 LLPolyMeshSharedData::getNumKB()
|
||||
BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||
{
|
||||
U32 i;
|
||||
mBaseCoords = new LLVector3[ numVertices ];
|
||||
mBaseNormals = new LLVector3[ numVertices ];
|
||||
mBaseBinormals = new LLVector3[ numVertices ];
|
||||
mBaseCoords = new LLVector4a[ numVertices ];
|
||||
mBaseNormals = new LLVector4a[ numVertices ];
|
||||
mBaseBinormals = new LLVector4a[ numVertices ];
|
||||
mTexCoords = new LLVector2[ numVertices ];
|
||||
mDetailTexCoords = new LLVector2[ numVertices ];
|
||||
mWeights = new F32[ numVertices ];
|
||||
for (i = 0; i < numVertices; i++)
|
||||
{
|
||||
mBaseCoords[i].clear();
|
||||
mBaseNormals[i].clear();
|
||||
mBaseBinormals[i].clear();
|
||||
mTexCoords[i].clear();
|
||||
mWeights[i] = 0.f;
|
||||
}
|
||||
}
|
||||
mNumVertices = numVertices;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -408,40 +412,48 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
|
||||
allocateVertexData( numVertices );
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Coords
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(mBaseCoords, 3*sizeof(float), numVertices, fp);
|
||||
llendianswizzle(mBaseCoords, sizeof(float), 3*numVertices);
|
||||
if (numRead != numVertices)
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
llerrs << "can't read Coordinates from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
//----------------------------------------------------------------
|
||||
// Coords
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(&mBaseCoords[i], sizeof(float), 3, fp);
|
||||
llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << "can't read Coordinates from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Normals
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(mBaseNormals, 3*sizeof(float), numVertices, fp);
|
||||
llendianswizzle(mBaseNormals, sizeof(float), 3*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
llerrs << " can't read Normals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
//----------------------------------------------------------------
|
||||
// Normals
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(&mBaseNormals[i], sizeof(float), 3, fp);
|
||||
llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << " can't read Normals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Binormals
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(mBaseBinormals, 3*sizeof(float), numVertices, fp);
|
||||
llendianswizzle(mBaseBinormals, sizeof(float), 3*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
llerrs << " can't read Binormals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
//----------------------------------------------------------------
|
||||
// Binormals
|
||||
//----------------------------------------------------------------
|
||||
numRead = fread(&mBaseBinormals[i], sizeof(float), 3, fp);
|
||||
llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llerrs << " can't read Binormals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// TexCoords
|
||||
//----------------------------------------------------------------
|
||||
@@ -767,21 +779,28 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
|
||||
{
|
||||
// Allocate memory without initializing every vector
|
||||
// NOTE: This makes asusmptions about the size of LLVector[234]
|
||||
int nverts = mSharedData->mNumVertices;
|
||||
int nfloats = nverts * (2*4 + 3*3 + 2 + 4);
|
||||
S32 nverts = mSharedData->mNumVertices;
|
||||
//make sure it's an even number of verts for alignment
|
||||
nverts += nverts%2;
|
||||
S32 nfloats = nverts * (
|
||||
4 + //coords
|
||||
4 + //normals
|
||||
4 + //weights
|
||||
2 + //coords
|
||||
4 + //scaled normals
|
||||
4 + //binormals
|
||||
4); //scaled binormals
|
||||
|
||||
//use 16 byte aligned vertex data to make LLPolyMesh SSE friendly
|
||||
mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4);
|
||||
int offset = 0;
|
||||
mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts;
|
||||
mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts;
|
||||
mClothingWeights = (LLVector4*)(mVertexData + offset); offset += 4*nverts;
|
||||
mTexCoords = (LLVector2*)(mVertexData + offset); offset += 2*nverts;
|
||||
|
||||
// these members don't need to be 16-byte aligned, but the first one might be
|
||||
// read during an aligned memcpy of mTexCoords
|
||||
mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts;
|
||||
mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts;
|
||||
mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts;
|
||||
S32 offset = 0;
|
||||
mCoords = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
mNormals = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
mClothingWeights = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
mTexCoords = (LLVector2*)(mVertexData + offset); offset += 2*nverts;
|
||||
mScaledNormals = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
mBinormals = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
mScaledBinormals = (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
|
||||
initializeForMorph();
|
||||
}
|
||||
}
|
||||
@@ -966,38 +985,47 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
//----------------------------------------------------------------
|
||||
// Coords
|
||||
//----------------------------------------------------------------
|
||||
LLVector3* coords = mSharedData->mBaseCoords;
|
||||
|
||||
llendianswizzle(coords, sizeof(float), 3*numVertices);
|
||||
if (fwrite(coords, 3*sizeof(float), numVertices, fp) != numVertices)
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
LLVector4a& coords = mSharedData->mBaseCoords[i];
|
||||
|
||||
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(coords.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
llendianswizzle(coords, sizeof(float), 3*numVertices);
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Normals
|
||||
//----------------------------------------------------------------
|
||||
LLVector3* normals = mSharedData->mBaseNormals;
|
||||
|
||||
llendianswizzle(normals, sizeof(float), 3*numVertices);
|
||||
if (fwrite(normals, 3*sizeof(float), numVertices, fp) != numVertices)
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
LLVector4a& normals = mSharedData->mBaseNormals[i];
|
||||
|
||||
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(normals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
llendianswizzle(normals, sizeof(float), 3*numVertices);
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Binormals
|
||||
//----------------------------------------------------------------
|
||||
LLVector3* binormals = mSharedData->mBaseBinormals;
|
||||
|
||||
llendianswizzle(binormals, sizeof(float), 3*numVertices);
|
||||
if (fwrite(binormals, 3*sizeof(float), numVertices, fp) != numVertices)
|
||||
for (U16 i = 0; i < numVertices; ++i)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
LLVector4a& binormals = mSharedData->mBaseBinormals[i];
|
||||
|
||||
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(binormals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
llendianswizzle(binormals, sizeof(float), 3*numVertices);
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// TexCoords
|
||||
@@ -1224,24 +1252,24 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
||||
int nfaces = mSharedData->mNumFaces;
|
||||
int i;
|
||||
|
||||
LLVector4* coords = getWritableCoords();
|
||||
LLVector4a* coords = getWritableCoords();
|
||||
for ( i=0; i<nverts; i++) {
|
||||
std::string outstring = llformat("v %f %f %f\n",
|
||||
coords[i][0],
|
||||
coords[i][1],
|
||||
coords[i][2]);
|
||||
coords[i].getF32ptr()[0],
|
||||
coords[i].getF32ptr()[1],
|
||||
coords[i].getF32ptr()[2]);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
LLVector4* normals = getWritableNormals();
|
||||
LLVector4a* normals = getWritableNormals();
|
||||
for ( i=0; i<nverts; i++) {
|
||||
std::string outstring = llformat("vn %f %f %f\n",
|
||||
normals[i][0],
|
||||
normals[i][1],
|
||||
normals[i][2]);
|
||||
normals[i].getF32ptr()[0],
|
||||
normals[i].getF32ptr()[1],
|
||||
normals[i].getF32ptr()[2]);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
@@ -1293,9 +1321,9 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
int nnormals = 0;
|
||||
int ntexcoords = 0;
|
||||
|
||||
LLVector4* coords = getWritableCoords();
|
||||
LLVector4* normals = getWritableNormals();
|
||||
LLVector3* binormals = getWritableBinormals();
|
||||
LLVector4a* coords = getWritableCoords();
|
||||
LLVector4a* normals = getWritableNormals();
|
||||
LLVector4a* binormals = getWritableBinormals();
|
||||
LLVector2* tex = getWritableTexCoords();
|
||||
LLPolyFace* faces = getFaces();
|
||||
|
||||
@@ -1398,7 +1426,7 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
int v;
|
||||
for ( v=0; v<nverts; v++)
|
||||
{
|
||||
binormals[v].setZero();
|
||||
binormals[v].clear();
|
||||
}
|
||||
|
||||
int f;
|
||||
@@ -1408,29 +1436,18 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
S32 f1 = faces[f][1];
|
||||
S32 f2 = faces[f][2];
|
||||
|
||||
LLVector4a v0;
|
||||
LLVector4a v1;
|
||||
LLVector4a v2;
|
||||
v0.load3(coords[f0].mV);;
|
||||
v1.load3(coords[f1].mV);;
|
||||
v2.load3(coords[f2].mV);;
|
||||
LLVector2& t0 = tex[f0];
|
||||
LLVector2& t1 = tex[f1];
|
||||
LLVector2& t2 = tex[f2];
|
||||
|
||||
LLVector4a binorm;
|
||||
calc_binormal_from_triangle(binorm, v0, t0, v1, t1, v2, t2);
|
||||
calc_binormal_from_triangle(binorm, coords[f0], tex[f0], coords[f1], tex[f1], coords[f2], tex[f2]);
|
||||
binorm.normalize3fast();
|
||||
|
||||
LLVector3 binormdelta(binorm.getF32ptr());
|
||||
binormals[f0] += binormdelta;
|
||||
binormals[f1] += binormdelta;
|
||||
binormals[f2] += binormdelta;
|
||||
binormals[f0].add(binorm);
|
||||
binormals[f1].add(binorm);
|
||||
binormals[f2].add(binorm);
|
||||
}
|
||||
|
||||
for ( v=0; v<nverts; v++)
|
||||
{
|
||||
binormals[v].normVec();
|
||||
binormals[v].normalize3();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -1449,26 +1466,26 @@ BOOL LLPolyMesh::setSharedFromCurrent()
|
||||
LLPolyMesh delta(mSharedData, NULL);
|
||||
U32 nverts = delta.getNumVertices();
|
||||
|
||||
LLVector4 *delta_coords = delta.getWritableCoords();
|
||||
LLVector4 *delta_normals = delta.getWritableNormals();
|
||||
LLVector3 *delta_binormals = delta.getWritableBinormals();
|
||||
LLVector4a *delta_coords = delta.getWritableCoords();
|
||||
LLVector4a *delta_normals = delta.getWritableNormals();
|
||||
LLVector4a *delta_binormals = delta.getWritableBinormals();
|
||||
LLVector2 *delta_tex_coords = delta.getWritableTexCoords();
|
||||
|
||||
U32 vert_index;
|
||||
for( vert_index = 0; vert_index < nverts; vert_index++)
|
||||
{
|
||||
delta_coords[vert_index] -= mCoords[vert_index];
|
||||
delta_normals[vert_index] -= mNormals[vert_index];
|
||||
delta_binormals[vert_index] -= mBinormals[vert_index];
|
||||
delta_tex_coords[vert_index] -= mTexCoords[vert_index];
|
||||
delta_coords[vert_index].sub( mCoords[vert_index]);
|
||||
delta_normals[vert_index].sub( mNormals[vert_index]);
|
||||
delta_binormals[vert_index].sub( mBinormals[vert_index]);
|
||||
delta_tex_coords[vert_index] -= mTexCoords[vert_index];
|
||||
}
|
||||
|
||||
// Now copy the new base mesh
|
||||
|
||||
memcpy(mSharedData->mBaseCoords, mCoords, sizeof(LLVector3) * mSharedData->mNumVertices);
|
||||
memcpy(mSharedData->mBaseNormals, mNormals, sizeof(LLVector3) * mSharedData->mNumVertices);
|
||||
memcpy(mSharedData->mBaseBinormals, mBinormals, sizeof(LLVector3) * mSharedData->mNumVertices);
|
||||
memcpy(mSharedData->mTexCoords, mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mSharedData->mBaseCoords, (F32*) mCoords, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mSharedData->mBaseNormals, (F32*) mNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mSharedData->mBaseBinormals, (F32*) mBinormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mSharedData->mTexCoords, (F32*) mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
|
||||
|
||||
// Update all avatars by applying the delta
|
||||
|
||||
@@ -1479,27 +1496,29 @@ BOOL LLPolyMesh::setSharedFromCurrent()
|
||||
LLPolyMesh* mesh = avatarp->getMesh(mSharedData);
|
||||
if (mesh)
|
||||
{
|
||||
LLVector4 *mesh_coords = mesh->getWritableCoords();
|
||||
LLVector4 *mesh_normals = mesh->getWritableNormals();
|
||||
LLVector3 *mesh_binormals = mesh->getWritableBinormals();
|
||||
LLVector2 *mesh_tex_coords = mesh->getWritableTexCoords();
|
||||
LLVector3 *mesh_scaled_normals = mesh->getScaledNormals();
|
||||
LLVector3 *mesh_scaled_binormals = mesh->getScaledBinormals();
|
||||
LLVector4a *mesh_coords = mesh->getWritableCoords();
|
||||
LLVector4a *mesh_normals = mesh->getWritableNormals();
|
||||
LLVector4a *mesh_binormals = mesh->getWritableBinormals();
|
||||
LLVector2 *mesh_tex_coords = mesh->getWritableTexCoords();
|
||||
LLVector4a *mesh_scaled_normals = mesh->getScaledNormals();
|
||||
LLVector4a *mesh_scaled_binormals = mesh->getScaledBinormals();
|
||||
|
||||
for( vert_index = 0; vert_index < nverts; vert_index++)
|
||||
{
|
||||
mesh_coords[vert_index] -= delta_coords[vert_index];
|
||||
mesh_coords[vert_index].sub(delta_coords[vert_index]);
|
||||
mesh_tex_coords[vert_index] -= delta_tex_coords[vert_index];
|
||||
|
||||
mesh_scaled_normals[vert_index] -= LLVector3(delta_normals[vert_index]);
|
||||
LLVector3 normalized_normal = mesh_scaled_normals[vert_index];
|
||||
normalized_normal.normVec();
|
||||
mesh_normals[vert_index] = LLVector4(normalized_normal);
|
||||
mesh_scaled_normals[vert_index].sub(delta_normals[vert_index]);
|
||||
LLVector4a normalized_normal = mesh_scaled_normals[vert_index];
|
||||
normalized_normal.normalize3();
|
||||
mesh_normals[vert_index] = normalized_normal;
|
||||
|
||||
mesh_scaled_binormals[vert_index] -= delta_binormals[vert_index];
|
||||
LLVector3 tangent = mesh_scaled_binormals[vert_index] % normalized_normal;
|
||||
LLVector3 normalized_binormal = normalized_normal % tangent;
|
||||
normalized_binormal.normVec();
|
||||
mesh_scaled_binormals[vert_index].sub(delta_binormals[vert_index]);
|
||||
LLVector4a tangent;
|
||||
tangent.setCross3(mesh_scaled_binormals[vert_index], normalized_normal);
|
||||
LLVector4a normalized_binormal;
|
||||
normalized_binormal.setCross3(normalized_normal, tangent);
|
||||
normalized_binormal.normalize3();
|
||||
mesh_binormals[vert_index] = normalized_binormal;
|
||||
}
|
||||
|
||||
@@ -1598,7 +1617,7 @@ void LLPolyMesh::dumpDiagInfo(void*)
|
||||
//-----------------------------------------------------------------------------
|
||||
// getWritableCoords()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector4 *LLPolyMesh::getWritableCoords()
|
||||
LLVector4a *LLPolyMesh::getWritableCoords()
|
||||
{
|
||||
return mCoords;
|
||||
}
|
||||
@@ -1606,7 +1625,7 @@ LLVector4 *LLPolyMesh::getWritableCoords()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getWritableNormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector4 *LLPolyMesh::getWritableNormals()
|
||||
LLVector4a *LLPolyMesh::getWritableNormals()
|
||||
{
|
||||
return mNormals;
|
||||
}
|
||||
@@ -1614,7 +1633,7 @@ LLVector4 *LLPolyMesh::getWritableNormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getWritableBinormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 *LLPolyMesh::getWritableBinormals()
|
||||
LLVector4a *LLPolyMesh::getWritableBinormals()
|
||||
{
|
||||
return mBinormals;
|
||||
}
|
||||
@@ -1623,7 +1642,7 @@ LLVector3 *LLPolyMesh::getWritableBinormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getWritableClothingWeights()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector4 *LLPolyMesh::getWritableClothingWeights()
|
||||
LLVector4a *LLPolyMesh::getWritableClothingWeights()
|
||||
{
|
||||
return mClothingWeights;
|
||||
}
|
||||
@@ -1639,7 +1658,7 @@ LLVector2 *LLPolyMesh::getWritableTexCoords()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getScaledNormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 *LLPolyMesh::getScaledNormals()
|
||||
LLVector4a *LLPolyMesh::getScaledNormals()
|
||||
{
|
||||
return mScaledNormals;
|
||||
}
|
||||
@@ -1647,7 +1666,7 @@ LLVector3 *LLPolyMesh::getScaledNormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getScaledBinormals()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 *LLPolyMesh::getScaledBinormals()
|
||||
LLVector4a *LLPolyMesh::getScaledBinormals()
|
||||
{
|
||||
return mScaledBinormals;
|
||||
}
|
||||
@@ -1661,19 +1680,20 @@ void LLPolyMesh::initializeForMorph()
|
||||
if (!mSharedData)
|
||||
return;
|
||||
|
||||
LLVector4a::memcpyNonAliased16((F32*) mCoords, (F32*) mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mScaledNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
|
||||
|
||||
for (U32 i = 0; i < (U32)mSharedData->mNumVertices; ++i)
|
||||
{
|
||||
mCoords[i] = LLVector4(mSharedData->mBaseCoords[i]);
|
||||
mNormals[i] = LLVector4(mSharedData->mBaseNormals[i]);
|
||||
mClothingWeights[i].clear();
|
||||
}
|
||||
|
||||
memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
|
||||
memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
|
||||
memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
|
||||
memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices); /*Flawfinder: ignore*/
|
||||
memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getMorphList()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1818,8 +1838,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLVOAvatar *avatarp)
|
||||
{
|
||||
mAvatar = avatarp;
|
||||
mDefaultVec.setVec(0.001f, 0.001f, 0.001f);
|
||||
mAvatar = avatarp;
|
||||
mDefaultVec.splat(0.001f);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1947,36 +1967,49 @@ LLPolyMorphData *clone_morph_param_direction(const LLPolyMorphData *src_data,
|
||||
const LLVector3 &direction,
|
||||
const std::string &name)
|
||||
{
|
||||
LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
|
||||
cloned_morph_data->mName = name;
|
||||
for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
|
||||
{
|
||||
cloned_morph_data->mCoords[v] = direction;
|
||||
cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
|
||||
cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
|
||||
}
|
||||
return cloned_morph_data;
|
||||
LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
|
||||
cloned_morph_data->mName = name;
|
||||
LLVector4a dir;
|
||||
dir.load3(direction.mV);
|
||||
|
||||
for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
|
||||
{
|
||||
cloned_morph_data->mCoords[v] = dir;
|
||||
cloned_morph_data->mNormals[v].clear();
|
||||
cloned_morph_data->mBinormals[v].clear();
|
||||
}
|
||||
return cloned_morph_data;
|
||||
}
|
||||
|
||||
LLPolyMorphData *clone_morph_param_cleavage(const LLPolyMorphData *src_data,
|
||||
F32 scale,
|
||||
const std::string &name)
|
||||
{
|
||||
LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
|
||||
cloned_morph_data->mName = name;
|
||||
for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
|
||||
{
|
||||
cloned_morph_data->mCoords[v] = src_data->mCoords[v]*scale;
|
||||
cloned_morph_data->mNormals[v] = src_data->mNormals[v]*scale;
|
||||
cloned_morph_data->mBinormals[v] = src_data->mBinormals[v]*scale;
|
||||
if (cloned_morph_data->mCoords[v][1] < 0)
|
||||
{
|
||||
cloned_morph_data->mCoords[v][1] *= -1;
|
||||
cloned_morph_data->mNormals[v][1] *= -1;
|
||||
cloned_morph_data->mBinormals[v][1] *= -1;
|
||||
}
|
||||
}
|
||||
return cloned_morph_data;
|
||||
LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
|
||||
cloned_morph_data->mName = name;
|
||||
|
||||
LLVector4a sc;
|
||||
sc.splat(scale);
|
||||
|
||||
LLVector4a nsc;
|
||||
nsc.set(scale, -scale, scale, scale);
|
||||
|
||||
for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
|
||||
{
|
||||
if (cloned_morph_data->mCoords[v][1] < 0)
|
||||
{
|
||||
cloned_morph_data->mCoords[v].setMul(src_data->mCoords[v],nsc);
|
||||
cloned_morph_data->mNormals[v].setMul(src_data->mNormals[v],nsc);
|
||||
cloned_morph_data->mBinormals[v].setMul(src_data->mBinormals[v],nsc);
|
||||
}
|
||||
else
|
||||
{
|
||||
cloned_morph_data->mCoords[v].setMul(src_data->mCoords[v],sc);
|
||||
cloned_morph_data->mNormals[v].setMul(src_data->mNormals[v], sc);
|
||||
cloned_morph_data->mBinormals[v].setMul(src_data->mBinormals[v],sc);
|
||||
}
|
||||
}
|
||||
return cloned_morph_data;
|
||||
}
|
||||
|
||||
// End
|
||||
|
||||
@@ -73,9 +73,9 @@ private:
|
||||
|
||||
// vertex data
|
||||
S32 mNumVertices;
|
||||
LLVector3 *mBaseCoords;
|
||||
LLVector3 *mBaseNormals;
|
||||
LLVector3 *mBaseBinormals;
|
||||
LLVector4a *mBaseCoords;
|
||||
LLVector4a *mBaseNormals;
|
||||
LLVector4a *mBaseBinormals;
|
||||
LLVector2 *mTexCoords;
|
||||
LLVector2 *mDetailTexCoords;
|
||||
F32 *mWeights;
|
||||
@@ -235,41 +235,41 @@ public:
|
||||
}
|
||||
|
||||
// Get coords
|
||||
const LLVector4 *getCoords() const{
|
||||
const LLVector4a *getCoords() const{
|
||||
return mCoords;
|
||||
}
|
||||
|
||||
// non const version
|
||||
LLVector4 *getWritableCoords();
|
||||
LLVector4a *getWritableCoords();
|
||||
|
||||
// Get normals
|
||||
const LLVector4 *getNormals() const{
|
||||
const LLVector4a *getNormals() const{
|
||||
return mNormals;
|
||||
}
|
||||
|
||||
// Get normals
|
||||
const LLVector3 *getBinormals() const{
|
||||
const LLVector4a *getBinormals() const{
|
||||
return mBinormals;
|
||||
}
|
||||
|
||||
// Get base mesh normals
|
||||
const LLVector3 *getBaseNormals() const{
|
||||
const LLVector4a *getBaseNormals() const{
|
||||
llassert(mSharedData);
|
||||
return mSharedData->mBaseNormals;
|
||||
}
|
||||
|
||||
// Get base mesh normals
|
||||
const LLVector3 *getBaseBinormals() const{
|
||||
const LLVector4a *getBaseBinormals() const{
|
||||
llassert(mSharedData);
|
||||
return mSharedData->mBaseBinormals;
|
||||
}
|
||||
|
||||
// intermediate morphed normals and output normals
|
||||
LLVector4 *getWritableNormals();
|
||||
LLVector3 *getScaledNormals();
|
||||
LLVector4a *getWritableNormals();
|
||||
LLVector4a *getScaledNormals();
|
||||
|
||||
LLVector3 *getWritableBinormals();
|
||||
LLVector3 *getScaledBinormals();
|
||||
LLVector4a *getWritableBinormals();
|
||||
LLVector4a *getScaledBinormals();
|
||||
|
||||
// Get texCoords
|
||||
const LLVector2 *getTexCoords() const {
|
||||
@@ -293,9 +293,9 @@ public:
|
||||
|
||||
F32 *getWritableWeights() const;
|
||||
|
||||
LLVector4 *getWritableClothingWeights();
|
||||
LLVector4a *getWritableClothingWeights();
|
||||
|
||||
const LLVector4 *getClothingWeights()
|
||||
const LLVector4a *getClothingWeights()
|
||||
{
|
||||
return mClothingWeights;
|
||||
}
|
||||
@@ -363,17 +363,17 @@ protected:
|
||||
// Single array of floats for allocation / deletion
|
||||
F32 *mVertexData;
|
||||
// deformed vertices (resulting from application of morph targets)
|
||||
LLVector4 *mCoords;
|
||||
LLVector4a *mCoords;
|
||||
// deformed normals (resulting from application of morph targets)
|
||||
LLVector3 *mScaledNormals;
|
||||
LLVector4a *mScaledNormals;
|
||||
// output normals (after normalization)
|
||||
LLVector4 *mNormals;
|
||||
LLVector4a *mNormals;
|
||||
// deformed binormals (resulting from application of morph targets)
|
||||
LLVector3 *mScaledBinormals;
|
||||
LLVector4a *mScaledBinormals;
|
||||
// output binormals (after normalization)
|
||||
LLVector3 *mBinormals;
|
||||
LLVector4a *mBinormals;
|
||||
// weight values that mark verts as clothing/skin
|
||||
LLVector4 *mClothingWeights;
|
||||
LLVector4a *mClothingWeights;
|
||||
// output texture coordinates
|
||||
LLVector2 *mTexCoords;
|
||||
|
||||
@@ -441,17 +441,17 @@ public:
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
/*virtual*/ F32 getTotalDistortion() { return 0.1f; }
|
||||
/*virtual*/ const LLVector3& getAvgDistortion() { return mDefaultVec; }
|
||||
/*virtual*/ const LLVector4a& getAvgDistortion() { return mDefaultVec; }
|
||||
/*virtual*/ F32 getMaxDistortion() { return 0.1f; }
|
||||
/*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh){return LLVector3(0.001f, 0.001f, 0.001f);}
|
||||
/*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return &mDefaultVec;};
|
||||
/*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
|
||||
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh){return LLVector4a(0.001f, 0.001f, 0.001f);}
|
||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return &mDefaultVec;};
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
|
||||
|
||||
protected:
|
||||
typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
|
||||
joint_vec_map_t mJointScales;
|
||||
joint_vec_map_t mJointOffsets;
|
||||
LLVector3 mDefaultVec;
|
||||
LLVector4a mDefaultVec;
|
||||
// Backlink only; don't make this an LLPointer.
|
||||
LLVOAvatar *mAvatar;
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ LLPolyMorphData::LLPolyMorphData(const std::string& morph_name)
|
||||
mNumIndices = 0;
|
||||
mCurrentIndex = 0;
|
||||
mTotalDistortion = 0.f;
|
||||
mAvgDistortion.zeroVec();
|
||||
mAvgDistortion.clear();
|
||||
mMaxDistortion = 0.f;
|
||||
mVertexIndices = NULL;
|
||||
mCoords = NULL;
|
||||
@@ -74,9 +74,9 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) :
|
||||
{
|
||||
const S32 numVertices = mNumIndices;
|
||||
|
||||
mCoords = new LLVector3[numVertices];
|
||||
mNormals = new LLVector3[numVertices];
|
||||
mBinormals = new LLVector3[numVertices];
|
||||
mCoords = new LLVector4a[numVertices];
|
||||
mNormals = new LLVector4a[numVertices];
|
||||
mBinormals = new LLVector4a[numVertices];
|
||||
mTexCoords = new LLVector2[numVertices];
|
||||
mVertexIndices = new U32[numVertices];
|
||||
|
||||
@@ -90,6 +90,7 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) :
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ~LLPolyMorphData()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -121,16 +122,16 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
//-------------------------------------------------------------------------
|
||||
// allocate vertices
|
||||
//-------------------------------------------------------------------------
|
||||
mCoords = new LLVector3[numVertices];
|
||||
mNormals = new LLVector3[numVertices];
|
||||
mBinormals = new LLVector3[numVertices];
|
||||
mCoords = new LLVector4a[numVertices];
|
||||
mNormals = new LLVector4a[numVertices];
|
||||
mBinormals = new LLVector4a[numVertices];
|
||||
mTexCoords = new LLVector2[numVertices];
|
||||
// Actually, we are allocating more space than we need for the skiplist
|
||||
mVertexIndices = new U32[numVertices];
|
||||
mNumIndices = 0;
|
||||
mTotalDistortion = 0.f;
|
||||
mMaxDistortion = 0.f;
|
||||
mAvgDistortion.zeroVec();
|
||||
mAvgDistortion.clear();
|
||||
mMesh = mesh;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -152,36 +153,36 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
}
|
||||
|
||||
|
||||
numRead = fread(&mCoords[v].mV, sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mCoords[v].mV, sizeof(F32), 3);
|
||||
numRead = fread(&mCoords[v], sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mCoords[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target vertex coordinates" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
F32 magnitude = mCoords[v].magVec();
|
||||
F32 magnitude = mCoords[v].getLength3().getF32();
|
||||
|
||||
mTotalDistortion += magnitude;
|
||||
mAvgDistortion.mV[VX] += fabs(mCoords[v].mV[VX]);
|
||||
mAvgDistortion.mV[VY] += fabs(mCoords[v].mV[VY]);
|
||||
mAvgDistortion.mV[VZ] += fabs(mCoords[v].mV[VZ]);
|
||||
LLVector4a t;
|
||||
t.setAbs(mCoords[v]);
|
||||
mAvgDistortion.add(t);
|
||||
|
||||
if (magnitude > mMaxDistortion)
|
||||
{
|
||||
mMaxDistortion = magnitude;
|
||||
}
|
||||
|
||||
numRead = fread(&mNormals[v].mV, sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mNormals[v].mV, sizeof(F32), 3);
|
||||
numRead = fread(&mNormals[v], sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mNormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target normal" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
numRead = fread(&mBinormals[v].mV, sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mBinormals[v].mV, sizeof(F32), 3);
|
||||
numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
|
||||
llendianswizzle(&mBinormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
llwarns << "Can't read morph target binormal" << llendl;
|
||||
@@ -200,8 +201,8 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
mNumIndices++;
|
||||
}
|
||||
|
||||
mAvgDistortion = mAvgDistortion * (1.f/(F32)mNumIndices);
|
||||
mAvgDistortion.normVec();
|
||||
mAvgDistortion.mul(1.f/(F32)mNumIndices);
|
||||
mAvgDistortion.normalize3fast();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -235,26 +236,26 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp)
|
||||
}
|
||||
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
|
||||
|
||||
llendianswizzle(&mCoords[v].mV, sizeof(F32), 3);
|
||||
if (fwrite(&mCoords[v].mV, sizeof(F32), 3, fp) != 3)
|
||||
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mCoords[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&mCoords[v].mV, sizeof(F32), 3);
|
||||
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(&mNormals[v].mV, sizeof(F32), 3);
|
||||
if (fwrite(&mNormals[v].mV, sizeof(F32), 3, fp) != 3)
|
||||
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mNormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&mNormals[v].mV, sizeof(F32), 3);
|
||||
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(&mBinormals[v].mV, sizeof(F32), 3);
|
||||
if (fwrite(&mBinormals[v].mV, sizeof(F32), 3, fp) != 3)
|
||||
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mBinormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&mBinormals[v].mV, sizeof(F32), 3);
|
||||
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
|
||||
if (fwrite(&mTexCoords[v].mV, sizeof(F32), 2, fp) != 2)
|
||||
@@ -277,17 +278,17 @@ BOOL LLPolyMorphData::saveOBJ(LLFILE *fp)
|
||||
|
||||
LLPolyMesh mesh(mMesh, NULL);
|
||||
|
||||
LLVector4 *coords = mesh.getWritableCoords();
|
||||
LLVector4 *normals = mesh.getWritableNormals();
|
||||
LLVector4a *coords = mesh.getWritableCoords();
|
||||
LLVector4a *normals = mesh.getWritableNormals();
|
||||
LLVector2 *tex_coords = mesh.getWritableTexCoords();
|
||||
|
||||
for(U32 vert_index_morph = 0; vert_index_morph < mNumIndices; vert_index_morph++)
|
||||
{
|
||||
S32 vert_index_mesh = mVertexIndices[vert_index_morph];
|
||||
|
||||
coords[vert_index_mesh] += LLVector4(mCoords[vert_index_morph]);
|
||||
normals[vert_index_mesh] += LLVector4(mNormals[vert_index_morph]);
|
||||
normals[vert_index_mesh].normVec();
|
||||
coords[vert_index_mesh].add(mCoords[vert_index_morph]);
|
||||
normals[vert_index_mesh].add(mNormals[vert_index_morph]);
|
||||
normals[vert_index_mesh].normalize3();
|
||||
tex_coords[vert_index_mesh] += mTexCoords[vert_index_morph];
|
||||
}
|
||||
|
||||
@@ -302,9 +303,9 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
if (!morph)
|
||||
return FALSE;
|
||||
|
||||
LLVector4 *morph_coords = morph->getWritableCoords();
|
||||
LLVector4 *morph_normals = morph->getWritableNormals();
|
||||
LLVector3 *morph_binormals = morph->getWritableBinormals();
|
||||
LLVector4a *morph_coords = morph->getWritableCoords();
|
||||
LLVector4a *morph_normals = morph->getWritableNormals();
|
||||
LLVector4a *morph_binormals = morph->getWritableBinormals();
|
||||
LLVector2 *morph_tex_coords = morph->getWritableTexCoords();
|
||||
|
||||
// We now have the morph loaded as a mesh. We have to subtract the
|
||||
@@ -313,19 +314,19 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
LLPolyMesh delta(mMesh, NULL);
|
||||
U32 nverts = delta.getNumVertices();
|
||||
|
||||
LLVector4 *delta_coords = delta.getWritableCoords();
|
||||
LLVector4 *delta_normals = delta.getWritableNormals();
|
||||
LLVector3 *delta_binormals = delta.getWritableBinormals();
|
||||
LLVector4a *delta_coords = delta.getWritableCoords();
|
||||
LLVector4a *delta_normals = delta.getWritableNormals();
|
||||
LLVector4a *delta_binormals = delta.getWritableBinormals();
|
||||
LLVector2 *delta_tex_coords = delta.getWritableTexCoords();
|
||||
|
||||
U32 num_significant = 0;
|
||||
U32 vert_index;
|
||||
for( vert_index = 0; vert_index < nverts; vert_index++)
|
||||
{
|
||||
delta_coords[vert_index] = morph_coords[vert_index] - delta_coords[vert_index];
|
||||
delta_normals[vert_index] = morph_normals[vert_index] - delta_normals[vert_index];
|
||||
delta_binormals[vert_index] = morph_binormals[vert_index] - delta_binormals[vert_index];
|
||||
delta_tex_coords[vert_index] = morph_tex_coords[vert_index] - delta_tex_coords[vert_index];
|
||||
delta_coords[vert_index].setSub( morph_coords[vert_index], delta_coords[vert_index]);
|
||||
delta_normals[vert_index].setSub( morph_normals[vert_index], delta_normals[vert_index]);
|
||||
delta_binormals[vert_index].setSub( morph_binormals[vert_index], delta_binormals[vert_index]);
|
||||
delta_tex_coords[vert_index] = morph_tex_coords[vert_index] - delta_tex_coords[vert_index];
|
||||
|
||||
// For the normals and binormals, we really want the deltas
|
||||
// to be perpendicular to the mesh (bi)normals in the plane
|
||||
@@ -333,10 +334,10 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
// that the morph (bi)normals form the hypotenuses of right
|
||||
// triangles. Right now, we just compute the difference vector.
|
||||
|
||||
if (delta_coords[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_normals[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_binormals[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_tex_coords[vert_index].length() > SIGNIFICANT_DELTA)
|
||||
if (delta_coords[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_normals[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_binormals[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_tex_coords[vert_index].length() > SIGNIFICANT_DELTA)
|
||||
{
|
||||
num_significant++;
|
||||
}
|
||||
@@ -353,39 +354,39 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
if (num_significant == 0)
|
||||
nindices = 1;
|
||||
|
||||
LLVector3* new_coords = new LLVector3[nindices];
|
||||
LLVector3* new_normals = new LLVector3[nindices];
|
||||
LLVector3* new_binormals = new LLVector3[nindices];
|
||||
LLVector4a* new_coords = new LLVector4a[nindices];
|
||||
LLVector4a* new_normals = new LLVector4a[nindices];
|
||||
LLVector4a* new_binormals = new LLVector4a[nindices];
|
||||
LLVector2* new_tex_coords = new LLVector2[nindices];
|
||||
U32* new_vertex_indices = new U32[nindices];
|
||||
|
||||
// We'll set the distortion directly
|
||||
mTotalDistortion = 0.f;
|
||||
mMaxDistortion = 0.f;
|
||||
mAvgDistortion.zeroVec();
|
||||
mAvgDistortion.clear();
|
||||
|
||||
U32 morph_index = 0;
|
||||
for( vert_index = 0; vert_index < nverts; vert_index++)
|
||||
{
|
||||
if (delta_coords[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_normals[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_binormals[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| delta_tex_coords[vert_index].length() > SIGNIFICANT_DELTA
|
||||
if (delta_coords[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_normals[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_binormals[vert_index].getLength3().getF32() > SIGNIFICANT_DELTA
|
||||
|| delta_tex_coords[vert_index].length() > SIGNIFICANT_DELTA
|
||||
|| num_significant == 0)
|
||||
{
|
||||
new_vertex_indices[morph_index] = vert_index;
|
||||
|
||||
new_coords[morph_index] = LLVector3(delta_coords[vert_index]);
|
||||
new_normals[morph_index] = LLVector3(delta_normals[vert_index]);
|
||||
new_coords[morph_index] = delta_coords[vert_index];
|
||||
new_normals[morph_index] = delta_normals[vert_index];
|
||||
new_binormals[morph_index] = delta_binormals[vert_index];
|
||||
new_tex_coords[morph_index] = delta_tex_coords[vert_index];
|
||||
|
||||
F32 magnitude = new_coords[morph_index].magVec();
|
||||
F32 magnitude = new_coords[morph_index].getLength3().getF32();
|
||||
|
||||
mTotalDistortion += magnitude;
|
||||
mAvgDistortion.mV[VX] += fabs(new_coords[morph_index].mV[VX]);
|
||||
mAvgDistortion.mV[VY] += fabs(new_coords[morph_index].mV[VY]);
|
||||
mAvgDistortion.mV[VZ] += fabs(new_coords[morph_index].mV[VZ]);
|
||||
LLVector4a t;
|
||||
t.setAbs(new_coords[morph_index]);
|
||||
mAvgDistortion.add(t);
|
||||
|
||||
if (magnitude > mMaxDistortion)
|
||||
{
|
||||
@@ -397,8 +398,8 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
}
|
||||
}
|
||||
|
||||
mAvgDistortion = mAvgDistortion * (1.f/(F32)nindices);
|
||||
mAvgDistortion.normVec();
|
||||
mAvgDistortion.mul(1.f/(F32)nindices);
|
||||
mAvgDistortion.normalize3();
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// compute the change in the morph
|
||||
@@ -412,9 +413,9 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
{
|
||||
vert_index = mVertexIndices[morph_index];
|
||||
|
||||
delta_coords[vert_index] -= LLVector4(mCoords[morph_index]);
|
||||
delta_normals[vert_index] -= LLVector4(mNormals[morph_index]);
|
||||
delta_binormals[vert_index] -= mBinormals[morph_index];
|
||||
delta_coords[vert_index].sub( mCoords[morph_index]);
|
||||
delta_normals[vert_index].sub( mNormals[morph_index]);
|
||||
delta_binormals[vert_index].sub(mBinormals[morph_index]);
|
||||
delta_tex_coords[vert_index] -= mTexCoords[morph_index];
|
||||
}
|
||||
|
||||
@@ -451,27 +452,35 @@ BOOL LLPolyMorphData::setMorphFromMesh(LLPolyMesh *morph)
|
||||
continue;
|
||||
}*/
|
||||
|
||||
LLVector4 *mesh_coords = mesh->getWritableCoords();
|
||||
LLVector4 *mesh_normals = mesh->getWritableNormals();
|
||||
LLVector3 *mesh_binormals = mesh->getWritableBinormals();
|
||||
LLVector2 *mesh_tex_coords = mesh->getWritableTexCoords();
|
||||
LLVector3 *mesh_scaled_normals = mesh->getScaledNormals();
|
||||
LLVector3 *mesh_scaled_binormals = mesh->getScaledBinormals();
|
||||
LLVector4a *mesh_coords = mesh->getWritableCoords();
|
||||
LLVector4a *mesh_normals = mesh->getWritableNormals();
|
||||
LLVector4a *mesh_binormals = mesh->getWritableBinormals();
|
||||
LLVector2 *mesh_tex_coords = mesh->getWritableTexCoords();
|
||||
LLVector4a *mesh_scaled_normals = mesh->getScaledNormals();
|
||||
LLVector4a *mesh_scaled_binormals = mesh->getScaledBinormals();
|
||||
|
||||
for( vert_index = 0; vert_index < nverts; vert_index++)
|
||||
{
|
||||
mesh_coords[vert_index] += delta_coords[vert_index] * weight;
|
||||
delta_coords[vert_index].mul(weight);
|
||||
mesh_coords[vert_index].add(delta_coords[vert_index]);
|
||||
|
||||
mesh_tex_coords[vert_index] += delta_tex_coords[vert_index] * weight;
|
||||
|
||||
mesh_scaled_normals[vert_index] += LLVector3(delta_normals[vert_index] * weight * NORMAL_SOFTEN_FACTOR);
|
||||
LLVector3 normalized_normal = mesh_scaled_normals[vert_index];
|
||||
normalized_normal.normVec();
|
||||
mesh_normals[vert_index] = LLVector4(normalized_normal);
|
||||
delta_normals[vert_index].mul(weight * NORMAL_SOFTEN_FACTOR);
|
||||
mesh_scaled_normals[vert_index].add(delta_normals[vert_index]);
|
||||
|
||||
LLVector4a normalized_normal = mesh_scaled_normals[vert_index];
|
||||
normalized_normal.normalize3();
|
||||
mesh_normals[vert_index] = normalized_normal;
|
||||
|
||||
mesh_scaled_binormals[vert_index] += delta_binormals[vert_index] * weight * NORMAL_SOFTEN_FACTOR;
|
||||
LLVector3 tangent = mesh_scaled_binormals[vert_index] % normalized_normal;
|
||||
LLVector3 normalized_binormal = normalized_normal % tangent;
|
||||
normalized_binormal.normVec();
|
||||
delta_binormals[vert_index].mul(weight * NORMAL_SOFTEN_FACTOR);
|
||||
mesh_scaled_binormals[vert_index].add(delta_binormals[vert_index]);
|
||||
|
||||
LLVector4a tangent;
|
||||
tangent.setCross3(mesh_scaled_binormals[vert_index], normalized_normal);
|
||||
LLVector4a normalized_binormal;
|
||||
normalized_binormal.setCross3(normalized_normal, tangent);
|
||||
normalized_binormal.normalize3();
|
||||
mesh_binormals[vert_index] = normalized_binormal;
|
||||
}
|
||||
|
||||
@@ -658,9 +667,9 @@ BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
||||
//-----------------------------------------------------------------------------
|
||||
// getVertexDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh *mesh)
|
||||
LLVector4a LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh *mesh)
|
||||
{
|
||||
if (!mMorphData || mMesh != mesh) return LLVector3::zero;
|
||||
if (!mMorphData || mMesh != mesh) return LLVector4a::getZero();
|
||||
|
||||
for(U32 index = 0; index < mMorphData->mNumIndices; index++)
|
||||
{
|
||||
@@ -670,17 +679,17 @@ LLVector3 LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh
|
||||
}
|
||||
}
|
||||
|
||||
return LLVector3::zero;
|
||||
return LLVector4a::getZero();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getFirstDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
const LLVector3 *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
if (!mMorphData) return &LLVector3::zero;
|
||||
if (!mMorphData) return &LLVector4a::getZero();
|
||||
|
||||
LLVector3* resultVec;
|
||||
LLVector4a* resultVec;
|
||||
mMorphData->mCurrentIndex = 0;
|
||||
if (mMorphData->mNumIndices)
|
||||
{
|
||||
@@ -702,11 +711,11 @@ const LLVector3 *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **
|
||||
//-----------------------------------------------------------------------------
|
||||
// getNextDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
const LLVector3 *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
if (!mMorphData) return &LLVector3::zero;
|
||||
if (!mMorphData) return &LLVector4a::getZero();
|
||||
|
||||
LLVector3* resultVec;
|
||||
LLVector4a* resultVec;
|
||||
mMorphData->mCurrentIndex++;
|
||||
if (mMorphData->mCurrentIndex < mMorphData->mNumIndices)
|
||||
{
|
||||
@@ -742,7 +751,7 @@ F32 LLPolyMorphTarget::getTotalDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
// getAvgDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
const LLVector3& LLPolyMorphTarget::getAvgDistortion()
|
||||
const LLVector4a& LLPolyMorphTarget::getAvgDistortion()
|
||||
{
|
||||
if (mMorphData)
|
||||
{
|
||||
@@ -750,7 +759,7 @@ const LLVector3& LLPolyMorphTarget::getAvgDistortion()
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLVector3::zero;
|
||||
return LLVector4a::getZero();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,15 +808,15 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
if (delta_weight != 0.f)
|
||||
{
|
||||
llassert(!mMesh->isLOD());
|
||||
LLVector4 *coords = mMesh->getWritableCoords();
|
||||
LLVector4a *coords = mMesh->getWritableCoords();
|
||||
|
||||
LLVector3 *scaled_normals = mMesh->getScaledNormals();
|
||||
LLVector4 *normals = mMesh->getWritableNormals();
|
||||
LLVector4a *scaled_normals = mMesh->getScaledNormals();
|
||||
LLVector4a *normals = mMesh->getWritableNormals();
|
||||
|
||||
LLVector3 *scaled_binormals = mMesh->getScaledBinormals();
|
||||
LLVector3 *binormals = mMesh->getWritableBinormals();
|
||||
LLVector4a *scaled_binormals = mMesh->getScaledBinormals();
|
||||
LLVector4a *binormals = mMesh->getWritableBinormals();
|
||||
|
||||
LLVector4 *clothing_weights = mMesh->getWritableClothingWeights();
|
||||
LLVector4a *clothing_weights = mMesh->getWritableClothingWeights();
|
||||
LLVector2 *tex_coords = mMesh->getWritableTexCoords();
|
||||
|
||||
F32 *maskWeightArray = (mVertMask) ? mVertMask->getMorphMaskWeights() : NULL;
|
||||
@@ -822,31 +831,38 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
maskWeight = maskWeightArray[vert_index_morph];
|
||||
}
|
||||
|
||||
coords[vert_index_mesh] += LLVector4(mMorphData->mCoords[vert_index_morph] * delta_weight * maskWeight);
|
||||
|
||||
LLVector4a pos = mMorphData->mCoords[vert_index_morph];
|
||||
pos.mul(delta_weight*maskWeight);
|
||||
coords[vert_index_mesh].add(pos);
|
||||
|
||||
if (getInfo()->mIsClothingMorph && clothing_weights)
|
||||
{
|
||||
LLVector3 clothing_offset = mMorphData->mCoords[vert_index_morph] * delta_weight * maskWeight;
|
||||
LLVector4* clothing_weight = &clothing_weights[vert_index_mesh];
|
||||
clothing_weight->mV[VX] += clothing_offset.mV[VX];
|
||||
clothing_weight->mV[VY] += clothing_offset.mV[VY];
|
||||
clothing_weight->mV[VZ] += clothing_offset.mV[VZ];
|
||||
clothing_weight->mV[VW] = maskWeight;
|
||||
LLVector4a clothing_offset = mMorphData->mCoords[vert_index_morph];
|
||||
clothing_offset.mul(delta_weight * maskWeight);
|
||||
LLVector4a* clothing_weight = &clothing_weights[vert_index_mesh];
|
||||
clothing_weight->add(clothing_offset);
|
||||
clothing_weight->getF32ptr()[VW] = maskWeight;
|
||||
}
|
||||
|
||||
// calculate new normals based on half angles
|
||||
scaled_normals[vert_index_mesh] += mMorphData->mNormals[vert_index_morph] * delta_weight * maskWeight * NORMAL_SOFTEN_FACTOR;
|
||||
LLVector3 normalized_normal = scaled_normals[vert_index_mesh];
|
||||
normalized_normal.normVec();
|
||||
normals[vert_index_mesh] = LLVector4(normalized_normal);
|
||||
LLVector4a norm = mMorphData->mNormals[vert_index_morph];
|
||||
norm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
||||
scaled_normals[vert_index_mesh].add(norm);
|
||||
norm = scaled_normals[vert_index_mesh];
|
||||
norm.normalize3fast();
|
||||
normals[vert_index_mesh] = norm;
|
||||
|
||||
// calculate new binormals
|
||||
scaled_binormals[vert_index_mesh] += mMorphData->mBinormals[vert_index_morph] * delta_weight * maskWeight * NORMAL_SOFTEN_FACTOR;
|
||||
LLVector3 tangent = scaled_binormals[vert_index_mesh] % normalized_normal;
|
||||
LLVector3 normalized_binormal = normalized_normal % tangent;
|
||||
normalized_binormal.normVec();
|
||||
binormals[vert_index_mesh] = normalized_binormal;
|
||||
|
||||
LLVector4a binorm = mMorphData->mBinormals[vert_index_morph];
|
||||
binorm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
||||
scaled_binormals[vert_index_mesh].add(binorm);
|
||||
LLVector4a tangent;
|
||||
tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
|
||||
LLVector4a& normalized_binormal = binormals[vert_index_mesh];
|
||||
normalized_binormal.setCross3(norm, tangent);
|
||||
normalized_binormal.normalize3fast();
|
||||
|
||||
tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
|
||||
}
|
||||
|
||||
@@ -873,7 +889,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert)
|
||||
{
|
||||
LLVector4 *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
|
||||
LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
|
||||
|
||||
if (!mVertMask)
|
||||
{
|
||||
@@ -887,29 +903,47 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
|
||||
|
||||
if (maskWeights)
|
||||
{
|
||||
LLVector4 *coords = mMesh->getWritableCoords();
|
||||
LLVector3 *scaled_normals = mMesh->getScaledNormals();
|
||||
LLVector3 *scaled_binormals = mMesh->getScaledBinormals();
|
||||
LLVector4a *coords = mMesh->getWritableCoords();
|
||||
LLVector4a *scaled_normals = mMesh->getScaledNormals();
|
||||
LLVector4a *scaled_binormals = mMesh->getScaledBinormals();
|
||||
LLVector2 *tex_coords = mMesh->getWritableTexCoords();
|
||||
|
||||
LLVector4Logical clothing_mask;
|
||||
clothing_mask.clear();
|
||||
clothing_mask.setElement<0>();
|
||||
clothing_mask.setElement<1>();
|
||||
clothing_mask.setElement<2>();
|
||||
|
||||
|
||||
for(U32 vert = 0; vert < mMorphData->mNumIndices; vert++)
|
||||
{
|
||||
F32 lastMaskWeight = mLastWeight * maskWeights[vert];
|
||||
S32 out_vert = mMorphData->mVertexIndices[vert];
|
||||
|
||||
// remove effect of existing masked morph
|
||||
coords[out_vert] -= LLVector4(mMorphData->mCoords[vert]) * lastMaskWeight;
|
||||
scaled_normals[out_vert] -= mMorphData->mNormals[vert] * lastMaskWeight * NORMAL_SOFTEN_FACTOR;
|
||||
scaled_binormals[out_vert] -= mMorphData->mBinormals[vert] * lastMaskWeight * NORMAL_SOFTEN_FACTOR;
|
||||
LLVector4a t;
|
||||
t = mMorphData->mCoords[vert];
|
||||
t.mul(lastMaskWeight);
|
||||
coords[out_vert].sub(t);
|
||||
|
||||
t = mMorphData->mNormals[vert];
|
||||
t.mul(lastMaskWeight*NORMAL_SOFTEN_FACTOR);
|
||||
scaled_normals[out_vert].sub(t);
|
||||
|
||||
t = mMorphData->mBinormals[vert];
|
||||
t.mul(lastMaskWeight*NORMAL_SOFTEN_FACTOR);
|
||||
scaled_binormals[out_vert].sub(t);
|
||||
|
||||
tex_coords[out_vert] -= mMorphData->mTexCoords[vert] * lastMaskWeight;
|
||||
|
||||
if (clothing_weights)
|
||||
{
|
||||
LLVector3 clothing_offset = mMorphData->mCoords[vert] * lastMaskWeight;
|
||||
LLVector4* clothing_weight = &clothing_weights[out_vert];
|
||||
clothing_weight->mV[VX] -= clothing_offset.mV[VX];
|
||||
clothing_weight->mV[VY] -= clothing_offset.mV[VY];
|
||||
clothing_weight->mV[VZ] -= clothing_offset.mV[VZ];
|
||||
LLVector4a clothing_offset = mMorphData->mCoords[vert];
|
||||
clothing_offset.mul(lastMaskWeight);
|
||||
LLVector4a* clothing_weight = &clothing_weights[out_vert];
|
||||
LLVector4a t;
|
||||
t.setSub(*clothing_weight, clothing_offset);
|
||||
clothing_weight->setSelectWithMask(clothing_mask, t, *clothing_weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -945,7 +979,7 @@ LLPolyVertexMask::~LLPolyVertexMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
// generateMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4 *clothing_weights)
|
||||
void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights)
|
||||
{
|
||||
// RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
|
||||
// BOOL debugImg = FALSE;
|
||||
@@ -989,7 +1023,7 @@ void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height,
|
||||
|
||||
if (clothing_weights)
|
||||
{
|
||||
clothing_weights[vertIndex].mV[VW] = mWeights[index];
|
||||
clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
|
||||
}
|
||||
}
|
||||
mWeightsGenerated = TRUE;
|
||||
|
||||
@@ -68,14 +68,14 @@ public:
|
||||
U32 mNumIndices;
|
||||
U32* mVertexIndices;
|
||||
U32 mCurrentIndex;
|
||||
LLVector3* mCoords;
|
||||
LLVector3* mNormals;
|
||||
LLVector3* mBinormals;
|
||||
LLVector4a* mCoords;
|
||||
LLVector4a* mNormals;
|
||||
LLVector4a* mBinormals;
|
||||
LLVector2* mTexCoords;
|
||||
|
||||
F32 mTotalDistortion; // vertex distortion summed over entire morph
|
||||
F32 mMaxDistortion; // maximum single vertex distortion in a given morph
|
||||
LLVector3 mAvgDistortion; // average vertex distortion, to infer directionality of the morph
|
||||
LLVector4a mAvgDistortion; // average vertex distortion, to infer directionality of the morph
|
||||
LLPolyMeshSharedData* mMesh;
|
||||
};
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
LLPolyVertexMask(LLPolyMorphData* morph_data);
|
||||
~LLPolyVertexMask();
|
||||
|
||||
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4 *clothing_weights);
|
||||
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
|
||||
F32* getMorphMaskWeights();
|
||||
|
||||
|
||||
@@ -167,11 +167,11 @@ public:
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
/*virtual*/ F32 getTotalDistortion();
|
||||
/*virtual*/ const LLVector3& getAvgDistortion();
|
||||
/*virtual*/ const LLVector4a& getAvgDistortion();
|
||||
/*virtual*/ F32 getMaxDistortion();
|
||||
/*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
|
||||
/*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
|
||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
|
||||
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
|
||||
void addPendingMorphMask() { mNumMorphMasksPending++; }
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llselectmgr.cpp
|
||||
* @brief A manager for selected objects and faces.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -281,7 +275,7 @@ void LLSelectMgr::overrideObjectUpdates()
|
||||
virtual bool apply(LLSelectNode* selectNode)
|
||||
{
|
||||
LLViewerObject* object = selectNode->getObject();
|
||||
if (object && object->permMove())
|
||||
if (object && object->permMove() && !object->isPermanentEnforced())
|
||||
{
|
||||
if (!selectNode->mLastPositionLocal.isExactlyZero())
|
||||
{
|
||||
@@ -600,6 +594,12 @@ bool LLSelectMgr::linkObjects()
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
|
||||
{
|
||||
LLNotificationsUtil::add("CannotLinkPermanent");
|
||||
return true;
|
||||
}
|
||||
|
||||
LLUUID owner_id;
|
||||
std::string owner_name;
|
||||
if (!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name))
|
||||
@@ -645,7 +645,9 @@ bool LLSelectMgr::enableLinkObjects()
|
||||
{
|
||||
virtual bool apply(LLViewerObject* object)
|
||||
{
|
||||
return object->permModify();
|
||||
LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
return object->permModify() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced());
|
||||
}
|
||||
} func;
|
||||
const bool firstonly = true;
|
||||
@@ -668,10 +670,12 @@ bool LLSelectMgr::enableLinkObjects()
|
||||
bool LLSelectMgr::enableUnlinkObjects()
|
||||
{
|
||||
LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
|
||||
LLViewerObject *root_object = (first_editable_object == NULL) ? NULL : first_editable_object->getRootEdit();
|
||||
|
||||
bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
|
||||
first_editable_object &&
|
||||
!first_editable_object->isAttachment();
|
||||
!first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced());
|
||||
// [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g
|
||||
if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) )
|
||||
{
|
||||
@@ -981,7 +985,7 @@ void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp)
|
||||
}
|
||||
|
||||
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !objectp->permYouOwner())
|
||||
|| (gSavedSettings.getBOOL("SelectMovableOnly") && !objectp->permMove()))
|
||||
|| (gSavedSettings.getBOOL("SelectMovableOnly") && (!objectp->permMove() || objectp->isPermanentEnforced())))
|
||||
{
|
||||
// only select my own objects
|
||||
return;
|
||||
@@ -2292,50 +2296,6 @@ void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *)
|
||||
gMessageSystem->addString("Parameter", buf);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Rotation options
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLSelectMgr::selectionResetRotation()
|
||||
{
|
||||
struct f : public LLSelectedObjectFunctor
|
||||
{
|
||||
virtual bool apply(LLViewerObject* object)
|
||||
{
|
||||
LLQuaternion identity(0.f, 0.f, 0.f, 1.f);
|
||||
object->setRotation(identity);
|
||||
if (object->mDrawable.notNull())
|
||||
{
|
||||
gPipeline.markMoved(object->mDrawable, TRUE);
|
||||
}
|
||||
object->sendRotationUpdate();
|
||||
return true;
|
||||
}
|
||||
} func;
|
||||
getSelection()->applyToRootObjects(&func);
|
||||
}
|
||||
|
||||
void LLSelectMgr::selectionRotateAroundZ(F32 degrees)
|
||||
{
|
||||
LLQuaternion rot( degrees * DEG_TO_RAD, LLVector3(0,0,1) );
|
||||
struct f : public LLSelectedObjectFunctor
|
||||
{
|
||||
LLQuaternion mRot;
|
||||
f(const LLQuaternion& rot) : mRot(rot) {}
|
||||
virtual bool apply(LLViewerObject* object)
|
||||
{
|
||||
object->setRotation( object->getRotationEdit() * mRot );
|
||||
if (object->mDrawable.notNull())
|
||||
{
|
||||
gPipeline.markMoved(object->mDrawable, TRUE);
|
||||
}
|
||||
object->sendRotationUpdate();
|
||||
return true;
|
||||
}
|
||||
} func(rot);
|
||||
getSelection()->applyToRootObjects(&func);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectionTexScaleAutofit()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -2549,6 +2509,341 @@ BOOL LLSelectMgr::selectGetRootsModify()
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetNonPermanentEnforced() - return TRUE if all objects are not
|
||||
// permanent enforced
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetNonPermanentEnforced()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->isPermanentEnforced())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsNonPermanentEnforced() - return TRUE if all root objects are
|
||||
// not permanent enforced
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->isPermanentEnforced())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetPermanent() - return TRUE if all objects are permanent
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetPermanent()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( !object->flagObjectPermanent())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsPermanent() - return TRUE if all root objects are
|
||||
// permanent
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsPermanent()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( !object->flagObjectPermanent())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetCharacter() - return TRUE if all objects are character
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetCharacter()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( !object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsCharacter() - return TRUE if all root objects are
|
||||
// character
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsCharacter()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( !object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetNonPathfinding() - return TRUE if all objects are not pathfinding
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetNonPathfinding()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagObjectPermanent() || object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsNonPathfinding() - return TRUE if all root objects are not
|
||||
// pathfinding
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsNonPathfinding()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagObjectPermanent() || object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetNonPermanent() - return TRUE if all objects are not permanent
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetNonPermanent()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagObjectPermanent())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsNonPermanent() - return TRUE if all root objects are not
|
||||
// permanent
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsNonPermanent()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagObjectPermanent())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetNonCharacter() - return TRUE if all objects are not character
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetNonCharacter()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsNonCharacter() - return TRUE if all root objects are not
|
||||
// character
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetRootsNonCharacter()
|
||||
{
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( object->flagCharacter())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetEditableLinksets() - return TRUE if all objects are editable
|
||||
// pathfinding linksets
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetEditableLinksets()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (object->flagUsePhysics() ||
|
||||
object->flagTemporaryOnRez() ||
|
||||
object->flagCharacter() ||
|
||||
object->flagVolumeDetect() ||
|
||||
object->flagAnimSource() ||
|
||||
(object->getRegion() != gAgent.getRegion()) ||
|
||||
(!gAgent.isGodlike() &&
|
||||
!gAgent.canManageEstate() &&
|
||||
!object->permYouOwner() &&
|
||||
!object->permMove()))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetViewableCharacters() - return TRUE if all objects are characters
|
||||
// viewable within the pathfinding characters floater
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSelectMgr::selectGetViewableCharacters()
|
||||
{
|
||||
for (LLObjectSelection::iterator iter = getSelection()->begin();
|
||||
iter != getSelection()->end(); iter++ )
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLViewerObject* object = node->getObject();
|
||||
if( !object || !node->mValid )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if( !object->flagCharacter() ||
|
||||
(object->getRegion() != gAgent.getRegion()))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// selectGetRootsTransfer() - return TRUE if current agent can transfer all
|
||||
// selected root objects.
|
||||
@@ -4200,13 +4495,6 @@ void LLSelectMgr::selectionUpdatePhantom(BOOL is_phantom)
|
||||
getSelection()->applyToObjects(&func);
|
||||
}
|
||||
|
||||
void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows)
|
||||
{
|
||||
LLSelectMgrApplyFlags func( FLAGS_CAST_SHADOWS, cast_shadows);
|
||||
getSelection()->applyToObjects(&func);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Helpful packing functions for sendObjectMessage()
|
||||
//----------------------------------------------------------------------
|
||||
@@ -6284,7 +6572,7 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
|
||||
}
|
||||
|
||||
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) ||
|
||||
(gSavedSettings.getBOOL("SelectMovableOnly") && !object->permMove()))
|
||||
(gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced())))
|
||||
{
|
||||
// only select my own objects
|
||||
return FALSE;
|
||||
@@ -6978,7 +7266,7 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first)
|
||||
bool apply(LLSelectNode* node)
|
||||
{
|
||||
LLViewerObject* obj = node->getObject();
|
||||
return obj && obj->permMove();
|
||||
return obj && obj->permMove() && !obj->isPermanentEnforced();
|
||||
}
|
||||
} func;
|
||||
LLSelectNode* res = get_root_first ? getFirstRootNode(&func, TRUE) : getFirstNode(&func);
|
||||
@@ -7016,9 +7304,10 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject()
|
||||
LLViewerObject* obj = node->getObject();
|
||||
// you can delete an object if you are the owner
|
||||
// or you have permission to modify it.
|
||||
if( obj && ( (obj->permModify()) ||
|
||||
(obj->permYouOwner()) ||
|
||||
(!obj->permAnyOwner()) )) // public
|
||||
if( obj && !obj->isPermanentEnforced() &&
|
||||
( (obj->permModify()) ||
|
||||
(obj->permYouOwner()) ||
|
||||
(!obj->permAnyOwner()) )) // public
|
||||
{
|
||||
if( !obj->isAttachment() )
|
||||
{
|
||||
@@ -7058,7 +7347,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent)
|
||||
bool apply(LLSelectNode* node)
|
||||
{
|
||||
LLViewerObject* obj = node->getObject();
|
||||
return obj && obj->permMove();
|
||||
return obj && obj->permMove() && !obj->isPermanentEnforced();
|
||||
}
|
||||
} func;
|
||||
return getFirstSelectedObject(&func, get_parent);
|
||||
@@ -7127,7 +7416,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ,
|
||||
{
|
||||
obj = (*it)->getObject();
|
||||
bool enable_pos = false, enable_rot = false;
|
||||
bool perm_move = obj->permMove();
|
||||
bool perm_move = obj->permMove() && !obj->isPermanentEnforced();
|
||||
bool perm_mod = obj->permModify();
|
||||
|
||||
LLVector3d sel_center(getSelectionCenterGlobal());
|
||||
|
||||
@@ -505,7 +505,6 @@ public:
|
||||
void selectionUpdatePhysics(BOOL use_physics);
|
||||
void selectionUpdateTemporary(BOOL is_temporary);
|
||||
void selectionUpdatePhantom(BOOL is_ghost);
|
||||
void selectionUpdateCastShadows(BOOL cast_shadows);
|
||||
void selectionDump();
|
||||
|
||||
BOOL selectionAllPCode(LLPCode code); // all objects have this PCode
|
||||
@@ -543,8 +542,6 @@ public:
|
||||
void selectionTexScaleAutofit(F32 repeats_per_meter);
|
||||
void adjustTexturesByScale(BOOL send_to_sim, BOOL stretch);
|
||||
|
||||
void selectionResetRotation(); // sets rotation quat to identity
|
||||
void selectionRotateAroundZ(F32 degrees);
|
||||
bool selectionMove(const LLVector3& displ, F32 rx, F32 ry, F32 rz,
|
||||
U32 update_type);
|
||||
void sendSelectionMove();
|
||||
@@ -567,6 +564,33 @@ public:
|
||||
BOOL selectGetRootsModify();
|
||||
BOOL selectGetModify();
|
||||
|
||||
// returns TRUE if is all objects are non-permanent-enforced
|
||||
BOOL selectGetRootsNonPermanentEnforced();
|
||||
BOOL selectGetNonPermanentEnforced();
|
||||
|
||||
// returns TRUE if is all objects are permanent
|
||||
BOOL selectGetRootsPermanent();
|
||||
BOOL selectGetPermanent();
|
||||
|
||||
// returns TRUE if is all objects are character
|
||||
BOOL selectGetRootsCharacter();
|
||||
BOOL selectGetCharacter();
|
||||
|
||||
// returns TRUE if is all objects are not permanent
|
||||
BOOL selectGetRootsNonPathfinding();
|
||||
BOOL selectGetNonPathfinding();
|
||||
|
||||
// returns TRUE if is all objects are not permanent
|
||||
BOOL selectGetRootsNonPermanent();
|
||||
BOOL selectGetNonPermanent();
|
||||
|
||||
// returns TRUE if is all objects are not character
|
||||
BOOL selectGetRootsNonCharacter();
|
||||
BOOL selectGetNonCharacter();
|
||||
|
||||
BOOL selectGetEditableLinksets();
|
||||
BOOL selectGetViewableCharacters();
|
||||
|
||||
// returns TRUE if selected objects can be transferred.
|
||||
BOOL selectGetRootsTransfer();
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ void LLSpatialGroup::validate()
|
||||
|
||||
validateDrawMap();
|
||||
|
||||
for (element_iter i = getData().begin(); i != getData().end(); ++i)
|
||||
for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
sg_assert(drawable->getSpatialGroup() == this);
|
||||
@@ -640,7 +640,7 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
|
||||
{
|
||||
const OctreeNode* node = mOctreeNode;
|
||||
|
||||
if (node->getData().empty())
|
||||
if (node->isEmpty())
|
||||
{ //don't do anything if there are no objects
|
||||
if (empty && mOctreeNode->getParent())
|
||||
{ //only root is allowed to be empty
|
||||
@@ -657,14 +657,14 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
|
||||
clearState(OBJECT_DIRTY);
|
||||
|
||||
//initialize bounding box to first element
|
||||
OctreeNode::const_element_iter i = node->getData().begin();
|
||||
OctreeNode::const_element_iter i = node->getDataBegin();
|
||||
LLDrawable* drawablep = *i;
|
||||
const LLVector4a* minMax = drawablep->getSpatialExtents();
|
||||
|
||||
newMin = minMax[0];
|
||||
newMax = minMax[1];
|
||||
|
||||
for (++i; i != node->getData().end(); ++i)
|
||||
for (++i; i != node->getDataEnd(); ++i)
|
||||
{
|
||||
drawablep = *i;
|
||||
minMax = drawablep->getSpatialExtents();
|
||||
@@ -805,7 +805,7 @@ void LLSpatialGroup::shift(const LLVector4a &offset)
|
||||
mObjectExtents[0].add(offset);
|
||||
mObjectExtents[1].add(offset);
|
||||
|
||||
//if (!mSpatialPartition->mRenderByGroup)
|
||||
if (!mSpatialPartition->mRenderByGroup)
|
||||
{
|
||||
setState(GEOM_DIRTY);
|
||||
gPipeline.markRebuild(this, TRUE);
|
||||
@@ -1124,7 +1124,7 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
|
||||
llerrs << "Spatial group dirty on distance update." << llendl;
|
||||
}
|
||||
#endif
|
||||
if (!getData().empty() /*&& !LLSpatialPartition::sFreezeState*/)
|
||||
if (!isEmpty() /*&& !LLSpatialPartition::sFreezeState*/)
|
||||
{
|
||||
mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
|
||||
(F32) mOctreeNode->getSize().getLength3().getF32();
|
||||
@@ -1276,7 +1276,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
|
||||
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
|
||||
setState(DEAD);
|
||||
|
||||
for (element_iter i = getData().begin(); i != getData().end(); ++i)
|
||||
for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
if (drawable->getSpatialGroup() == this)
|
||||
@@ -1363,7 +1363,7 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion)
|
||||
}
|
||||
|
||||
|
||||
for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i)
|
||||
for (LLSpatialGroup::element_iter i = getDataBegin(); i != getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
for (S32 j = 0; j < drawable->getNumFaces(); j++)
|
||||
@@ -1720,12 +1720,14 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
|
||||
|
||||
drawablep->setSpatialGroup(NULL);
|
||||
|
||||
if (!curp->removeObject(drawablep))
|
||||
{
|
||||
OCT_ERRS << "Failed to remove drawable from octree!" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawablep->setSpatialGroup(NULL);
|
||||
}
|
||||
|
||||
assert_octree_valid(mOctree);
|
||||
|
||||
@@ -1996,7 +1998,7 @@ public:
|
||||
|
||||
virtual void processGroup(LLSpatialGroup* group)
|
||||
{
|
||||
llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->getData().empty())
|
||||
llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->isEmpty())
|
||||
|
||||
if (mRes < 2)
|
||||
{
|
||||
@@ -2063,7 +2065,7 @@ public:
|
||||
{
|
||||
LLSpatialGroup::OctreeNode* branch = group->mOctreeNode;
|
||||
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
|
||||
@@ -2187,7 +2189,7 @@ public:
|
||||
LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
|
||||
group->destroyGL();
|
||||
|
||||
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
|
||||
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup)
|
||||
@@ -2500,7 +2502,7 @@ void renderOctree(LLSpatialGroup* group)
|
||||
gGL.flush();
|
||||
glLineWidth(1.f);
|
||||
gGL.flush();
|
||||
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
|
||||
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
if (!group->mSpatialPartition->isBridge())
|
||||
@@ -2546,7 +2548,7 @@ void renderOctree(LLSpatialGroup* group)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty()
|
||||
if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->isEmpty()
|
||||
&& group->mSpatialPartition->mRenderByGroup)
|
||||
{
|
||||
col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
|
||||
@@ -2614,7 +2616,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
||||
BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
|
||||
!group->getData().empty();
|
||||
!group->isEmpty();
|
||||
|
||||
if (render_objects)
|
||||
{
|
||||
@@ -3356,7 +3358,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
|
||||
|
||||
void renderPhysicsShapes(LLSpatialGroup* group)
|
||||
{
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
LLVOVolume* volume = drawable->getVOVolume();
|
||||
@@ -3601,7 +3603,7 @@ public:
|
||||
|
||||
LLVector3 center, size;
|
||||
|
||||
if (branch->getData().empty())
|
||||
if (branch->isEmpty())
|
||||
{
|
||||
gGL.diffuseColor3f(1.f,0.2f,0.f);
|
||||
center.set(branch->getCenter().getF32ptr());
|
||||
@@ -3637,8 +3639,8 @@ public:
|
||||
}
|
||||
|
||||
gGL.begin(LLRender::TRIANGLES);
|
||||
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin();
|
||||
iter != branch->getData().end();
|
||||
for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getDataBegin();
|
||||
iter != branch->getDataEnd();
|
||||
++iter)
|
||||
{
|
||||
const LLVolumeTriangle* tri = *iter;
|
||||
@@ -3875,7 +3877,7 @@ public:
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
|
||||
{
|
||||
if (!group->getData().empty())
|
||||
if (!group->isEmpty())
|
||||
{
|
||||
gGL.diffuseColor3f(0,0,1);
|
||||
drawBoxOutline(group->mObjectBounds[0],
|
||||
@@ -3883,7 +3885,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
|
||||
@@ -4068,7 +4070,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = *i;
|
||||
|
||||
@@ -4291,7 +4293,7 @@ public:
|
||||
|
||||
virtual void visit(const LLSpatialGroup::OctreeNode* branch)
|
||||
{
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
|
||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
|
||||
{
|
||||
check(*i);
|
||||
}
|
||||
@@ -4476,29 +4478,64 @@ LLVertexBuffer* LLGeometryManager::createVertexBuffer(U32 type_mask, U32 usage)
|
||||
}
|
||||
|
||||
LLCullResult::LLCullResult()
|
||||
{
|
||||
{
|
||||
mVisibleGroupsAllocated = 0;
|
||||
mAlphaGroupsAllocated = 0;
|
||||
mOcclusionGroupsAllocated = 0;
|
||||
mDrawableGroupsAllocated = 0;
|
||||
mVisibleListAllocated = 0;
|
||||
mVisibleBridgeAllocated = 0;
|
||||
|
||||
mVisibleGroups = NULL;
|
||||
mVisibleGroupsEnd = NULL;
|
||||
mAlphaGroups = NULL;
|
||||
mAlphaGroupsEnd = NULL;
|
||||
mOcclusionGroups = NULL;
|
||||
mOcclusionGroupsEnd = NULL;
|
||||
mDrawableGroups = NULL;
|
||||
mDrawableGroupsEnd = NULL;
|
||||
mVisibleList = NULL;
|
||||
mVisibleListEnd = NULL;
|
||||
mVisibleBridge = NULL;
|
||||
mVisibleBridgeEnd = NULL;
|
||||
|
||||
for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
|
||||
{
|
||||
mRenderMap[i] = NULL;
|
||||
mRenderMapEnd[i] = NULL;
|
||||
mRenderMapAllocated[i] = 0;
|
||||
}
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
void LLCullResult::pushBack(void**& head, U32& count, void* val)
|
||||
{
|
||||
count++;
|
||||
head = (void**) realloc((void*) head, sizeof(void*) * count);
|
||||
head[count-1] = val;
|
||||
}
|
||||
|
||||
void LLCullResult::clear()
|
||||
{
|
||||
mVisibleGroupsSize = 0;
|
||||
mVisibleGroupsEnd = mVisibleGroups.begin();
|
||||
mVisibleGroupsEnd = mVisibleGroups;
|
||||
|
||||
mAlphaGroupsSize = 0;
|
||||
mAlphaGroupsEnd = mAlphaGroups.begin();
|
||||
mAlphaGroupsEnd = mAlphaGroups;
|
||||
|
||||
mOcclusionGroupsSize = 0;
|
||||
mOcclusionGroupsEnd = mOcclusionGroups.begin();
|
||||
mOcclusionGroupsEnd = mOcclusionGroups;
|
||||
|
||||
mDrawableGroupsSize = 0;
|
||||
mDrawableGroupsEnd = mDrawableGroups.begin();
|
||||
mDrawableGroupsEnd = mDrawableGroups;
|
||||
|
||||
mVisibleListSize = 0;
|
||||
mVisibleListEnd = mVisibleList.begin();
|
||||
mVisibleListEnd = mVisibleList;
|
||||
|
||||
mVisibleBridgeSize = 0;
|
||||
mVisibleBridgeEnd = mVisibleBridge.begin();
|
||||
mVisibleBridgeEnd = mVisibleBridge;
|
||||
|
||||
|
||||
for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
|
||||
{
|
||||
@@ -4507,176 +4544,176 @@ void LLCullResult::clear()
|
||||
mRenderMap[i][j] = 0;
|
||||
}
|
||||
mRenderMapSize[i] = 0;
|
||||
mRenderMapEnd[i] = mRenderMap[i].begin();
|
||||
mRenderMapEnd[i] = mRenderMap[i];
|
||||
}
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::beginVisibleGroups()
|
||||
{
|
||||
return mVisibleGroups.begin();
|
||||
return mVisibleGroups;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::endVisibleGroups()
|
||||
{
|
||||
return mVisibleGroupsEnd;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::beginAlphaGroups()
|
||||
{
|
||||
return mAlphaGroups.begin();
|
||||
return mAlphaGroups;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::endAlphaGroups()
|
||||
{
|
||||
return mAlphaGroupsEnd;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::beginOcclusionGroups()
|
||||
{
|
||||
return mOcclusionGroups.begin();
|
||||
return mOcclusionGroups;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::endOcclusionGroups()
|
||||
{
|
||||
return mOcclusionGroupsEnd;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::beginDrawableGroups()
|
||||
{
|
||||
return mDrawableGroups.begin();
|
||||
return mDrawableGroups;
|
||||
}
|
||||
|
||||
LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups()
|
||||
LLCullResult::sg_iterator LLCullResult::endDrawableGroups()
|
||||
{
|
||||
return mDrawableGroupsEnd;
|
||||
}
|
||||
|
||||
LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList()
|
||||
LLCullResult::drawable_iterator LLCullResult::beginVisibleList()
|
||||
{
|
||||
return mVisibleList.begin();
|
||||
return mVisibleList;
|
||||
}
|
||||
|
||||
LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList()
|
||||
LLCullResult::drawable_iterator LLCullResult::endVisibleList()
|
||||
{
|
||||
return mVisibleListEnd;
|
||||
}
|
||||
|
||||
LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge()
|
||||
LLCullResult::bridge_iterator LLCullResult::beginVisibleBridge()
|
||||
{
|
||||
return mVisibleBridge.begin();
|
||||
return mVisibleBridge;
|
||||
}
|
||||
|
||||
LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge()
|
||||
LLCullResult::bridge_iterator LLCullResult::endVisibleBridge()
|
||||
{
|
||||
return mVisibleBridgeEnd;
|
||||
}
|
||||
|
||||
LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type)
|
||||
LLCullResult::drawinfo_iterator LLCullResult::beginRenderMap(U32 type)
|
||||
{
|
||||
return mRenderMap[type].begin();
|
||||
return mRenderMap[type];
|
||||
}
|
||||
|
||||
LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type)
|
||||
LLCullResult::drawinfo_iterator LLCullResult::endRenderMap(U32 type)
|
||||
{
|
||||
return mRenderMapEnd[type];
|
||||
}
|
||||
|
||||
void LLCullResult::pushVisibleGroup(LLSpatialGroup* group)
|
||||
{
|
||||
if (mVisibleGroupsSize < mVisibleGroups.size())
|
||||
if (mVisibleGroupsSize < mVisibleGroupsAllocated)
|
||||
{
|
||||
mVisibleGroups[mVisibleGroupsSize] = group;
|
||||
}
|
||||
else
|
||||
{
|
||||
mVisibleGroups.push_back(group);
|
||||
pushBack((void**&) mVisibleGroups, mVisibleGroupsAllocated, (void*) group);
|
||||
}
|
||||
++mVisibleGroupsSize;
|
||||
mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize;
|
||||
mVisibleGroupsEnd = mVisibleGroups+mVisibleGroupsSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushAlphaGroup(LLSpatialGroup* group)
|
||||
{
|
||||
if (mAlphaGroupsSize < mAlphaGroups.size())
|
||||
if (mAlphaGroupsSize < mAlphaGroupsAllocated)
|
||||
{
|
||||
mAlphaGroups[mAlphaGroupsSize] = group;
|
||||
}
|
||||
else
|
||||
{
|
||||
mAlphaGroups.push_back(group);
|
||||
pushBack((void**&) mAlphaGroups, mAlphaGroupsAllocated, (void*) group);
|
||||
}
|
||||
++mAlphaGroupsSize;
|
||||
mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize;
|
||||
mAlphaGroupsEnd = mAlphaGroups+mAlphaGroupsSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group)
|
||||
{
|
||||
if (mOcclusionGroupsSize < mOcclusionGroups.size())
|
||||
if (mOcclusionGroupsSize < mOcclusionGroupsAllocated)
|
||||
{
|
||||
mOcclusionGroups[mOcclusionGroupsSize] = group;
|
||||
}
|
||||
else
|
||||
{
|
||||
mOcclusionGroups.push_back(group);
|
||||
pushBack((void**&) mOcclusionGroups, mOcclusionGroupsAllocated, (void*) group);
|
||||
}
|
||||
++mOcclusionGroupsSize;
|
||||
mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize;
|
||||
mOcclusionGroupsEnd = mOcclusionGroups+mOcclusionGroupsSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
|
||||
{
|
||||
if (mDrawableGroupsSize < mDrawableGroups.size())
|
||||
if (mDrawableGroupsSize < mDrawableGroupsAllocated)
|
||||
{
|
||||
mDrawableGroups[mDrawableGroupsSize] = group;
|
||||
}
|
||||
else
|
||||
{
|
||||
mDrawableGroups.push_back(group);
|
||||
pushBack((void**&) mDrawableGroups, mDrawableGroupsAllocated, (void*) group);
|
||||
}
|
||||
++mDrawableGroupsSize;
|
||||
mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize;
|
||||
mDrawableGroupsEnd = mDrawableGroups+mDrawableGroupsSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushDrawable(LLDrawable* drawable)
|
||||
{
|
||||
if (mVisibleListSize < mVisibleList.size())
|
||||
if (mVisibleListSize < mVisibleListAllocated)
|
||||
{
|
||||
mVisibleList[mVisibleListSize] = drawable;
|
||||
}
|
||||
else
|
||||
{
|
||||
mVisibleList.push_back(drawable);
|
||||
pushBack((void**&) mVisibleList, mVisibleListAllocated, (void*) drawable);
|
||||
}
|
||||
++mVisibleListSize;
|
||||
mVisibleListEnd = mVisibleList.begin()+mVisibleListSize;
|
||||
mVisibleListEnd = mVisibleList+mVisibleListSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushBridge(LLSpatialBridge* bridge)
|
||||
{
|
||||
if (mVisibleBridgeSize < mVisibleBridge.size())
|
||||
if (mVisibleBridgeSize < mVisibleBridgeAllocated)
|
||||
{
|
||||
mVisibleBridge[mVisibleBridgeSize] = bridge;
|
||||
}
|
||||
else
|
||||
{
|
||||
mVisibleBridge.push_back(bridge);
|
||||
pushBack((void**&) mVisibleBridge, mVisibleBridgeAllocated, (void*) bridge);
|
||||
}
|
||||
++mVisibleBridgeSize;
|
||||
mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize;
|
||||
mVisibleBridgeEnd = mVisibleBridge+mVisibleBridgeSize;
|
||||
}
|
||||
|
||||
void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info)
|
||||
{
|
||||
if (mRenderMapSize[type] < mRenderMap[type].size())
|
||||
if (mRenderMapSize[type] < mRenderMapAllocated[type])
|
||||
{
|
||||
mRenderMap[type][mRenderMapSize[type]] = draw_info;
|
||||
}
|
||||
else
|
||||
{
|
||||
mRenderMap[type].push_back(draw_info);
|
||||
pushBack((void**&) mRenderMap[type], mRenderMapAllocated[type], (void*) draw_info);
|
||||
}
|
||||
++mRenderMapSize[type];
|
||||
mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type];
|
||||
mRenderMapEnd[type] = mRenderMap[type] + mRenderMapSize[type];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -330,8 +330,13 @@ public:
|
||||
|
||||
void dirtyGeom() { setState(GEOM_DIRTY); }
|
||||
void dirtyMesh() { setState(MESH_DIRTY); }
|
||||
|
||||
//octree wrappers to make code more readable
|
||||
element_list& getData() { return mOctreeNode->getData(); }
|
||||
element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
|
||||
element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
|
||||
U32 getElementCount() const { return mOctreeNode->getElementCount(); }
|
||||
bool isEmpty() const { return mOctreeNode->isEmpty(); }
|
||||
|
||||
void drawObjectBox(LLColor4 col);
|
||||
|
||||
@@ -522,34 +527,39 @@ class LLCullResult
|
||||
public:
|
||||
LLCullResult();
|
||||
|
||||
typedef std::vector<LLSpatialGroup*> sg_list_t;
|
||||
typedef std::vector<LLDrawable*> drawable_list_t;
|
||||
typedef std::vector<LLSpatialBridge*> bridge_list_t;
|
||||
typedef std::vector<LLDrawInfo*> drawinfo_list_t;
|
||||
typedef LLSpatialGroup** sg_list_t;
|
||||
typedef LLDrawable** drawable_list_t;
|
||||
typedef LLSpatialBridge** bridge_list_t;
|
||||
typedef LLDrawInfo** drawinfo_list_t;
|
||||
|
||||
typedef LLSpatialGroup** sg_iterator;
|
||||
typedef LLSpatialBridge** bridge_iterator;
|
||||
typedef LLDrawInfo** drawinfo_iterator;
|
||||
typedef LLDrawable** drawable_iterator;
|
||||
|
||||
void clear();
|
||||
|
||||
sg_list_t::iterator beginVisibleGroups();
|
||||
sg_list_t::iterator endVisibleGroups();
|
||||
sg_iterator beginVisibleGroups();
|
||||
sg_iterator endVisibleGroups();
|
||||
|
||||
sg_list_t::iterator beginAlphaGroups();
|
||||
sg_list_t::iterator endAlphaGroups();
|
||||
sg_iterator beginAlphaGroups();
|
||||
sg_iterator endAlphaGroups();
|
||||
|
||||
bool hasOcclusionGroups() { return mOcclusionGroupsSize > 0; }
|
||||
sg_list_t::iterator beginOcclusionGroups();
|
||||
sg_list_t::iterator endOcclusionGroups();
|
||||
sg_iterator beginOcclusionGroups();
|
||||
sg_iterator endOcclusionGroups();
|
||||
|
||||
sg_list_t::iterator beginDrawableGroups();
|
||||
sg_list_t::iterator endDrawableGroups();
|
||||
sg_iterator beginDrawableGroups();
|
||||
sg_iterator endDrawableGroups();
|
||||
|
||||
drawable_list_t::iterator beginVisibleList();
|
||||
drawable_list_t::iterator endVisibleList();
|
||||
drawable_iterator beginVisibleList();
|
||||
drawable_iterator endVisibleList();
|
||||
|
||||
bridge_list_t::iterator beginVisibleBridge();
|
||||
bridge_list_t::iterator endVisibleBridge();
|
||||
bridge_iterator beginVisibleBridge();
|
||||
bridge_iterator endVisibleBridge();
|
||||
|
||||
drawinfo_list_t::iterator beginRenderMap(U32 type);
|
||||
drawinfo_list_t::iterator endRenderMap(U32 type);
|
||||
drawinfo_iterator beginRenderMap(U32 type);
|
||||
drawinfo_iterator endRenderMap(U32 type);
|
||||
|
||||
void pushVisibleGroup(LLSpatialGroup* group);
|
||||
void pushAlphaGroup(LLSpatialGroup* group);
|
||||
@@ -569,28 +579,41 @@ public:
|
||||
void assertDrawMapsEmpty();
|
||||
|
||||
private:
|
||||
|
||||
void pushBack(void** &head, U32& count, void* val);
|
||||
|
||||
U32 mVisibleGroupsSize;
|
||||
U32 mAlphaGroupsSize;
|
||||
U32 mOcclusionGroupsSize;
|
||||
U32 mDrawableGroupsSize;
|
||||
U32 mVisibleListSize;
|
||||
U32 mVisibleBridgeSize;
|
||||
|
||||
U32 mVisibleGroupsAllocated;
|
||||
U32 mAlphaGroupsAllocated;
|
||||
U32 mOcclusionGroupsAllocated;
|
||||
U32 mDrawableGroupsAllocated;
|
||||
U32 mVisibleListAllocated;
|
||||
U32 mVisibleBridgeAllocated;
|
||||
|
||||
U32 mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES];
|
||||
|
||||
sg_list_t mVisibleGroups;
|
||||
sg_list_t::iterator mVisibleGroupsEnd;
|
||||
sg_iterator mVisibleGroupsEnd;
|
||||
sg_list_t mAlphaGroups;
|
||||
sg_list_t::iterator mAlphaGroupsEnd;
|
||||
sg_iterator mAlphaGroupsEnd;
|
||||
sg_list_t mOcclusionGroups;
|
||||
sg_list_t::iterator mOcclusionGroupsEnd;
|
||||
sg_iterator mOcclusionGroupsEnd;
|
||||
sg_list_t mDrawableGroups;
|
||||
sg_list_t::iterator mDrawableGroupsEnd;
|
||||
sg_iterator mDrawableGroupsEnd;
|
||||
drawable_list_t mVisibleList;
|
||||
drawable_list_t::iterator mVisibleListEnd;
|
||||
drawable_iterator mVisibleListEnd;
|
||||
bridge_list_t mVisibleBridge;
|
||||
bridge_list_t::iterator mVisibleBridgeEnd;
|
||||
bridge_iterator mVisibleBridgeEnd;
|
||||
drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES];
|
||||
drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES];
|
||||
U32 mRenderMapAllocated[LLRenderPass::NUM_RENDER_TYPES];
|
||||
drawinfo_iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES];
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -200,7 +200,6 @@
|
||||
#include "llnamelistctrl.h"
|
||||
#include "llnamebox.h"
|
||||
#include "llnameeditor.h"
|
||||
#include "llpostprocess.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llagentlanguage.h"
|
||||
@@ -221,6 +220,8 @@
|
||||
#include "shfloatermediaticker.h"
|
||||
// </edit>
|
||||
|
||||
#include "llpathfindingmanager.h"
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "lgghunspell_wrapper.h"
|
||||
|
||||
@@ -1094,12 +1095,14 @@ bool idle_startup()
|
||||
// END TODO
|
||||
LLPanelLogin::close();
|
||||
}
|
||||
|
||||
|
||||
//For HTML parsing in text boxes.
|
||||
LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") );
|
||||
|
||||
// Load URL History File
|
||||
LLURLHistory::loadFile("url_history.xml");
|
||||
// Load media plugin cookies
|
||||
LLViewerMedia::loadCookieFile();
|
||||
|
||||
//-------------------------------------------------
|
||||
// Handle startup progress screen
|
||||
@@ -2740,6 +2743,10 @@ bool idle_startup()
|
||||
// reset timers now that we are running "logged in" logic
|
||||
LLFastTimer::reset();
|
||||
display_startup();
|
||||
|
||||
llassert(LLPathfindingManager::getInstance() != NULL);
|
||||
LLPathfindingManager::getInstance()->initSystem();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -4304,7 +4311,6 @@ bool process_login_success_response(std::string& password)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Override grid info with anything sent in the login response
|
||||
std::string tmp = response["gridname"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
|
||||
@@ -4349,6 +4355,14 @@ bool process_login_success_response(std::string& password)
|
||||
gHippoGridManager->saveFile();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
// Start the process of fetching the OpenID session cookie for this user login
|
||||
std::string openid_url = response["openid_url"];
|
||||
if(!openid_url.empty())
|
||||
{
|
||||
std::string openid_token = response["openid_token"];
|
||||
LLViewerMedia::openIDSetup(openid_url, openid_token);
|
||||
}
|
||||
|
||||
gIMMgr->loadIgnoreGroup();
|
||||
|
||||
bool success = false;
|
||||
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
||||
/*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; }
|
||||
/*virtual*/ const LLVector4a& getAvgDistortion() { return mAvgDistortionVec; }
|
||||
/*virtual*/ F32 getMaxDistortion() { return 3.f; }
|
||||
/*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f);}
|
||||
/*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
|
||||
/*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;};
|
||||
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector4a(1.f, 1.f, 1.f);}
|
||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;};
|
||||
|
||||
// New functions
|
||||
BOOL render( S32 x, S32 y, S32 width, S32 height );
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
LLPointer<LLImageRaw> mStaticImageRaw;
|
||||
BOOL mNeedsCreateTexture;
|
||||
BOOL mStaticImageInvalid;
|
||||
LLVector3 mAvgDistortionVec;
|
||||
LLVector4a mAvgDistortionVec;
|
||||
F32 mCachedEffectiveWeight;
|
||||
|
||||
public:
|
||||
@@ -155,18 +155,18 @@ public:
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
||||
/*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; }
|
||||
/*virtual*/ const LLVector4a& getAvgDistortion() { return mAvgDistortionVec; }
|
||||
/*virtual*/ F32 getMaxDistortion() { return 3.f; }
|
||||
/*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f); }
|
||||
/*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
|
||||
/*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;};
|
||||
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector4a(1.f, 1.f, 1.f); }
|
||||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;};
|
||||
|
||||
// New functions
|
||||
LLColor4 getNetColor() const;
|
||||
protected:
|
||||
virtual void onGlobalColorChanged(bool upload_bake) {}
|
||||
private:
|
||||
LLVector3 mAvgDistortionVec;
|
||||
LLVector4a mAvgDistortionVec;
|
||||
};
|
||||
|
||||
class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo
|
||||
|
||||
@@ -161,6 +161,13 @@ BOOL LLToolBar::postBuild()
|
||||
childSetAction("inventory_btn", onClickInventory, this);
|
||||
childSetControlName("inventory_btn", "ShowInventory");
|
||||
|
||||
mCommunicateBtn.connect(this, "communicate_btn");
|
||||
mFlyBtn.connect(this, "fly_btn");
|
||||
mBuildBtn.connect(this, "build_btn");
|
||||
mMapBtn.connect(this, "map_btn");
|
||||
mRadarBtn.connect(this, "radar_btn");
|
||||
mInventoryBtn.connect(this, "inventory_button");
|
||||
|
||||
for (child_list_const_iter_t child_iter = getChildList()->begin();
|
||||
child_iter != getChildList()->end(); ++child_iter)
|
||||
{
|
||||
@@ -292,7 +299,9 @@ void LLToolBar::refresh()
|
||||
if(!isAgentAvatarValid())
|
||||
return;
|
||||
|
||||
BOOL show = gSavedSettings.getBOOL("ShowToolBar");
|
||||
static LLCachedControl<bool> show("ShowToolBar", true);
|
||||
static LLCachedControl<bool> ascent_fly_always_enabled("AscentFlyAlwaysEnabled", true);
|
||||
static LLCachedControl<bool> ascent_build_always_enabled("AscentBuildAlwaysEnabled", true);
|
||||
BOOL mouselook = gAgentCamera.cameraMouselook();
|
||||
setVisible(show && !mouselook);
|
||||
|
||||
@@ -302,9 +311,8 @@ void LLToolBar::refresh()
|
||||
sitting = gAgentAvatarp->isSitting();
|
||||
}
|
||||
|
||||
childSetEnabled("fly_btn", (gAgent.canFly() || gAgent.getFlying() || gSavedSettings.getBOOL("AscentFlyAlwaysEnabled")) && !sitting );
|
||||
|
||||
childSetEnabled("build_btn", (LLViewerParcelMgr::getInstance()->allowAgentBuild() || gSavedSettings.getBOOL("AscentBuildAlwaysEnabled")) );
|
||||
mFlyBtn->setEnabled((gAgent.canFly() || gAgent.getFlying() || ascent_fly_always_enabled) && !sitting );
|
||||
mBuildBtn->setEnabled((LLViewerParcelMgr::getInstance()->allowAgentBuild() || ascent_build_always_enabled));
|
||||
|
||||
// Check to see if we're in build mode
|
||||
BOOL build_mode = LLToolMgr::getInstance()->inEdit();
|
||||
@@ -323,11 +331,11 @@ void LLToolBar::refresh()
|
||||
{
|
||||
// If we're rez-restricted, we can still edit => allow build floater
|
||||
// If we're edit-restricted, we can still rez => allow build floater
|
||||
childSetEnabled("build_btn", !(gRlvHandler.hasBehaviour(RLV_BHVR_REZ) && gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) );
|
||||
mBuildBtn->setEnabled(!(gRlvHandler.hasBehaviour(RLV_BHVR_REZ) && gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)));
|
||||
|
||||
childSetEnabled("map_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP) );
|
||||
childSetEnabled("radar_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP) );
|
||||
childSetEnabled("inventory_btn", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV) );
|
||||
mMapBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP));
|
||||
mRadarBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP));
|
||||
mInventoryBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV));
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
@@ -339,7 +347,7 @@ void LLToolBar::refresh()
|
||||
|
||||
void LLToolBar::updateCommunicateList()
|
||||
{
|
||||
LLFlyoutButton* communicate_button = getChild<LLFlyoutButton>("communicate_btn");
|
||||
LLFlyoutButton* communicate_button = mCommunicateBtn;
|
||||
LLSD selected = communicate_button->getValue();
|
||||
|
||||
communicate_button->removeall();
|
||||
|
||||
@@ -44,6 +44,8 @@ extern S32 TOOL_BAR_HEIGHT;
|
||||
class LLFakeResizeHandle;
|
||||
#endif // LL_DARWIN
|
||||
|
||||
class LLFlyoutButton;
|
||||
|
||||
class LLToolBar
|
||||
: public LLPanel
|
||||
{
|
||||
@@ -97,6 +99,13 @@ private:
|
||||
#if LL_DARWIN
|
||||
LLFakeResizeHandle *mResizeHandle;
|
||||
#endif // LL_DARWIN
|
||||
|
||||
CachedUICtrl<LLFlyoutButton> mCommunicateBtn;
|
||||
CachedUICtrl<LLButton> mFlyBtn;
|
||||
CachedUICtrl<LLButton> mBuildBtn;
|
||||
CachedUICtrl<LLButton> mMapBtn;
|
||||
CachedUICtrl<LLButton> mRadarBtn;
|
||||
CachedUICtrl<LLButton> mInventoryBtn;
|
||||
};
|
||||
|
||||
extern LLToolBar *gToolBar;
|
||||
|
||||
@@ -214,28 +214,41 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
|
||||
|
||||
// Clicks on scripted or physical objects are temporary grabs, so
|
||||
// not "Build mode"
|
||||
mHideBuildHighlight = script_touch || objectp->usePhysics();
|
||||
mHideBuildHighlight = script_touch || objectp->flagUsePhysics();
|
||||
|
||||
if (!objectp->usePhysics())
|
||||
if (!objectp->flagUsePhysics())
|
||||
{
|
||||
// In mouselook, we shouldn't be able to grab non-physical,
|
||||
// non-touchable objects. If it has a touch handler, we
|
||||
// do grab it (so llDetectedGrab works), but movement is
|
||||
// blocked on the server side. JC
|
||||
if (gAgentCamera.cameraMouselook() && !script_touch)
|
||||
if (script_touch)
|
||||
{
|
||||
mMode = GRAB_LOCKED;
|
||||
gViewerWindow->hideCursor();
|
||||
gViewerWindow->moveCursorToCenter();
|
||||
mMode = GRAB_NONPHYSICAL; // if it has a script, use the non-physical grab
|
||||
}
|
||||
else
|
||||
{
|
||||
mMode = GRAB_NONPHYSICAL;
|
||||
// In mouselook, we shouldn't be able to grab non-physical,
|
||||
// non-touchable objects. If it has a touch handler, we
|
||||
// do grab it (so llDetectedGrab works), but movement is
|
||||
// blocked on the server side. JC
|
||||
if (gAgentCamera.cameraMouselook())
|
||||
{
|
||||
mMode = GRAB_LOCKED;
|
||||
gViewerWindow->hideCursor();
|
||||
gViewerWindow->moveCursorToCenter();
|
||||
}
|
||||
else if (objectp->permMove() && !objectp->isPermanentEnforced())
|
||||
{
|
||||
mMode = GRAB_ACTIVE_CENTER;
|
||||
gViewerWindow->hideCursor();
|
||||
gViewerWindow->moveCursorToCenter();
|
||||
}
|
||||
else
|
||||
{
|
||||
mMode = GRAB_LOCKED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// Don't bail out here, go on and grab so buttons can get
|
||||
// their "touched" event.
|
||||
}
|
||||
else if( !objectp->permMove() )
|
||||
else if( objectp->flagCharacter() || !objectp->permMove() || objectp->isPermanentEnforced())
|
||||
{
|
||||
// if mouse is over a physical object without move permission, show feedback if user tries to move it.
|
||||
mMode = GRAB_LOCKED;
|
||||
|
||||
@@ -276,7 +276,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
|
||||
// Switch to grab tool if physical or triggerable
|
||||
if (object &&
|
||||
!object->isAvatar() &&
|
||||
((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) &&
|
||||
((object->flagUsePhysics() || (parent && !parent->isAvatar() && parent->flagUsePhysics())) || touchable) &&
|
||||
!always_show)
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
|
||||
@@ -704,8 +704,8 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
||||
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
else if ((object && !object->isAvatar() && object->usePhysics())
|
||||
|| (parent && !parent->isAvatar() && parent->usePhysics()))
|
||||
else if ((object && !object->isAvatar() && object->flagUsePhysics())
|
||||
|| (parent && !parent->isAvatar() && parent->flagUsePhysics()))
|
||||
{
|
||||
gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
|
||||
}
|
||||
@@ -928,7 +928,7 @@ static bool handle_media_click(const LLPickInfo& pick)
|
||||
}
|
||||
else
|
||||
{
|
||||
media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
|
||||
media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY, gKeyboard->currentMask(TRUE));
|
||||
media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ static bool handle_media_hover(const LLPickInfo& pick)
|
||||
{
|
||||
if(LLViewerMediaFocus::getInstance()->getFocus())
|
||||
{
|
||||
media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY);
|
||||
media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY, gKeyboard->currentMask(TRUE));
|
||||
}
|
||||
|
||||
// Set mouse over flag if unset
|
||||
|
||||
@@ -286,5 +286,11 @@ const char * LLURL::getFullPath()
|
||||
return(sReturnString);
|
||||
}
|
||||
|
||||
const char * LLURL::getAuthority()
|
||||
{
|
||||
strncpy(LLURL::sReturnString,mAuthority, LL_MAX_PATH -1); /* Flawfinder: ignore */
|
||||
LLURL::sReturnString[LL_MAX_PATH -1] = '\0';
|
||||
return(sReturnString);
|
||||
}
|
||||
|
||||
char LLURL::sReturnString[LL_MAX_PATH] = "";
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
|
||||
virtual const char *getFQURL() const;
|
||||
virtual const char *getFullPath();
|
||||
virtual const char *getAuthority();
|
||||
|
||||
virtual const char *updateRelativePath(const LLURL &url);
|
||||
|
||||
|
||||
@@ -1009,7 +1009,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
gPipeline.mDeferredScreen.flush();
|
||||
if(LLRenderTarget::sUseFBO)
|
||||
if(gPipeline.mDeferredScreen.getFBO())
|
||||
{
|
||||
LLRenderTarget::copyContentsToFramebuffer(gPipeline.mDeferredScreen, 0, 0, gPipeline.mDeferredScreen.getWidth(),
|
||||
gPipeline.mDeferredScreen.getHeight(), 0, 0,
|
||||
@@ -1021,7 +1021,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
else
|
||||
{
|
||||
gPipeline.mScreen.flush();
|
||||
if(LLRenderTarget::sUseFBO)
|
||||
if(gPipeline.mScreen.getFBO())
|
||||
{
|
||||
LLRenderTarget::copyContentsToFramebuffer(gPipeline.mScreen, 0, 0, gPipeline.mScreen.getWidth(),
|
||||
gPipeline.mScreen.getHeight(), 0, 0,
|
||||
@@ -1283,14 +1283,12 @@ void render_ui(F32 zoom_factor, int subfield, bool tiling)
|
||||
if (to_texture)
|
||||
{
|
||||
gPipeline.renderBloom(gSnapshot, zoom_factor, subfield, tiling);
|
||||
gPipeline.mScreen.flush(); //blit, etc.
|
||||
}
|
||||
/// We copy the frame buffer straight into a texture here,
|
||||
/// and then display it again with compositor effects.
|
||||
/// Using render to texture would be faster/better, but I don't have a
|
||||
/// grasp of their full display stack just yet.
|
||||
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
LLPostProcess::getInstance()->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
|
||||
{
|
||||
LLPostProcess::getInstance()->renderEffects(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
|
||||
}
|
||||
|
||||
render_hud_elements();
|
||||
render_hud_attachments();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user