[RLVa] @camunlock
Causes LLAgentCamera::unlockView() to not happen, this turns off camera orbits. Enables sim camera constraints regardless of user preference. Resets camera when turned on.
This commit is contained in:
@@ -369,6 +369,8 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera)
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLAgentCamera::unlockView()
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) return; // [RLVa:LF] - camunlock
|
||||
|
||||
if (getFocusOnAvatar())
|
||||
{
|
||||
if (isAgentAvatarValid())
|
||||
@@ -1853,7 +1855,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
|
||||
|
||||
static const LLCachedControl<bool> sg_ignore_sim_cam_consts("SGIgnoreSimulatorCameraConstraints",false);
|
||||
if ( !mCameraCollidePlane.isExactlyZero()
|
||||
&& !sg_ignore_sim_cam_consts
|
||||
&& (!sg_ignore_sim_cam_consts || gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK))
|
||||
&& isAgentAvatarValid()
|
||||
&& !gAgentAvatarp->isSitting())
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "llvoavatarself.h"
|
||||
#include "llmorphview.h"
|
||||
#include "llfloatercustomize.h"
|
||||
#include "rlvhandler.h" // [RLVa:LF] - camunlock
|
||||
|
||||
// Globals
|
||||
BOOL gCameraBtnZoom = TRUE;
|
||||
@@ -200,6 +201,8 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
|
||||
else if (pick_info.mKeyMask & MASK_ALT ||
|
||||
(LLToolMgr::getInstance()->getCurrentTool()->getName() == "Camera"))
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) return; // [RLVa:LF] - camunlock
|
||||
|
||||
LLViewerObject* hit_obj = pick_info.getObject();
|
||||
if (hit_obj)
|
||||
{
|
||||
|
||||
@@ -95,6 +95,9 @@ RlvUIEnabler::RlvUIEnabler()
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWWORLDMAP, boost::bind(&RlvUIEnabler::onToggleShowWorldMap, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onToggleUnsit, this)));
|
||||
|
||||
// onToggleCamXXX
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_CAMUNLOCK, boost::bind(&RlvUIEnabler::onToggleCamUnlock, this)));
|
||||
|
||||
// onToggleTp
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onToggleTp, this)));
|
||||
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLM, boost::bind(&RlvUIEnabler::onToggleTp, this)));
|
||||
@@ -346,6 +349,13 @@ void RlvUIEnabler::onToggleShowWorldMap()
|
||||
LLFloaterWorldMap::toggle();
|
||||
}
|
||||
|
||||
// Checked: 2015-05-25 (RLVa:LF)
|
||||
void RlvUIEnabler::onToggleCamUnlock()
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK))
|
||||
gAgentCamera.resetView(true, true);
|
||||
}
|
||||
|
||||
// Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
|
||||
void RlvUIEnabler::onToggleTp()
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ protected:
|
||||
void onToggleShowNames(bool fQuitting); // shownames
|
||||
void onToggleShowNameTags(bool fQuitting); // shownametags
|
||||
void onToggleShowWorldMap(); // showworldmap
|
||||
void onToggleCamUnlock(); // camunlock
|
||||
void onToggleTp(); // tploc and tplm
|
||||
void onToggleUnsit(); // unsit
|
||||
void onToggleViewXXX(); // viewnote, viewscript, viewtexture
|
||||
|
||||
Reference in New Issue
Block a user