Merge branch 'master' of https://github.com/Shyotl/SingularityViewer
Conflicts: indra/newview/llvovolume.cpp indra/newview/skins/default/xui/fr/panel_overlaybar.xml
This commit is contained in:
@@ -245,6 +245,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterpostprocess.cpp
|
||||
llfloaterpreference.cpp
|
||||
llfloaterproperties.cpp
|
||||
llfloaterregiondebugconsole.cpp
|
||||
llfloaterregioninfo.cpp
|
||||
llfloaterreporter.cpp
|
||||
llfloatersearchreplace.cpp
|
||||
@@ -374,6 +375,7 @@ set(viewer_SOURCE_FILES
|
||||
llpanelmsgs.cpp
|
||||
llpanelnetwork.cpp
|
||||
llpanelobject.cpp
|
||||
llpanelpathfindingrebakenavmesh.cpp
|
||||
llpanelpermissions.cpp
|
||||
llpanelpick.cpp
|
||||
llpanelplace.cpp
|
||||
@@ -382,6 +384,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
|
||||
@@ -738,6 +749,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterpreference.h
|
||||
llfloaterperms.h
|
||||
llfloaterproperties.h
|
||||
llfloaterregiondebugconsole.h
|
||||
llfloaterregioninfo.h
|
||||
llfloaterreporter.h
|
||||
llfloatersearchreplace.h
|
||||
@@ -868,6 +880,7 @@ set(viewer_HEADER_FILES
|
||||
llpanelmsgs.h
|
||||
llpanelnetwork.h
|
||||
llpanelobject.h
|
||||
llpanelpathfindingrebakenavmesh.h
|
||||
llpanelpermissions.h
|
||||
llpanelpick.h
|
||||
llpanelplace.h
|
||||
@@ -876,6 +889,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
|
||||
|
||||
@@ -13310,7 +13310,7 @@
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>10</integer>
|
||||
<integer>5</integer>
|
||||
</map>
|
||||
<key>SystemLanguage</key>
|
||||
<map>
|
||||
|
||||
@@ -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();
|
||||
|
||||
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;
|
||||
|
||||
@@ -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()) )
|
||||
{
|
||||
|
||||
@@ -479,9 +479,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() ;
|
||||
}
|
||||
@@ -567,9 +570,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())
|
||||
{
|
||||
@@ -621,9 +627,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 );
|
||||
|
||||
@@ -704,7 +712,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();
|
||||
@@ -1872,7 +1883,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);
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
@@ -224,53 +226,61 @@ 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(const std::string& button_name, bool visible)
|
||||
{
|
||||
LLButton* button = findChild<LLButton>(button_name);
|
||||
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("New IM",gIMMgr->getIMReceived()))
|
||||
{
|
||||
int unread_count = gIMMgr->getIMUnreadCount();
|
||||
if (unread_count > 0)
|
||||
{
|
||||
if (unread_count > 1)
|
||||
@@ -284,86 +294,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("Set Not Busy",gAgent.getBusy()) != NULL;
|
||||
buttons_changed |= updateButtonVisiblity("Flycam",LLViewerJoystick::getInstance()->getOverrideCamera()) != NULL;
|
||||
buttons_changed |= updateButtonVisiblity("Mouselook",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("Stand Up",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("Cancel TP",(gAgent.getTeleportState() >= LLAgent::TELEPORT_START) && (gAgent.getTeleportState() <= LLAgent::TELEPORT_MOVING)) != NULL;
|
||||
|
||||
moveChildToBackOfTabGroup(mAORemote);
|
||||
moveChildToBackOfTabGroup(mMediaRemote);
|
||||
@@ -384,7 +324,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,7 +334,7 @@ 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)
|
||||
|
||||
@@ -64,6 +64,8 @@ public:
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
LLButton* updateButtonVisiblity(const std::string& button_name, bool visible);
|
||||
|
||||
void layoutButtons();
|
||||
|
||||
// helpers for returning desired state
|
||||
|
||||
@@ -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 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();
|
||||
|
||||
|
||||
@@ -221,6 +221,8 @@
|
||||
#include "shfloatermediaticker.h"
|
||||
// </edit>
|
||||
|
||||
#include "llpathfindingmanager.h"
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "lgghunspell_wrapper.h"
|
||||
|
||||
@@ -2740,6 +2742,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -275,7 +275,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
|
||||
@@ -703,8 +703,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);
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
#include "llfloaterperms.h"
|
||||
#include "llfloaterpostprocess.h"
|
||||
#include "llfloaterpreference.h"
|
||||
#include "llfloaterregiondebugconsole.h"
|
||||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterreporter.h"
|
||||
#include "llfloaterscriptdebug.h"
|
||||
@@ -258,6 +259,7 @@
|
||||
#include "slfloatermediafilter.h"
|
||||
#include "llviewerobjectbackup.h"
|
||||
#include "llagentui.h"
|
||||
#include "llpathfindingmanager.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
@@ -372,7 +374,6 @@ void near_sit_object();
|
||||
BOOL is_selection_buy_not_take();
|
||||
S32 selection_price();
|
||||
BOOL enable_take();
|
||||
void handle_take();
|
||||
bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle);
|
||||
|
||||
void handle_buy_object(LLSaleInfo sale_info);
|
||||
@@ -417,6 +418,21 @@ void handle_god_mode(void*);
|
||||
// God menu
|
||||
void handle_leave_god_mode(void*);
|
||||
|
||||
//Generic handler for singleton-based floaters.
|
||||
template<typename T>
|
||||
BOOL handle_singleton_check(void *)
|
||||
{
|
||||
return T::instanceExists();
|
||||
}
|
||||
template<typename T>
|
||||
void handle_singleton_toggle(void *)
|
||||
{
|
||||
if(!T::instanceExists())
|
||||
T::getInstance();
|
||||
else
|
||||
T::getInstance()->close();
|
||||
}
|
||||
|
||||
// <edit>
|
||||
void handle_fake_away_status(void*);
|
||||
void handle_area_search(void*);
|
||||
@@ -546,7 +562,6 @@ BOOL get_visibility(void*);
|
||||
void request_friendship(const LLUUID& agent_id);
|
||||
|
||||
// Tools menu
|
||||
void handle_force_unlock(void*);
|
||||
void handle_selected_texture_info(void*);
|
||||
void handle_dump_image_list(void*);
|
||||
|
||||
@@ -809,7 +824,7 @@ void init_menus()
|
||||
menu->addChild(new LLMenuItemCallGL( "Asset Blacklist",
|
||||
&handle_blacklist, NULL));
|
||||
menu->addChild(new LLMenuItemCheckGL( "Streaming Audio Display",
|
||||
&handle_ticker_toggle, &handle_ticker_enabled, &handle_ticker_check, NULL ));
|
||||
&handle_ticker_toggle, &handle_ticker_enabled, &handle_singleton_check<SHFloaterMediaTicker>, NULL ));
|
||||
|
||||
|
||||
|
||||
@@ -1280,6 +1295,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
|
||||
(void*)"DoubleClickTeleport"));
|
||||
menu->addSeparator();
|
||||
// menu->addChild(new LLMenuItemCallGL( "Print Packets Lost", &print_packets_lost, NULL, NULL, 'L', MASK_SHIFT ));
|
||||
menu->addChild(new LLMenuItemCheckGL("Region Debug", handle_singleton_toggle<LLFloaterRegionDebugConsole>, NULL, handle_singleton_check<LLFloaterRegionDebugConsole>,NULL,'`', MASK_CONTROL|MASK_SHIFT));
|
||||
menu->addChild(new LLMenuItemCheckGL("Debug SelectMgr", menu_toggle_control, NULL, menu_check_control, (void*)"DebugSelectMgr"));
|
||||
menu->addChild(new LLMenuItemToggleGL("Debug Clicks", &gDebugClicks));
|
||||
menu->addChild(new LLMenuItemToggleGL("Debug Views", &LLView::sDebugRects));
|
||||
@@ -2718,6 +2734,16 @@ class LLObjectMeasure : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
bool enable_object_select_in_pathfinding_linksets()
|
||||
{
|
||||
return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetEditableLinksets();
|
||||
}
|
||||
|
||||
bool enable_object_select_in_pathfinding_characters()
|
||||
{
|
||||
return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetViewableCharacters();
|
||||
}
|
||||
|
||||
class LLAvatarAnims : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -4494,8 +4520,9 @@ static bool get_derezzable_objects(
|
||||
{
|
||||
case DRD_TAKE_INTO_AGENT_INVENTORY:
|
||||
case DRD_TRASH:
|
||||
if( (node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
|
||||
|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE)) )
|
||||
if (!object->isPermanentEnforced() &&
|
||||
((node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
|
||||
|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE))))
|
||||
{
|
||||
can_derez_current = TRUE;
|
||||
}
|
||||
@@ -4915,9 +4942,10 @@ BOOL enable_take()
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
if((node->mPermissions->allowTransferTo(gAgent.getID())
|
||||
if(!object->isPermanentEnforced() &&
|
||||
((node->mPermissions->allowTransferTo(gAgent.getID())
|
||||
&& object->permModify())
|
||||
|| (node->mPermissions->getOwner() == gAgent.getID()))
|
||||
|| (node->mPermissions->getOwner() == gAgent.getID())))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -5161,6 +5189,7 @@ class LLToolsSaveToInventory : public view_listener_t
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class LLToolsSaveToObjectInventory : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -5175,6 +5204,22 @@ class LLToolsSaveToObjectInventory : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
class LLToolsEnablePathfinding : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion();
|
||||
}
|
||||
};
|
||||
|
||||
class LLToolsEnablePathfindingView : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled();
|
||||
}
|
||||
};
|
||||
|
||||
// Round the position of all root objects to the grid
|
||||
class LLToolsSnapObjectXY : public view_listener_t
|
||||
{
|
||||
@@ -6306,30 +6351,6 @@ void dump_inventory(void*)
|
||||
gInventory.dumpInventory();
|
||||
}
|
||||
|
||||
// forcibly unlock an object
|
||||
void handle_force_unlock(void*)
|
||||
{
|
||||
// First, make it public.
|
||||
LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null, TRUE);
|
||||
|
||||
// Second, lie to the viewer and mark it editable and unowned
|
||||
|
||||
struct f : public LLSelectedObjectFunctor
|
||||
{
|
||||
virtual bool apply(LLViewerObject* object)
|
||||
{
|
||||
object->mFlags |= FLAGS_OBJECT_MOVE;
|
||||
object->mFlags |= FLAGS_OBJECT_MODIFY;
|
||||
object->mFlags |= FLAGS_OBJECT_COPY;
|
||||
|
||||
object->mFlags &= ~FLAGS_OBJECT_ANY_OWNER;
|
||||
object->mFlags &= ~FLAGS_OBJECT_YOU_OWNER;
|
||||
return true;
|
||||
}
|
||||
} func;
|
||||
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func);
|
||||
}
|
||||
|
||||
void handle_dump_followcam(void*)
|
||||
{
|
||||
LLFollowCamMgr::dump();
|
||||
@@ -7290,6 +7311,7 @@ BOOL object_selected_and_point_valid(void *user_data)
|
||||
return (selection->getRootObjectCount() == 1) &&
|
||||
(selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) &&
|
||||
selection->getFirstRootObject()->permYouOwner() &&
|
||||
!selection->getFirstRootObject()->flagObjectPermanent() &&
|
||||
!((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() &&
|
||||
(selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL);
|
||||
}
|
||||
@@ -7965,8 +7987,8 @@ BOOL enable_save_into_inventory(void*)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL enable_save_into_task_inventory(void*)
|
||||
@@ -9372,6 +9394,9 @@ void initialize_menus()
|
||||
addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy");
|
||||
addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.SaveToObjectInventory");
|
||||
|
||||
addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding");
|
||||
addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");
|
||||
|
||||
/*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject");
|
||||
addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/
|
||||
|
||||
|
||||
@@ -5272,7 +5272,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
|
||||
LLViewerObject* object = gObjectList.findObject(object_id);
|
||||
if (object)
|
||||
{
|
||||
object->mFlags |= FLAGS_ANIM_SOURCE;
|
||||
object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, TRUE);
|
||||
|
||||
BOOL anim_found = FALSE;
|
||||
LLVOAvatar::AnimSourceIterator anim_it = avatarp->mAnimationSources.find(object_id);
|
||||
@@ -5419,7 +5419,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
|
||||
LLViewerObject* objectp = gObjectList.findObject(source_id);
|
||||
if (objectp)
|
||||
{
|
||||
objectp->mFlags |= FLAGS_CAMERA_SOURCE;
|
||||
objectp->setFlagsWithoutUpdate(FLAGS_CAMERA_SOURCE, TRUE);
|
||||
}
|
||||
|
||||
S32 num_objects = mesgsys->getNumberOfBlocks("CameraProperty");
|
||||
|
||||
@@ -457,7 +457,7 @@ void LLViewerObject::dump() const
|
||||
/*
|
||||
llinfos << "Velocity: " << getVelocity() << llendl;
|
||||
llinfos << "AnyOwner: " << permAnyOwner() << " YouOwner: " << permYouOwner() << " Edit: " << mPermEdit << llendl;
|
||||
llinfos << "UsePhysics: " << usePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << llendl;
|
||||
llinfos << "UsePhysics: " << flagUsePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << llendl;
|
||||
llinfos << "AppAngle: " << mAppAngle << llendl;
|
||||
llinfos << "PixelArea: " << mPixelArea << llendl;
|
||||
|
||||
@@ -2065,6 +2065,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
//
|
||||
//
|
||||
|
||||
// If we're going to skip this message, why are we
|
||||
// doing all the parenting, etc above?
|
||||
U32 packet_id = mesgsys->getCurrentRecvPacketID();
|
||||
if (packet_id < mLatestRecvPacketID &&
|
||||
mLatestRecvPacketID - packet_id < 65536)
|
||||
@@ -2125,12 +2127,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
}
|
||||
}
|
||||
|
||||
if (new_rot != mLastRot
|
||||
if (new_rot != getRotation()
|
||||
|| new_angv != old_angv)
|
||||
{
|
||||
if (new_rot != mLastRot)
|
||||
if (new_rot != getRotation())
|
||||
{
|
||||
mLastRot = new_rot;
|
||||
setRotation(new_rot);
|
||||
}
|
||||
|
||||
@@ -4151,38 +4152,6 @@ void LLViewerObject::sendMaterialUpdate() const
|
||||
|
||||
}
|
||||
|
||||
// formerly send_object_rotation
|
||||
void LLViewerObject::sendRotationUpdate() const
|
||||
{
|
||||
LLViewerRegion* regionp = getRegion();
|
||||
if(!regionp) return;
|
||||
gMessageSystem->newMessageFast(_PREHASH_ObjectRotation);
|
||||
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
|
||||
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
|
||||
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, mLocalID);
|
||||
gMessageSystem->addQuatFast(_PREHASH_Rotation, getRotationEdit());
|
||||
//llinfos << "Sent rotation " << getRotationEdit() << llendl;
|
||||
gMessageSystem->sendReliable( regionp->getHost() );
|
||||
}
|
||||
|
||||
/* Obsolete, we use MultipleObjectUpdate instead
|
||||
//// formerly send_object_position_global
|
||||
//void LLViewerObject::sendPositionUpdate() const
|
||||
//{
|
||||
// gMessageSystem->newMessageFast(_PREHASH_ObjectPosition);
|
||||
// gMessageSystem->nextBlockFast(_PREHASH_AgentData);
|
||||
// gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
|
||||
// gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
// gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
|
||||
// gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, mLocalID );
|
||||
// gMessageSystem->addVector3Fast(_PREHASH_Position, getPositionRegion());
|
||||
// LLViewerRegion* regionp = getRegion();
|
||||
// gMessageSystem->sendReliable(regionp->getHost());
|
||||
//}
|
||||
*/
|
||||
|
||||
//formerly send_object_shape(LLViewerObject *object)
|
||||
void LLViewerObject::sendShapeUpdate()
|
||||
{
|
||||
@@ -5267,7 +5236,7 @@ BOOL LLViewerObject::permAnyOwner() const
|
||||
{
|
||||
if (isRootEdit())
|
||||
{
|
||||
return ((mFlags & FLAGS_OBJECT_ANY_OWNER) != 0);
|
||||
return flagObjectAnyOwner();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5289,7 +5258,7 @@ BOOL LLViewerObject::permYouOwner() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_YOU_OWNER) != 0);
|
||||
return flagObjectYouOwner();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5303,7 +5272,7 @@ BOOL LLViewerObject::permGroupOwner() const
|
||||
{
|
||||
if (isRootEdit())
|
||||
{
|
||||
return ((mFlags & FLAGS_OBJECT_GROUP_OWNED) != 0);
|
||||
return flagObjectGroupOwned();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5326,7 +5295,7 @@ BOOL LLViewerObject::permOwnerModify() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_OWNER_MODIFY) != 0);
|
||||
return flagObjectOwnerModify();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5350,7 +5319,7 @@ BOOL LLViewerObject::permModify() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_MODIFY) != 0);
|
||||
return flagObjectModify();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5374,7 +5343,7 @@ BOOL LLViewerObject::permCopy() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_COPY) != 0);
|
||||
return flagObjectCopy();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5398,7 +5367,7 @@ BOOL LLViewerObject::permMove() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_MOVE) != 0);
|
||||
return flagObjectMove();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5422,7 +5391,7 @@ BOOL LLViewerObject::permTransfer() const
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
return ((mFlags & FLAGS_OBJECT_TRANSFER) != 0);
|
||||
return flagObjectTransfer();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5468,21 +5437,19 @@ void LLViewerObject::markForUpdate(BOOL priority)
|
||||
}
|
||||
}
|
||||
|
||||
bool LLViewerObject::isPermanentEnforced() const
|
||||
{
|
||||
return flagObjectPermanent() && (mRegionp != gAgent.getRegion()) && !gAgent.isGodlike();
|
||||
}
|
||||
|
||||
bool LLViewerObject::getIncludeInSearch() const
|
||||
{
|
||||
return ((mFlags & FLAGS_INCLUDE_IN_SEARCH) != 0);
|
||||
return flagIncludeInSearch();
|
||||
}
|
||||
|
||||
void LLViewerObject::setIncludeInSearch(bool include_in_search)
|
||||
{
|
||||
if (include_in_search)
|
||||
{
|
||||
mFlags |= FLAGS_INCLUDE_IN_SEARCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFlags &= ~FLAGS_INCLUDE_IN_SEARCH;
|
||||
}
|
||||
setFlags(FLAGS_INCLUDE_IN_SEARCH, include_in_search);
|
||||
}
|
||||
|
||||
void LLViewerObject::setRegion(LLViewerRegion *regionp)
|
||||
@@ -5507,8 +5474,8 @@ void LLViewerObject::setRegion(LLViewerRegion *regionp)
|
||||
|
||||
bool LLViewerObject::specialHoverCursor() const
|
||||
{
|
||||
return (mFlags & FLAGS_USE_PHYSICS)
|
||||
|| (mFlags & FLAGS_HANDLE_TOUCH)
|
||||
return flagUsePhysics()
|
||||
|| flagHandleTouch()
|
||||
|| (mClickAction != 0);
|
||||
}
|
||||
|
||||
@@ -5521,10 +5488,15 @@ void LLViewerObject::updateFlags(BOOL physics_changed)
|
||||
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
|
||||
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, getLocalID() );
|
||||
gMessageSystem->addBOOLFast(_PREHASH_UsePhysics, usePhysics() );
|
||||
gMessageSystem->addBOOLFast(_PREHASH_UsePhysics, flagUsePhysics() );
|
||||
gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() );
|
||||
gMessageSystem->addBOOL("IsPhantom", flagPhantom() );
|
||||
gMessageSystem->addBOOL("CastsShadows", flagCastShadows() );
|
||||
|
||||
// stinson 02/28/2012 : This CastsShadows BOOL is no longer used in either the viewer or the simulator
|
||||
// The simulator code does not even unpack this value when the message is received.
|
||||
// This could be potentially hijacked in the future for another use should the urgent need arise.
|
||||
gMessageSystem->addBOOL("CastsShadows", FALSE );
|
||||
|
||||
if (physics_changed)
|
||||
{
|
||||
gMessageSystem->nextBlock("ExtraPhysics");
|
||||
@@ -5538,6 +5510,19 @@ void LLViewerObject::updateFlags(BOOL physics_changed)
|
||||
}
|
||||
|
||||
BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
|
||||
{
|
||||
BOOL setit = setFlagsWithoutUpdate(flags, state);
|
||||
|
||||
// BUG: Sometimes viewer physics and simulator physics get
|
||||
// out of sync. To fix this, always send update to simulator.
|
||||
// if (setit)
|
||||
{
|
||||
updateFlags();
|
||||
}
|
||||
return setit;
|
||||
}
|
||||
|
||||
BOOL LLViewerObject::setFlagsWithoutUpdate(U32 flags, BOOL state)
|
||||
{
|
||||
BOOL setit = FALSE;
|
||||
if (state)
|
||||
@@ -5556,13 +5541,6 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
|
||||
setit = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// BUG: Sometimes viewer physics and simulator physics get
|
||||
// out of sync. To fix this, always send update to simulator.
|
||||
// if (setit)
|
||||
{
|
||||
updateFlags();
|
||||
}
|
||||
return setit;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,6 @@ public:
|
||||
|
||||
inline void setRotation(const F32 x, const F32 y, const F32 z, BOOL damped = FALSE);
|
||||
inline void setRotation(const LLQuaternion& quat, BOOL damped = FALSE);
|
||||
void sendRotationUpdate() const;
|
||||
|
||||
/*virtual*/ void setNumTEs(const U8 num_tes);
|
||||
/*virtual*/ void setTE(const U8 te, const LLTextureEntry &texture_entry);
|
||||
@@ -483,26 +482,38 @@ public:
|
||||
BOOL permCopy() const;
|
||||
BOOL permMove() const;
|
||||
BOOL permTransfer() const;
|
||||
inline BOOL usePhysics() const { return ((mFlags & FLAGS_USE_PHYSICS) != 0); }
|
||||
inline BOOL flagUsePhysics() const { return ((mFlags & FLAGS_USE_PHYSICS) != 0); }
|
||||
inline BOOL flagObjectAnyOwner() const { return ((mFlags & FLAGS_OBJECT_ANY_OWNER) != 0); }
|
||||
inline BOOL flagObjectYouOwner() const { return ((mFlags & FLAGS_OBJECT_YOU_OWNER) != 0); }
|
||||
inline BOOL flagObjectGroupOwned() const { return ((mFlags & FLAGS_OBJECT_GROUP_OWNED) != 0); }
|
||||
inline BOOL flagObjectOwnerModify() const { return ((mFlags & FLAGS_OBJECT_OWNER_MODIFY) != 0); }
|
||||
inline BOOL flagObjectModify() const { return ((mFlags & FLAGS_OBJECT_MODIFY) != 0); }
|
||||
inline BOOL flagObjectCopy() const { return ((mFlags & FLAGS_OBJECT_COPY) != 0); }
|
||||
inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
|
||||
inline BOOL flagObjectTransfer() const { return ((mFlags & FLAGS_OBJECT_TRANSFER) != 0); }
|
||||
inline BOOL flagObjectPermanent() const { return ((mFlags & FLAGS_AFFECTS_NAVMESH) != 0); }
|
||||
inline BOOL flagCharacter() const { return ((mFlags & FLAGS_CHARACTER) != 0); }
|
||||
inline BOOL flagVolumeDetect() const { return ((mFlags & FLAGS_VOLUME_DETECT) != 0); }
|
||||
inline BOOL flagIncludeInSearch() const { return ((mFlags & FLAGS_INCLUDE_IN_SEARCH) != 0); }
|
||||
inline BOOL flagScripted() const { return ((mFlags & FLAGS_SCRIPTED) != 0); }
|
||||
inline BOOL flagHandleTouch() const { return ((mFlags & FLAGS_HANDLE_TOUCH) != 0); }
|
||||
inline BOOL flagTakesMoney() const { return ((mFlags & FLAGS_TAKES_MONEY) != 0); }
|
||||
inline BOOL flagPhantom() const { return ((mFlags & FLAGS_PHANTOM) != 0); }
|
||||
inline BOOL flagInventoryEmpty() const { return ((mFlags & FLAGS_INVENTORY_EMPTY) != 0); }
|
||||
inline BOOL flagCastShadows() const { return ((mFlags & FLAGS_CAST_SHADOWS) != 0); }
|
||||
inline BOOL flagAllowInventoryAdd() const { return ((mFlags & FLAGS_ALLOW_INVENTORY_DROP) != 0); }
|
||||
inline BOOL flagTemporary() const { return ((mFlags & FLAGS_TEMPORARY) != 0); }
|
||||
inline BOOL flagTemporaryOnRez() const { return ((mFlags & FLAGS_TEMPORARY_ON_REZ) != 0); }
|
||||
inline BOOL flagAnimSource() const { return ((mFlags & FLAGS_ANIM_SOURCE) != 0); }
|
||||
inline BOOL flagCameraSource() const { return ((mFlags & FLAGS_CAMERA_SOURCE) != 0); }
|
||||
inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); }
|
||||
inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
|
||||
|
||||
U8 getPhysicsShapeType() const;
|
||||
inline F32 getPhysicsGravity() const { return mPhysicsGravity; }
|
||||
inline F32 getPhysicsFriction() const { return mPhysicsFriction; }
|
||||
inline F32 getPhysicsDensity() const { return mPhysicsDensity; }
|
||||
inline F32 getPhysicsRestitution() const { return mPhysicsRestitution; }
|
||||
|
||||
bool isPermanentEnforced() const;
|
||||
|
||||
bool getIncludeInSearch() const;
|
||||
void setIncludeInSearch(bool include_in_search);
|
||||
@@ -519,6 +530,7 @@ public:
|
||||
|
||||
void updateFlags(BOOL physics_changed = FALSE);
|
||||
BOOL setFlags(U32 flag, BOOL state);
|
||||
BOOL setFlagsWithoutUpdate(U32 flag, BOOL state);
|
||||
void setPhysicsShapeType(U8 type);
|
||||
void setPhysicsGravity(F32 gravity);
|
||||
void setPhysicsFriction(F32 friction);
|
||||
@@ -610,9 +622,11 @@ public:
|
||||
U32 mGLName; // GL "name" used by selection code
|
||||
BOOL mbCanSelect; // true if user can select this object by clicking
|
||||
|
||||
private:
|
||||
// Grabbed from UPDATE_FLAGS
|
||||
U32 mFlags;
|
||||
|
||||
public:
|
||||
// Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties
|
||||
U8 mPhysicsShapeType;
|
||||
F32 mPhysicsGravity;
|
||||
@@ -690,6 +704,7 @@ protected:
|
||||
F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation
|
||||
F64 mLastMessageUpdateSecs; // Last update from a message from the simulator
|
||||
TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
|
||||
|
||||
// extra data sent from the sim...currently only used for tree species info
|
||||
U8* mData;
|
||||
public://Jay: IDGAF
|
||||
@@ -731,7 +746,6 @@ protected:
|
||||
|
||||
F32 mTimeDilation; // Time dilation sent with the object.
|
||||
F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)
|
||||
LLQuaternion mLastRot; // last rotation received from the simulator
|
||||
|
||||
LLVOJointInfo* mJointInfo;
|
||||
U8 mState; // legacy
|
||||
|
||||
@@ -650,9 +650,9 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i
|
||||
prim_llsd["scale"] = object->getScale().getValue();
|
||||
|
||||
// Flags
|
||||
prim_llsd["shadows"] = object->flagCastShadows();
|
||||
prim_llsd["shadows"] = FALSE;
|
||||
prim_llsd["phantom"] = object->flagPhantom();
|
||||
prim_llsd["physical"] = (BOOL)(object->mFlags & FLAGS_USE_PHYSICS);
|
||||
prim_llsd["physical"] = object->flagUsePhysics();
|
||||
|
||||
// Volume params
|
||||
LLVolumeParams params = object->getVolume()->getParams();
|
||||
@@ -994,9 +994,9 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object)
|
||||
|
||||
object->setScale(prim_llsd["scale"]);
|
||||
|
||||
if (prim_llsd.has("shadows"))
|
||||
/*if (prim_llsd.has("shadows"))
|
||||
if (prim_llsd["shadows"].asInteger() == 1)
|
||||
object->setFlags(FLAGS_CAST_SHADOWS, true);
|
||||
object->setFlags(FLAGS_CAST_SHADOWS, true);*/
|
||||
|
||||
if (prim_llsd.has("phantom"))
|
||||
if (prim_llsd["phantom"].asInteger() == 1)
|
||||
@@ -1068,7 +1068,6 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object)
|
||||
//if (mPrimImportIter != mThisGroup.endMap())
|
||||
// mPrimImportIter++;
|
||||
|
||||
object->sendRotationUpdate();
|
||||
object->sendTEUpdate();
|
||||
object->sendShapeUpdate();
|
||||
LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE | UPD_POSITION);
|
||||
|
||||
@@ -406,9 +406,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
||||
}
|
||||
else if (compressed)
|
||||
{
|
||||
U8 compbuffer[2048];
|
||||
S32 uncompressed_length = 2048;
|
||||
S32 compressed_length;
|
||||
compressed_dp.reset();
|
||||
|
||||
U32 flags = 0;
|
||||
@@ -417,21 +415,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
||||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
|
||||
}
|
||||
|
||||
if (flags & FLAGS_ZLIB_COMPRESSED)
|
||||
{
|
||||
compressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
|
||||
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compbuffer, 0, i);
|
||||
uncompressed_length = 2048;
|
||||
uncompress(compressed_dpbuffer, (unsigned long *)&uncompressed_length,
|
||||
compbuffer, compressed_length);
|
||||
compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
|
||||
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
|
||||
compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
|
||||
}
|
||||
uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
|
||||
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
|
||||
compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
|
||||
|
||||
|
||||
if (update_type != OUT_TERSE_IMPROVED)
|
||||
|
||||
@@ -1562,8 +1562,10 @@ void LLViewerRegion::unpackRegionHandshake()
|
||||
|
||||
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
||||
{
|
||||
capabilityNames.append("AgentState");
|
||||
//capabilityNames.append("AttachmentResources"); //Script limits (llfloaterscriptlimits.cpp)
|
||||
//capabilityNames.append("AvatarPickerSearch"); //Display name/SLID lookup (llfloateravatarpicker.cpp)
|
||||
capabilityNames.append("CharacterProperties");
|
||||
capabilityNames.append("ChatSessionRequest");
|
||||
capabilityNames.append("CopyInventoryFromNotecard");
|
||||
capabilityNames.append("CreateInventoryCategory");
|
||||
@@ -1596,7 +1598,9 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
||||
#if MESH_IMPORT
|
||||
capabilityNames.append("MeshUploadFlag");
|
||||
#endif //MESH_IMPORT
|
||||
capabilityNames.append("NavMeshGenerationStatus");
|
||||
capabilityNames.append("NewFileAgentInventory");
|
||||
capabilityNames.append("ObjectNavMeshProperties");
|
||||
capabilityNames.append("ParcelPropertiesUpdate");
|
||||
capabilityNames.append("ParcelNavigateMedia");
|
||||
capabilityNames.append("ParcelVoiceInfoRequest");
|
||||
@@ -1605,17 +1609,19 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
||||
capabilityNames.append("RemoteParcelRequest");
|
||||
capabilityNames.append("RequestTextureDownload");
|
||||
capabilityNames.append("ResourceCostSelected"); //Unreferenced?
|
||||
capabilityNames.append("RetrieveNavMeshSrc");
|
||||
capabilityNames.append("SearchStatRequest");
|
||||
capabilityNames.append("SearchStatTracking");
|
||||
capabilityNames.append("SendPostcard");
|
||||
capabilityNames.append("SendUserReport");
|
||||
capabilityNames.append("SendUserReportWithScreenshot");
|
||||
capabilityNames.append("ServerReleaseNotes");
|
||||
//capabilityNames.append("SimConsole");
|
||||
capabilityNames.append("SimConsole");
|
||||
capabilityNames.append("SimulatorFeatures");
|
||||
capabilityNames.append("SetDisplayName");
|
||||
//capabilityNames.append("SimConsoleAsync");
|
||||
capabilityNames.append("SimConsoleAsync");
|
||||
capabilityNames.append("StartGroupProposal");
|
||||
capabilityNames.append("TerrainNavMeshProperties");
|
||||
capabilityNames.append("TextureStats");
|
||||
capabilityNames.append("UntrustedSimulatorMessage");
|
||||
capabilityNames.append("UpdateAgentInformation");
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
#include "llmodaldialog.h"
|
||||
#include "llmorphview.h"
|
||||
#include "llmoveview.h"
|
||||
#include "llpanelpathfindingrebakenavmesh.h"
|
||||
#include "llnotify.h"
|
||||
#include "lloverlaybar.h"
|
||||
#include "llpreviewtexture.h"
|
||||
@@ -1958,6 +1959,10 @@ void LLViewerWindow::initWorldUI()
|
||||
// put behind everything else in the UI
|
||||
mRootView->addChildInBack(gHUDView);
|
||||
}
|
||||
|
||||
LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
|
||||
LLPanelPathfindingRebakeNavmesh *panel_rebake_navmesh = LLPanelPathfindingRebakeNavmesh::getInstance();
|
||||
panel_ssf_container->addChild(panel_rebake_navmesh);
|
||||
}
|
||||
|
||||
// initWorldUI that wasn't before logging in. Some of this may require the access the 'LindenUserDir'.
|
||||
@@ -3428,8 +3433,11 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
|
||||
{
|
||||
LLSelectNode* nodep = *iter;
|
||||
LLViewerObject* object = nodep->getObject();
|
||||
LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
|
||||
BOOL this_object_movable = FALSE;
|
||||
if (object->permMove() && (object->permModify() || selecting_linked_set))
|
||||
if (object->permMove() && !object->isPermanentEnforced() &&
|
||||
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
|
||||
(object->permModify() || selecting_linked_set))
|
||||
{
|
||||
moveable_object_selected = TRUE;
|
||||
this_object_movable = TRUE;
|
||||
|
||||
@@ -713,7 +713,7 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
|
||||
LLViewerObject* object = gObjectList.findObject(source_id);
|
||||
if (object)
|
||||
{
|
||||
object->mFlags &= ~FLAGS_ANIM_SOURCE;
|
||||
object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2390,7 +2390,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
produces_light = 1;
|
||||
}
|
||||
|
||||
for (U32 i = 0; i < num_faces; ++i)
|
||||
for (S32 i = 0; i < (S32)num_faces; ++i)
|
||||
{
|
||||
const LLFace* face = drawablep->getFace(i);
|
||||
if (!face) continue;
|
||||
|
||||
@@ -3132,7 +3132,7 @@ void renderPhysicalBeacons(LLDrawable* drawablep)
|
||||
if (vobj
|
||||
&& !vobj->isAvatar()
|
||||
//&& !vobj->getParent()
|
||||
&& vobj->usePhysics())
|
||||
&& vobj->flagUsePhysics())
|
||||
{
|
||||
if (gPipeline.sRenderBeacons)
|
||||
{
|
||||
|
||||
@@ -255,10 +255,6 @@ BOOL handle_ticker_enabled(void *)
|
||||
{
|
||||
return gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData();
|
||||
}
|
||||
BOOL handle_ticker_check(void *)
|
||||
{
|
||||
return SHFloaterMediaTicker::instanceExists();
|
||||
}
|
||||
void handle_ticker_toggle(void *)
|
||||
{
|
||||
if(!handle_ticker_enabled(NULL))
|
||||
|
||||
@@ -54,6 +54,5 @@ private:
|
||||
|
||||
//Menu callbacks.
|
||||
BOOL handle_ticker_enabled(void *);
|
||||
BOOL handle_ticker_check(void *);
|
||||
void handle_ticker_toggle(void *);
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
can_close="true"
|
||||
can_minimize="true"
|
||||
name="region_debug_console"
|
||||
title="Region Debug"
|
||||
can_resize="true"
|
||||
layout="topleft"
|
||||
min_height="300"
|
||||
min_width="300"
|
||||
height="400"
|
||||
width="600"
|
||||
default_tab_group="1">
|
||||
<text_editor
|
||||
left="10"
|
||||
type="string"
|
||||
length="1"
|
||||
follows="all"
|
||||
font="Monospace"
|
||||
bottom="-373"
|
||||
height="353"
|
||||
width="576"
|
||||
ignore_tab="false"
|
||||
layout="topleft"
|
||||
max_length="65536"
|
||||
name="region_debug_console_output"
|
||||
show_line_numbers="false"
|
||||
word_wrap="true"
|
||||
track_bottom="true"
|
||||
enabled="false">
|
||||
</text_editor>
|
||||
<line_editor
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
tab_group="1"
|
||||
follows="left|bottom|right"
|
||||
font="SansSerif"
|
||||
height="19"
|
||||
layout="topleft"
|
||||
bottom_delta="-20"
|
||||
max_length="127"
|
||||
name="region_debug_console_input"
|
||||
width="576" />
|
||||
</floater>
|
||||
@@ -409,7 +409,7 @@
|
||||
mouse_opaque="true" name="perm_modify" v_pad="0" width="250">
|
||||
You can modify this object.
|
||||
</text>
|
||||
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||
<check_box bottom_delta="-16" follows="left|top" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="Share with group" left="10"
|
||||
mouse_opaque="true" name="checkbox share with group"
|
||||
tool_tip="Allow all members of the set group to share and use your permissions for this object. You must Deed to enable role restrictions."
|
||||
@@ -420,21 +420,21 @@
|
||||
<string name="text deed">
|
||||
Deed
|
||||
</string>
|
||||
<button bottom="-186" follows="top|right" font="SansSerifSmall" halign="center"
|
||||
<button bottom_delta="0" follows="top|right" font="SansSerifSmall" halign="center"
|
||||
height="20" label="Deed..." label_selected="Deed..." left_delta="172"
|
||||
mouse_opaque="true" name="button deed" scale_image="TRUE"
|
||||
tool_tip="Group shared objects can be deeded by a group officer."
|
||||
width="78" />
|
||||
<check_box bottom="-206" follows="left|top" font="SansSerifSmall" height="16"
|
||||
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="Allow anyone to move" left="10"
|
||||
mouse_opaque="true" name="checkbox allow everyone move" width="142" />
|
||||
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="Allow anyone to copy" left="10"
|
||||
mouse_opaque="true" name="checkbox allow everyone copy" width="141" />
|
||||
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="Show in search" left="10" name="search_check"
|
||||
tool_tip="Let people see this object in search results" width="78" />
|
||||
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
|
||||
initial_value="false" label="For Sale" left="10" mouse_opaque="true"
|
||||
name="checkbox for sale" width="78" />
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
@@ -446,7 +446,7 @@
|
||||
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
|
||||
follows="left|top|right" font="SansSerifSmall" height="16" left_delta="80"
|
||||
max_length="25" mouse_opaque="true" name="Edit Cost" width="75" />
|
||||
<radio_group bottom="-286" draw_border="false" follows="left|top|right" height="16"
|
||||
<radio_group bottom_delta="-18" draw_border="false" follows="left|top|right" height="16"
|
||||
left="42" mouse_opaque="true" name="sale type" width="218">
|
||||
<radio_item bottom="-16" follows="left|top" height="16" left="0" mouse_opaque="true"
|
||||
name="Original" width="70">
|
||||
@@ -462,7 +462,7 @@
|
||||
</radio_item>
|
||||
</radio_group>
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-298" drop_shadow_visible="true" follows="left|top|right"
|
||||
bottom_delta="-5" drop_shadow_visible="true" follows="left|top|right"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
||||
mouse_opaque="true" name="Next owner can:" v_pad="0" width="250">
|
||||
Next owner can:
|
||||
@@ -477,12 +477,12 @@
|
||||
initial_value="false" label="Resell/Give away" left_delta="60"
|
||||
mouse_opaque="true" name="checkbox next owner can transfer" width="130" />
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-332" drop_shadow_visible="true" follows="left|top"
|
||||
bottom="-334" drop_shadow_visible="true" follows="left|top"
|
||||
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
||||
mouse_opaque="true" name="label click action" v_pad="0" width="150">
|
||||
When Left-Clicked:
|
||||
</text>
|
||||
<combo_box allow_text_entry="false" bottom_delta="-25" follows="left|top" height="18"
|
||||
<combo_box bottom_delta="-24" allow_text_entry="false" follows="left|top" height="20"
|
||||
left="10" max_chars="20" mouse_opaque="true" name="clickaction" width="150">
|
||||
<!-- Do not reorder these items, the index numbers are
|
||||
used internally. JC -->
|
||||
@@ -549,6 +549,40 @@
|
||||
mouse_opaque="true" name="F:" v_pad="0" width="74">
|
||||
F:
|
||||
</text>
|
||||
<panel bottom="-302" border="true" height="155" left="5" width="260" />
|
||||
<panel
|
||||
bottom="-328"
|
||||
border="false"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
mouse_opaque="false"
|
||||
name="pathfinding_attrs_panel"
|
||||
left="0"
|
||||
top_pad="0"
|
||||
height="25"
|
||||
width="290">
|
||||
<text
|
||||
type="string"
|
||||
follows="left|top"
|
||||
name="pathfinding_attributes_label"
|
||||
top_pad="4"
|
||||
width="150"
|
||||
left="10">
|
||||
Pathfinding attributes:
|
||||
</text>
|
||||
<text
|
||||
bottom_delta="0"
|
||||
left_delta="120"
|
||||
type="string"
|
||||
text_color="TextLinkColor"
|
||||
follows="left|top"
|
||||
name="pathfinding_attributes_value"
|
||||
width="130"
|
||||
word_wrap="false"
|
||||
left_pad="0">
|
||||
Test
|
||||
</text>
|
||||
</panel>
|
||||
<string name="text modify info 1">
|
||||
You can modify this object.
|
||||
</string>
|
||||
@@ -561,6 +595,12 @@
|
||||
<string name="text modify info 4">
|
||||
You cannot modify these objects.
|
||||
</string>
|
||||
<string name="text modify info 5">
|
||||
You can't modify this object across a region boundary
|
||||
</string>
|
||||
<string name="text modify info 6">
|
||||
You can't modify these objects across a region boundary
|
||||
</string>
|
||||
<string name="text modify warning">
|
||||
Must select entire object to set permissions.
|
||||
</string>
|
||||
|
||||
@@ -102,6 +102,21 @@
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<template name="okhelpignore">
|
||||
<form>
|
||||
<button
|
||||
default="true"
|
||||
index="0"
|
||||
name="OK"
|
||||
text="$yestext"/>
|
||||
<button
|
||||
index="1"
|
||||
name="Help"
|
||||
text="$helptext"/>
|
||||
<ignore text="$ignoretext"/>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<template name="yesnocancelbuttons">
|
||||
<form>
|
||||
<button
|
||||
@@ -1527,6 +1542,13 @@ Unable to link because you don't have modify permission on all the objects.
|
||||
Please make sure none are locked, and that you own all of them.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="CannotLinkPermanent"
|
||||
type="alertmodal">
|
||||
Objects cannot be linked across region boundaries.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="CannotLinkDifferentOwners"
|
||||
@@ -5942,6 +5964,53 @@ You cannot create objects here.
|
||||
<unique/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="PathfindingDirty"
|
||||
type="notify">
|
||||
<unique/>
|
||||
The region has pending pathfinding changes. If you have build rights, you may rebake the region by clicking on the “Rebake region” button.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="DynamicPathfindingDisabled"
|
||||
type="notify">
|
||||
<unique/>
|
||||
Dynamic pathfinding is not enabled on this region. Scripted objects using pathfinding LSL calls may not operate as expected on this region.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="PathfindingRebakeNavmesh"
|
||||
type="alertmodal">
|
||||
<unique/>
|
||||
Changing certain objects in this region could cause other moving objects to behave incorrectly. To make moving objects behave correctly, click the “Rebake region” button. Choose “Help” for more information.
|
||||
<url
|
||||
option="1"
|
||||
name="url"
|
||||
target = "_external">
|
||||
http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer
|
||||
</url>
|
||||
<usetemplate
|
||||
name="okhelpignore"
|
||||
ignoretext="Changing certain objects in this region could cause other moving objects to behave incorrectly."
|
||||
yestext="OK"
|
||||
helptext="Help"
|
||||
/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="PathfindingCannotRebakeNavmesh"
|
||||
type="alertmodal">
|
||||
<unique/>
|
||||
An error occurred. There may be a network or server problem, or you may not have build rights. Sometimes logging out and back in will solve this problem.
|
||||
<usetemplate
|
||||
name="okbutton"
|
||||
yestext="OK"
|
||||
/>
|
||||
</notification>
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="ScriptsStopped"
|
||||
@@ -7072,6 +7141,19 @@ You locally updated a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME]
|
||||
- Your CPU speed does not meet the minimum requirements.
|
||||
</global>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="PathfindingLinksets_ChangeToFlexiblePath"
|
||||
type="alertmodal">
|
||||
The selected object affects the navmesh. Changing it to a Flexible Path will remove it from the navmesh.
|
||||
<tag>confirm</tag>
|
||||
<usetemplate
|
||||
ignoretext="The selected object affects the navmesh. Changing it to a Flexible Path will remove it from the navmesh."
|
||||
name="okcancelignore"
|
||||
notext="Cancel"
|
||||
yestext="OK"/>
|
||||
</notification>
|
||||
|
||||
<global name="UnsupportedGLRequirements">
|
||||
You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system.
|
||||
</global>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel
|
||||
height="25"
|
||||
layout="topleft"
|
||||
name="panel_navmesh_rebake"
|
||||
mouse_opaque="false"
|
||||
visible="true"
|
||||
follows="none"
|
||||
width="133">
|
||||
<button
|
||||
follows="none"
|
||||
height="20"
|
||||
label="Rebake region"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="navmesh_btn"
|
||||
tool_tip="Click to rebake the region's navmesh."
|
||||
bottom="-25"
|
||||
visible="false"
|
||||
enabled="true"
|
||||
width="120" />
|
||||
<button
|
||||
follows="none"
|
||||
height="20"
|
||||
label="Requesting rebake"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="navmesh_btn_sending"
|
||||
tool_tip="Sending rebake request to the server."
|
||||
bottom="-25"
|
||||
visible="false"
|
||||
enabled="false"
|
||||
width="120" />
|
||||
<button
|
||||
follows="left|bottom"
|
||||
height="20"
|
||||
label="Region is rebaking"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="navmesh_btn_baking"
|
||||
tool_tip="Region is being rebaked. When completed, this button will disappear."
|
||||
bottom="-25"
|
||||
visible="false"
|
||||
enabled="false"
|
||||
width="120" />
|
||||
</panel>
|
||||
@@ -14,8 +14,8 @@
|
||||
name="padding" use_bounding_rect="true" user_resize="false" width="420" />
|
||||
<layout_panel auto_resize="false" bottom="0" follows="left|bottom|right|top" height="20"
|
||||
left="0" min_height="20" min_width="100" mouse_opaque="false"
|
||||
name="state_buttons" use_bounding_rect="true" user_resize="false"
|
||||
width="420">
|
||||
name="state_management_buttons_container" use_bounding_rect="true" user_resize="false"
|
||||
width="799">
|
||||
<button bottom="1" follows="left|bottom" font="SansSerif" halign="center" height="20"
|
||||
label="New IM" label_selected="New IM" left="0"
|
||||
name="New IM" scale_image="true"
|
||||
@@ -25,7 +25,7 @@
|
||||
label="Set Not Busy" label_selected="Set Not Busy" left="114"
|
||||
name="Set Not Busy" scale_image="true"
|
||||
tool_tip="Chat and IM is hidden for you. Click here to set yourself not busy."
|
||||
width="102" />
|
||||
width="112" />
|
||||
<button bottom="1" follows="left|bottom" font="SansSerif" halign="center" height="20"
|
||||
label="Flycam" label_selected="Flycam" left="229" name="Flycam" scale_image="true"
|
||||
tool_tip="Your camera is under joystick control, click here to release it."
|
||||
|
||||
@@ -1966,6 +1966,13 @@ Try enclosing path to the editor with double quotes.
|
||||
<string name="ExternalEditorCommandParseError">Error parsing the external editor command.</string>
|
||||
<string name="ExternalEditorFailedToRun">External editor failed to run.</string>
|
||||
|
||||
<!-- Pathfinding -->
|
||||
<string name="Pathfinding_Wiki_URL">http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer</string>
|
||||
<string name="Pathfinding_Object_Attr_None">None</string>
|
||||
<string name="Pathfinding_Object_Attr_Permanent">Affects navmesh</string>
|
||||
<string name="Pathfinding_Object_Attr_Character">Character</string>
|
||||
<string name="Pathfinding_Object_Attr_MultiSelect">(Multiple)</string>
|
||||
|
||||
<!-- Addition of OSSL commands for use in OpenSimulator based regions, including Aurora -->
|
||||
<string name="LSLTipText_osSetRegionWaterHeight">
|
||||
osSetRegionWaterHeight(float height)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<layout_panel min_width="410" name="main_panel" width="410">
|
||||
<layout_stack name="chatbar_and_buttons" right="410">
|
||||
<layout_panel name="padding" width="410"/>
|
||||
<layout_panel name="state_buttons" width="410">
|
||||
<layout_panel name="state_management_buttons_container" width="410">
|
||||
|
||||
<button label="Disponible" label_selected="Disponible" name="Set Not Busy" tool_tip="Le chat et les IM ne s'affichent pas. Cliquez ici pour ne plus être en mode occupé(e)."/>
|
||||
<button label="Flycam" label_selected="Flycam" name="Flycam" tool_tip="Votre caméra est contrôlée par le joystick, cliquez ici pour la libérer."/>
|
||||
|
||||
Reference in New Issue
Block a user