newview V3 partial merge.

This commit is contained in:
Shyotl
2011-08-30 01:05:59 -05:00
parent 8d23a7d1d4
commit fd317a4092
29 changed files with 390 additions and 350 deletions

View File

@@ -59,7 +59,7 @@ class LLVolumeTriangle;
#include "llquaternion.h"
#include "llstrider.h"
#include "v4coloru.h"
#include "llmemory.h"
#include "llrefcount.h"
#include "llfile.h"
//============================================================================

View File

@@ -116,7 +116,6 @@ set(viewer_SOURCE_FILES
llassetuploadqueue.cpp
llattachmentsmgr.cpp
llaudiosourcevo.cpp
llbbox.cpp
llbox.cpp
llbuildnewviewsscheduler.cpp
llcallbacklist.cpp
@@ -597,7 +596,6 @@ set(viewer_HEADER_FILES
llassetuploadqueue.h
llattachmentsmgr.h
llaudiosourcevo.h
llbbox.h
llbox.h
llbuildnewviewsscheduler.h
llcallbacklist.h

View File

@@ -65,34 +65,25 @@ public:
{
llwarns << "Error on fetched data"<< llendl;
clearPendingRequests();
return;
}
bool containsSelection = content.has("selected");
if ( containsSelection )
else if (content.has("selected"))
{
S32 dataCount = content["selected"].size();
F32 physicsCost = 0.0f;
F32 networkCost = 0.0f;
F32 simulationCost = 0.0f;
//LLTransactionID transactionID;
for(S32 i = 0; i < dataCount; i++)
{
//transactionID = content["selected"][i]["local_id"].asUUID();
physicsCost = content["selected"]["physics"].asReal();
networkCost = content["selected"]["streaming"].asReal();
simulationCost = content["selected"]["simulation"].asReal();
F32 physicsCost = 0.0f;
F32 networkCost = 0.0f;
F32 simulationCost = 0.0f;
SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
//LLTransactionID transactionID;
//transactionID = content["selected"][i]["local_id"].asUUID();
physicsCost = content["selected"][i]["physics"].asReal();
networkCost = content["selected"][i]["streaming"].asReal();
simulationCost = content["selected"][i]["simulation"].asReal();
SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
//How do you want to handle the updating of the invoking object/ui element?
}
}
clearPendingRequests();
}
private:
@@ -116,7 +107,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const st
// Check to see if a request for this object has already been made.
if ( mPendingObjectQuota.find( *IDIter ) == mPendingObjectQuota.end() )
{
mObjectList.insert( *IDIter );
mPendingObjectQuota.insert( *IDIter );
objectList[objectIndex++] = *IDIter;
}
}
@@ -134,7 +125,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const st
else
if ( selectionType == Prims )
{
keystr="prim_roots";
keystr="selected_prims";
}
else
{

View File

@@ -248,7 +248,8 @@ LLAgent::LLAgent() :
mFirstLogin(FALSE),
mGenderChosen(FALSE),
mAppearanceSerialNum(0),
mMouselookModeInSignal(NULL),
mMouselookModeOutSignal(NULL),
mPendingLure(NULL)
{
for (U32 i = 0; i < TOTAL_CONTROLS; i++)
@@ -295,6 +296,11 @@ LLAgent::~LLAgent()
{
cleanup();
delete mMouselookModeInSignal;
mMouselookModeInSignal = NULL;
delete mMouselookModeOutSignal;
mMouselookModeOutSignal = NULL;
delete mAgentAccess;
mAgentAccess = NULL;
delete mEffectColor;
@@ -544,7 +550,7 @@ void LLAgent::setFlying(BOOL fly)
{
if (isAgentAvatarValid())
{
if(mAvatarObject->mSignaledAnimations.find(ANIM_AGENT_STANDUP) != mAvatarObject->mSignaledAnimations.end())
if(fly && mAvatarObject->mSignaledAnimations.find(ANIM_AGENT_STANDUP) != mAvatarObject->mSignaledAnimations.end())
{
return;
}
@@ -1846,6 +1852,11 @@ void LLAgent::endAnimationUpdateUI()
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
if (mMouselookModeOutSignal)
{
(*mMouselookModeOutSignal)();
}
// Only pop if we have pushed...
if (TRUE == mViewsPushed)
{
@@ -1938,6 +1949,10 @@ void LLAgent::endAnimationUpdateUI()
mViewsPushed = TRUE;
if (mMouselookModeInSignal)
{
(*mMouselookModeInSignal)();
}
gFloaterView->pushVisibleAll(FALSE, get_skip_list());
if( gMorphView )
@@ -2028,6 +2043,17 @@ void LLAgent::endAnimationUpdateUI()
gAgentCamera.updateLastCamera();
}
boost::signals2::connection LLAgent::setMouselookModeInCallback( const camera_signal_t::slot_type& cb )
{
if (!mMouselookModeInSignal) mMouselookModeInSignal = new camera_signal_t();
return mMouselookModeInSignal->connect(cb);
}
boost::signals2::connection LLAgent::setMouselookModeOutCallback( const camera_signal_t::slot_type& cb )
{
if (!mMouselookModeOutSignal) mMouselookModeOutSignal = new camera_signal_t();
return mMouselookModeOutSignal->connect(cb);
}
//-----------------------------------------------------------------------------
// heardChat()
@@ -2198,6 +2224,11 @@ bool LLAgent::isGodlike() const
return mAgentAccess->isGodlike();
}
bool LLAgent::isGodlikeWithoutAdminMenuFakery() const
{
return mAgentAccess->isGodlikeWithoutAdminMenuFakery();
}
U8 LLAgent::getGodLevel() const
{
return mAgentAccess->getGodLevel();
@@ -3202,7 +3233,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
{
gAgentQueryManager.mNumPendingQueries--;
if (!isAgentAvatarValid())
if (!isAgentAvatarValid() || gAgent.getAvatarObject()->isDead())
{
llwarns << "No avatar for user in cached texture update!" << llendl;
return;
@@ -3943,6 +3974,16 @@ void LLAgent::sendAgentDataUpdateRequest()
sendReliableMessage();
}
void LLAgent::sendAgentUserInfoRequest()
{
if(getID().isNull())
return; // not logged in
gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
sendReliableMessage();
}
void LLAgent::observeFriends()
{
@@ -4006,6 +4047,18 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename)
}//end for (all message sets in xml file)
}
void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility )
{
gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gAgent.sendReliableMessage();
}
// Draw a representation of current autopilot target
void LLAgent::renderAutoPilotTarget()
{

View File

@@ -47,6 +47,8 @@
#include "llinventorymodel.h"
#include "v3dmath.h"
#include <boost/signals2.hpp>
extern const BOOL ANIMATE;
extern const U8 AGENT_STATE_TYPING; // Typing indication
extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected
@@ -108,8 +110,7 @@ public:
//--------------------------------------------------------------------
public:
LLAgent();
~LLAgent();
virtual ~LLAgent();
void init();
void cleanup();
@@ -453,6 +454,14 @@ public:
void unpauseAnimation() { mPauseRequest = NULL; }
BOOL getCustomAnim() const { return mCustomAnim; }
void setCustomAnim(BOOL anim) { mCustomAnim = anim; }
typedef boost::signals2::signal<void ()> camera_signal_t;
boost::signals2::connection setMouselookModeInCallback( const camera_signal_t::slot_type& cb );
boost::signals2::connection setMouselookModeOutCallback( const camera_signal_t::slot_type& cb );
private:
camera_signal_t* mMouselookModeInSignal;
camera_signal_t* mMouselookModeOutSignal;
BOOL mCustomAnim; // Current animation is ANIM_AGENT_CUSTOMIZE ?
LLPointer<LLPauseRequestHandle> mPauseRequest;
BOOL mViewsPushed; // Keep track of whether or not we have pushed views
@@ -499,8 +508,16 @@ public:
// Autopilot
//--------------------------------------------------------------------
public:
BOOL getAutoPilot() const { return mAutoPilot; }
LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; }
BOOL getAutoPilot() const { return mAutoPilot; }
LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; }
LLUUID getAutoPilotLeaderID() const { return mLeaderID; }
F32 getAutoPilotStopDistance() const { return mAutoPilotStopDistance; }
F32 getAutoPilotTargetDist() const { return mAutoPilotTargetDist; }
BOOL getAutoPilotUseRotation() const { return mAutoPilotUseRotation; }
LLVector3 getAutoPilotTargetFacing() const { return mAutoPilotTargetFacing; }
F32 getAutoPilotRotationThreshold() const { return mAutoPilotRotationThreshold; }
std::string getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; }
void startAutoPilotGlobal(const LLVector3d &pos_global,
const std::string& behavior_name = std::string(),
const LLQuaternion *target_rotation = NULL,
@@ -620,6 +637,7 @@ private:
//--------------------------------------------------------------------
public:
bool isGodlike() const;
bool isGodlikeWithoutAdminMenuFakery() const;
U8 getGodLevel() const;
void setAdminOverride(BOOL b);
void setGodLevel(U8 god_level);
@@ -773,7 +791,10 @@ public:
void sendReliableMessage();
void sendAgentSetAppearance();
void sendAgentDataUpdateRequest();
void sendAgentUserInfoRequest();
// IM to Email and Online visibility
void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility);
//--------------------------------------------------------------------
// Receive
//--------------------------------------------------------------------

View File

@@ -69,6 +69,15 @@ bool LLAgentAccess::isGodlike() const
#endif
}
bool LLAgentAccess::isGodlikeWithoutAdminMenuFakery() const
{
#ifdef HACKED_GODLIKE_VIEWER
return true;
#else
return mGodLevel > GOD_NOT;
#endif
}
U8 LLAgentAccess::getGodLevel() const
{
#ifdef HACKED_GODLIKE_VIEWER
@@ -163,6 +172,20 @@ int LLAgentAccess::convertTextToMaturity(char text)
void LLAgentAccess::setMaturity(char text)
{
mAccess = LLAgentAccess::convertTextToMaturity(text);
U32 preferred_access = mSavedSettings.getU32("PreferredMaturity");
while (!canSetMaturity(preferred_access))
{
if (preferred_access == SIM_ACCESS_ADULT)
{
preferred_access = SIM_ACCESS_MATURE;
}
else
{
// Mature or invalid access gets set to PG
preferred_access = SIM_ACCESS_PG;
}
}
mSavedSettings.setU32("PreferredMaturity", preferred_access);
}
void LLAgentAccess::setTransition()
@@ -175,3 +198,14 @@ bool LLAgentAccess::isInTransition() const
return mAOTransition;
}
bool LLAgentAccess::canSetMaturity(S32 maturity)
{
if (isGodlike()) // Gods can always set their Maturity level
return true;
if (isAdult()) // Adults can always set their Maturity level
return true;
if (maturity == SIM_ACCESS_PG || (maturity == SIM_ACCESS_MATURE && isMature()))
return true;
else
return false;
}

View File

@@ -48,6 +48,7 @@ public:
void setGodLevel(U8 god_level);
bool isGodlike() const;
bool isGodlikeWithoutAdminMenuFakery() const;
U8 getGodLevel() const;
@@ -71,6 +72,7 @@ public:
void setTransition(); // sets the transition bit, which defaults to false
bool isInTransition() const;
bool canSetMaturity(S32 maturity);
private:
U8 mAccess; // SIM_ACCESS_MATURE etc

View File

@@ -1,162 +0,0 @@
/**
* @file llbbox.cpp
* @brief General purpose bounding box class (Not axis aligned)
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
// self include
#include "llbbox.h"
// library includes
#include "m4math.h"
void LLBBox::addPointLocal(const LLVector3& p)
{
if (mEmpty)
{
mMinLocal = p;
mMaxLocal = p;
mEmpty = FALSE;
}
else
{
mMinLocal.mV[VX] = llmin( p.mV[VX], mMinLocal.mV[VX] );
mMinLocal.mV[VY] = llmin( p.mV[VY], mMinLocal.mV[VY] );
mMinLocal.mV[VZ] = llmin( p.mV[VZ], mMinLocal.mV[VZ] );
mMaxLocal.mV[VX] = llmax( p.mV[VX], mMaxLocal.mV[VX] );
mMaxLocal.mV[VY] = llmax( p.mV[VY], mMaxLocal.mV[VY] );
mMaxLocal.mV[VZ] = llmax( p.mV[VZ], mMaxLocal.mV[VZ] );
}
}
void LLBBox::addPointAgent( LLVector3 p)
{
p -= mPosAgent;
p.rotVec( ~mRotation );
addPointLocal( p );
}
void LLBBox::addBBoxAgent(const LLBBox& b)
{
if (mEmpty)
{
mPosAgent = b.mPosAgent;
mRotation = b.mRotation;
mMinLocal.clearVec();
mMaxLocal.clearVec();
}
LLVector3 vertex[8];
vertex[0].setVec( b.mMinLocal.mV[VX], b.mMinLocal.mV[VY], b.mMinLocal.mV[VZ] );
vertex[1].setVec( b.mMinLocal.mV[VX], b.mMinLocal.mV[VY], b.mMaxLocal.mV[VZ] );
vertex[2].setVec( b.mMinLocal.mV[VX], b.mMaxLocal.mV[VY], b.mMinLocal.mV[VZ] );
vertex[3].setVec( b.mMinLocal.mV[VX], b.mMaxLocal.mV[VY], b.mMaxLocal.mV[VZ] );
vertex[4].setVec( b.mMaxLocal.mV[VX], b.mMinLocal.mV[VY], b.mMinLocal.mV[VZ] );
vertex[5].setVec( b.mMaxLocal.mV[VX], b.mMinLocal.mV[VY], b.mMaxLocal.mV[VZ] );
vertex[6].setVec( b.mMaxLocal.mV[VX], b.mMaxLocal.mV[VY], b.mMinLocal.mV[VZ] );
vertex[7].setVec( b.mMaxLocal.mV[VX], b.mMaxLocal.mV[VY], b.mMaxLocal.mV[VZ] );
LLMatrix4 m( b.mRotation );
m.translate( b.mPosAgent );
m.translate( -mPosAgent );
m.rotate( ~mRotation );
for( S32 i=0; i<8; i++ )
{
addPointLocal( vertex[i] * m );
}
}
void LLBBox::expand( F32 delta )
{
mMinLocal.mV[VX] -= delta;
mMinLocal.mV[VY] -= delta;
mMinLocal.mV[VZ] -= delta;
mMaxLocal.mV[VX] += delta;
mMaxLocal.mV[VY] += delta;
mMaxLocal.mV[VZ] += delta;
}
LLVector3 LLBBox::localToAgent(const LLVector3& v) const
{
LLMatrix4 m( mRotation );
m.translate( mPosAgent );
return v * m;
}
LLVector3 LLBBox::agentToLocal(const LLVector3& v) const
{
LLMatrix4 m;
m.translate( -mPosAgent );
m.rotate( ~mRotation ); // inverse rotation
return v * m;
}
LLVector3 LLBBox::localToAgentBasis(const LLVector3& v) const
{
LLMatrix4 m( mRotation );
return v * m;
}
LLVector3 LLBBox::agentToLocalBasis(const LLVector3& v) const
{
LLMatrix4 m( ~mRotation ); // inverse rotation
return v * m;
}
BOOL LLBBox::containsPointLocal(const LLVector3& p) const
{
if ( (p.mV[VX] < mMinLocal.mV[VX])
||(p.mV[VX] > mMaxLocal.mV[VX])
||(p.mV[VY] < mMinLocal.mV[VY])
||(p.mV[VY] > mMaxLocal.mV[VY])
||(p.mV[VZ] < mMinLocal.mV[VZ])
||(p.mV[VZ] > mMaxLocal.mV[VZ]))
{
return FALSE;
}
return TRUE;
}
BOOL LLBBox::containsPointAgent(const LLVector3& p) const
{
LLVector3 point_local = agentToLocal(p);
return containsPointLocal(point_local);
}
/*
LLBBox operator*(const LLBBox &a, const LLMatrix4 &b)
{
return LLBBox( a.mMin * b, a.mMax * b );
}
*/

View File

@@ -1,105 +0,0 @@
/**
* @file llbbox.h
* @brief General purpose bounding box class
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_BBOX_H
#define LL_BBOX_H
#include "v3math.h"
#include "llquaternion.h"
// Note: "local space" for an LLBBox is defined relative to agent space in terms of
// a translation followed by a rotation. There is no scale term since the LLBBox's min and
// max are not necessarily symetrical and define their own extents.
class LLBBox
{
public:
LLBBox() {mEmpty = TRUE;}
LLBBox( const LLVector3& pos_agent,
const LLQuaternion& rot,
const LLVector3& min_local,
const LLVector3& max_local )
:
mMinLocal( min_local ), mMaxLocal( max_local ), mPosAgent(pos_agent), mRotation( rot), mEmpty( TRUE )
{}
// Default copy constructor is OK.
const LLVector3& getPositionAgent() const { return mPosAgent; }
const LLQuaternion& getRotation() const { return mRotation; }
const LLVector3& getMinLocal() const { return mMinLocal; }
void setMinLocal( const LLVector3& min ) { mMinLocal = min; }
const LLVector3& getMaxLocal() const { return mMaxLocal; }
void setMaxLocal( const LLVector3& max ) { mMaxLocal = max; }
LLVector3 getCenterLocal() const { return (mMaxLocal - mMinLocal) * 0.5f + mMinLocal; }
LLVector3 getCenterAgent() const { return localToAgent( getCenterLocal() ); }
LLVector3 getExtentLocal() const { return mMaxLocal - mMinLocal; }
BOOL containsPointLocal(const LLVector3& p) const;
BOOL containsPointAgent(const LLVector3& p) const;
BOOL intersects(const LLBBox& b) const;
void addPointAgent(LLVector3 p);
void addBBoxAgent(const LLBBox& b);
void addPointLocal(const LLVector3& p);
void addBBoxLocal(const LLBBox& b) { addPointLocal( b.mMinLocal ); addPointLocal( b.mMaxLocal ); }
void expand( F32 delta );
LLVector3 localToAgent( const LLVector3& v ) const;
LLVector3 agentToLocal( const LLVector3& v ) const;
// Changes rotation but not position
LLVector3 localToAgentBasis(const LLVector3& v) const;
LLVector3 agentToLocalBasis(const LLVector3& v) const;
// friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
private:
LLVector3 mMinLocal;
LLVector3 mMaxLocal;
LLVector3 mPosAgent; // Position relative to Agent's Region
LLQuaternion mRotation;
BOOL mEmpty; // Nothing has been added to this bbox yet
};
//LLBBox operator*(const LLBBox &a, const LLMatrix4 &b);
#endif // LL_BBOX_H

View File

@@ -330,7 +330,11 @@ void LLColorSwatchCtrl::showPicker(BOOL take_focus)
if (!pickerp)
{
pickerp = new LLFloaterColorPicker(this, mCanApplyImmediately);
gFloaterView->getParentFloater(this)->addDependentFloater(pickerp);
LLFloater* parent = gFloaterView->getParentFloater(this);
if (parent)
{
parent->addDependentFloater(pickerp);
}
mPickerHandle = pickerp->getHandle();
}

View File

@@ -37,7 +37,6 @@
#include "lldrawable.h"
#include "llface.h"
#include "llsky.h"
#include "llviewerwindow.h"
#include "llvotree.h"
#include "pipeline.h"
#include "llviewercamera.h"

View File

@@ -39,6 +39,7 @@
#include "llviewerobject.h"
#include "lldrawable.h"
#include "llvector4a.h"
#include "llviewercamera.h"
#include "llviewertexture.h"
#include "llviewerwindow.h"
@@ -73,7 +74,6 @@ LLHUDIcon::LLHUDIcon(const U8 type) :
mScale(0.1f),
mHidden(FALSE)
{
llassert(this);
sIconInstances.push_back(this);
}
@@ -146,9 +146,9 @@ void LLHUDIcon::renderIcon(BOOL for_select)
alpha_factor *= clamp_rescale(time_elapsed, MAX_VISIBLE_TIME - FADE_OUT_TIME, MAX_VISIBLE_TIME, 1.f, 0.f);
}
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight();
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec;
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ;
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * y_pixel_vec;
LLVector3 lower_left = icon_position - (x_scale * 0.5f);
LLVector3 lower_right = icon_position + (x_scale * 0.5f);
@@ -258,27 +258,46 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
return FALSE;
}
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight();
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec;
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ;
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * y_pixel_vec;
LLVector3 lower_left = icon_position - (x_scale * 0.5f);
LLVector3 lower_right = icon_position + (x_scale * 0.5f);
LLVector3 upper_left = icon_position - (x_scale * 0.5f) + y_scale;
LLVector3 upper_right = icon_position + (x_scale * 0.5f) + y_scale;
LLVector4a x_scalea;
LLVector4a icon_positiona;
LLVector4a y_scalea;
F32 t = 0.f;
LLVector3 dir = end-start;
x_scalea.load3(x_scale.mV);
x_scalea.mul(0.5f);
y_scalea.load3(y_scale.mV);
F32 a,b;
icon_positiona.load3(icon_position.mV);
if (LLTriangleRayIntersect(upper_right, upper_left, lower_right, start, dir, a, b, t, FALSE) ||
LLTriangleRayIntersect(upper_left, lower_left, lower_right, start, dir, a, b, t, FALSE))
LLVector4a lower_left;
lower_left.setSub(icon_positiona, x_scalea);
LLVector4a lower_right;
lower_right.setAdd(icon_positiona, x_scalea);
LLVector4a upper_left;
upper_left.setAdd(lower_left, y_scalea);
LLVector4a upper_right;
upper_right.setAdd(lower_right, y_scalea);
LLVector4a enda;
enda.load3(end.mV);
LLVector4a starta;
starta.load3(start.mV);
LLVector4a dir;
dir.setSub(enda, starta);
F32 a,b,t;
if (LLTriangleRayIntersect(upper_right, upper_left, lower_right, starta, dir, a,b,t) ||
LLTriangleRayIntersect(upper_left, lower_left, lower_right, starta, dir, a,b,t))
{
if (intersection)
{
*intersection = start + dir*t;
dir.mul(t);
starta.add(dir);
*intersection = LLVector3(starta.getF32ptr());
}
return TRUE;
}

View File

@@ -33,7 +33,7 @@
#ifndef LL_LLHUDICON_H
#define LL_LLHUDICON_H
#include "llmemory.h"
#include "llpointer.h"
#include "lldarrayptr.h"
#include "llhudobject.h"

View File

@@ -1108,8 +1108,11 @@ BOOL LLManipRotate::updateVisiblity()
mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag;
mCenterToProfilePlane = -mCenterToProfilePlaneMag * mCenterToCamNorm;
mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWindowWidth()),
(S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWindowHeight()));
// x axis range is (-aspect * 0.5f, +aspect * 0.5)
// y axis range is (-0.5, 0.5)
// so use getWorldViewHeightRaw as scale factor when converting to pixel coordinates
mCenterScreen.set((S32)((0.5f - center.mV[VY]) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()),
(S32)((center.mV[VZ] + 0.5f) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()));
visible = TRUE;
}
else
@@ -1129,7 +1132,7 @@ BOOL LLManipRotate::updateVisiblity()
if (gSavedSettings.getBOOL("LimitSelectDistance"))
{
F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance");
if (dist_vec(gAgent.getPositionAgent(), center) > max_select_distance)
if (dist_vec_squared(gAgent.getPositionAgent(), center) > (max_select_distance * max_select_distance))
{
visible = FALSE;
}
@@ -1625,8 +1628,8 @@ void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_
{
if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD)
{
F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgentCamera.mHUDCurZoom;
F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgentCamera.mHUDCurZoom;
F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewRectScaled().getWidth()) - 0.5f) / gAgentCamera.mHUDCurZoom;
F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewRectScaled().getHeight()) - 0.5f) / gAgentCamera.mHUDCurZoom;
*ray_pt = LLVector3(-1.f, -mouse_x, mouse_y);
*ray_dir = LLVector3(1.f, 0.f, 0.f);
@@ -1700,7 +1703,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y )
F32 dist_y = mouse_dir_y.normVec();
F32 dist_z = mouse_dir_z.normVec();
F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWindowHeight();
F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWorldViewHeightScaled();
if (llabs(dist_x - mRadiusMeters) * llmax(0.05f, proj_rot_x_axis) < distance_threshold)
{

View File

@@ -1393,7 +1393,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
else
{
F32 object_distance = dist_vec(mScaleCenter, LLViewerCamera::getInstance()->getOrigin());
mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWindowWidth() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWorldViewWidthRaw() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
LLVector3 cam_at_axis;
F32 snap_guide_length;
@@ -1406,7 +1406,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
{
cam_at_axis = LLViewerCamera::getInstance()->getAtAxis();
F32 manipulator_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin());
snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWindowWidth() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWorldViewWidthRaw() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
mSnapGuideLength = snap_guide_length / llmax(0.1f, (llmin(mSnapGuideDir1 * cam_at_axis, mSnapGuideDir2 * cam_at_axis)));

View File

@@ -2195,7 +2195,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
if (last_lod >= 0)
{
LLVolume* lod = group->refLOD(last_lod);
if (lod && !lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
{
group->derefLOD(lod);
return last_lod;
@@ -2207,7 +2207,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
for (S32 i = detail-1; i >= 0; --i)
{
LLVolume* lod = group->refLOD(i);
if (lod && !lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
{
group->derefLOD(lod);
return i;
@@ -2220,7 +2220,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
for (S32 i = detail+1; i < 4; ++i)
{
LLVolume* lod = group->refLOD(i);
if (lod && !lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
{
group->derefLOD(lod);
return i;

View File

@@ -33,7 +33,8 @@
#ifndef LLPARCELSELECTION_H
#define LLPARCELSELECTION_H
#include "llmemory.h"
#include "llrefcount.h"
#include "llsafehandle.h"
class LLParcel;

View File

@@ -1530,7 +1530,7 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
LLGLEnable clamp(use_depth_clamp ? GL_DEPTH_CLAMP : 0);
#if !LL_DARWIN
U32 mode = gGLManager.mHasOcclusionQuery2 ? /*GL_ANY_SAMPLES_PASSED*/0x8C2F : GL_SAMPLES_PASSED_ARB;
U32 mode = gGLManager.mHasOcclusionQuery2 ? GL_ANY_SAMPLES_PASSED : GL_SAMPLES_PASSED_ARB;
#else
U32 mode = GL_SAMPLES_PASSED_ARB;
#endif

View File

@@ -35,7 +35,6 @@
#include "lltoolgun.h"
#include "llviewerwindow.h"
#include "llwindow.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llviewercontrol.h"
@@ -50,6 +49,9 @@
#include "lltoolmgr.h"
#include "lltoolgrab.h"
// Linden library includes
#include "llwindow.h" // setMouseClipping()
LLToolGun::LLToolGun( LLToolComposite* composite )
: LLTool( std::string("gun"), composite ),
mIsSelected(FALSE)
@@ -139,7 +141,7 @@ void LLToolGun::draw()
{
LLUIImagePtr crosshair = LLUI::getUIImage("UIImgCrosshairsUUID");
crosshair->draw(
( gViewerWindow->getWindowWidth() - crosshair->getWidth() ) / 2,
( gViewerWindow->getWindowHeight() - crosshair->getHeight() ) / 2);
( gViewerWindow->getWorldViewRectScaled().getWidth() - crosshair->getWidth() ) / 2,
( gViewerWindow->getWorldViewRectScaled().getHeight() - crosshair->getHeight() ) / 2);
}
}

View File

@@ -36,6 +36,7 @@
#include "llviewerassettype.h"
#include "lldictionary.h"
#include "llmemory.h"
#include "llsingleton.h"
static const std::string empty_string;

View File

@@ -523,6 +523,30 @@ bool handleVectorizeChanged(const LLSD& newvalue)
return true;
}
bool handleVelocityInterpolate(const LLSD& newvalue)
{
LLMessageSystem* msg = gMessageSystem;
if ( newvalue.asBoolean() )
{
msg->newMessageFast(_PREHASH_VelocityInterpolateOn);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
llinfos << "Velocity Interpolation On" << llendl;
}
else
{
msg->newMessageFast(_PREHASH_VelocityInterpolateOff);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
llinfos << "Velocity Interpolation Off" << llendl;
}
return true;
}
bool handleVoiceClientPrefsChanged(const LLSD& newvalue)
{
if(gVoiceClient)
@@ -751,6 +775,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
gSavedSettings.getControl("VelocityInterpolate")->getSignal()->connect(boost::bind(&handleVelocityInterpolate, _2));
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _2));
gSavedSettings.getControl("StateMachineMaxTime")->getSignal()->connect(boost::bind(&handleStateMachineMaxTimeChanged, _2));

View File

@@ -38,6 +38,7 @@
#include <deque>
#include "llimagejpeg.h"
#include "llanimationstates.h"
#include "llaudioengine.h"
#include "llavatarnamecache.h"
#include "indra_constants.h"
@@ -361,9 +362,9 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
S32 trx_type, const std::string& desc)
{
// <edit>
//if(0 == amount || !region) return;
if(!region) return;
//if(!region) return;
// </edit>
if(0 == amount || !region) return;
amount = abs(amount);
LL_INFOS("Messaging") << "give_money(" << uuid << "," << amount << ")"<< LL_ENDL;
if(can_afford_transaction(amount))
@@ -4820,6 +4821,17 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
avatarp->mSignaledAnimations[animation_id] = anim_sequence_id;
// *HACK: Disabling flying mode if it has been enabled shortly before the agent
// stand up animation is signaled. In this case we don't get a signal to start
// flying animation from server, the AGENT_CONTROL_FLY flag remains set but the
// avatar does not play flying animation, so we switch flying mode off.
// See LLAgent::setFlying(). This may cause "Stop Flying" button to blink.
// See EXT-2781.
if (animation_id == ANIM_AGENT_STANDUP && gAgent.getFlying())
{
gAgent.setFlying(FALSE);
}
if (i < num_source_blocks)
{
mesgsys->getUUIDFast(_PREHASH_AnimationSourceList, _PREHASH_ObjectID, object_id, i);
@@ -4926,6 +4938,9 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
}
gAgentCamera.setForceMouselook(force_mouselook);
// Forcing turning off flying here to prevent flying after pressing "Stand"
// to stand up from an object. See EXT-1655.
gAgent.setFlying(FALSE);
LLViewerObject* object = gObjectList.findObject(sitObjectID);
if (object)
@@ -5317,7 +5332,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
bool attempt_standard_notification(LLMessageSystem* msgsystem)
{
// if we have additional alert data
if (msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
if (msgsystem->has(_PREHASH_AlertInfo) && msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
{
// notification was specified using the new mechanism, so we can just handle it here
std::string notificationID;
@@ -5423,7 +5438,7 @@ void process_alert_core(const std::string& message, BOOL modal)
std::string snap_filename = gDirUtilp->getLindenUserDir();
snap_filename += gDirUtilp->getDirDelimiter();
snap_filename += SCREEN_HOME_FILENAME;
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, FALSE);
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
}
const std::string ALERT_PREFIX("ALERT: ");
@@ -6044,7 +6059,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
LLSD args;
// if we have additional alert data
if (msg->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0)
{
// Get the message ID
msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason);
@@ -6462,7 +6477,14 @@ void process_script_dialog(LLMessageSystem* msg, void**)
LLUUID object_id;
msg->getUUID("Data", "ObjectID", object_id);
if (LLMuteList::getInstance()->isMuted(object_id))
// For compability with OS grids first check for presence of extended packet before fetching data.
LLUUID owner_id;
if (gMessageSystem->getNumberOfBlocks("OwnerData") > 0)
{
msg->getUUID("OwnerData", "OwnerID", owner_id);
}
if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id))
{
return;
}

View File

@@ -38,6 +38,7 @@
#include "timing.h"
#include "llfasttimer.h"
#include "llrender.h"
#include "llwindow.h" // decBusyCount()
#include "llviewercontrol.h"
#include "llface.h"
@@ -62,6 +63,7 @@
#include "llresmgr.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "llvovolume.h"
#include "lltoolmgr.h"
#include "lltoolpie.h"
#include "llkeyboard.h"
@@ -971,6 +973,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
mNumSizeCulled = 0;
mNumVisCulled = 0;
// update max computed render cost
LLVOVolume::updateRenderComplexity();
// compute all sorts of time-based stats
// don't factor frames that were paused into the stats
if (! mWasPaused)

View File

@@ -43,15 +43,16 @@
// newview includes
#include "llagentcamera.h"
#include "llviewertexture.h"
#include "llviewercontrol.h"
#include "llsurface.h"
#include "llviewerregion.h"
#include "llagent.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llselectmgr.h"
#include "llfloatertools.h"
#include "llglheaders.h"
#include "pipeline.h"
const U8 OVERLAY_IMG_COMPONENTS = 4;
@@ -148,6 +149,120 @@ BOOL LLViewerParcelOverlay::isOwnedOther(const LLVector3& pos) const
return (PARCEL_OWNED == overlay || PARCEL_FOR_SALE == overlay);
}
bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) const
{
// boxes are expected to already be axis aligned
for (U32 i = 0; i < boxes.size(); ++i)
{
LLVector3 min = boxes[i].getMinAgent();
LLVector3 max = boxes[i].getMaxAgent();
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
for (S32 row = top; row <= bottom; row++)
{
for (S32 column = left; column <= right; column++)
{
U8 type = ownership(row, column);
if ((PARCEL_SELF == type)
|| (PARCEL_GROUP == type))
{
return true;
}
}
}
}
return false;
}
bool LLViewerParcelOverlay::encroachesOnUnowned(const std::vector<LLBBox>& boxes) const
{
// boxes are expected to already be axis aligned
for (U32 i = 0; i < boxes.size(); ++i)
{
LLVector3 min = boxes[i].getMinAgent();
LLVector3 max = boxes[i].getMaxAgent();
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
for (S32 row = top; row <= bottom; row++)
{
for (S32 column = left; column <= right; column++)
{
U8 type = ownership(row, column);
if ((PARCEL_SELF != type))
{
return true;
}
}
}
}
return false;
}
bool LLViewerParcelOverlay::encroachesOnNearbyParcel(const std::vector<LLBBox>& boxes) const
{
// boxes are expected to already be axis aligned
for (U32 i = 0; i < boxes.size(); ++i)
{
LLVector3 min = boxes[i].getMinAgent();
LLVector3 max = boxes[i].getMaxAgent();
// If an object crosses region borders it crosses a parcel
if ( min.mV[VX] < 0
|| min.mV[VY] < 0
|| max.mV[VX] > REGION_WIDTH_METERS
|| max.mV[VY] > REGION_WIDTH_METERS)
{
return true;
}
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
S32 top = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
for (S32 row = bottom; row <= top; row++)
{
for (S32 col = left; col <= right; col++)
{
// This is not the rightmost column
if (col < GRIDS_PER_EDGE-1)
{
U8 east_overlay = mOwnership[row*GRIDS_PER_EDGE+col+1];
// If the column to the east of the current one marks
// the other parcel's west edge and the box extends
// to the west it crosses the parcel border.
if ((east_overlay & PARCEL_WEST_LINE) && col < right)
{
return true;
}
}
// This is not the topmost column
if (row < GRIDS_PER_EDGE-1)
{
U8 north_overlay = mOwnership[(row+1)*GRIDS_PER_EDGE+col];
// If the row to the north of the current one marks
// the other parcel's south edge and the box extends
// to the south it crosses the parcel border.
if ((north_overlay & PARCEL_SOUTH_LINE) && row < top)
{
return true;
}
}
}
}
}
return false;
}
BOOL LLViewerParcelOverlay::isSoundLocal(const LLVector3& pos) const
{
S32 row = S32(pos.mV[VY] / PARCEL_GRID_STEP_METERS);
@@ -807,7 +922,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
F32* vertexp;
U8* colorp;
const F32 PROPERTY_LINE_CLIP_DIST = 256.f;
const F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
for (i = 0; i < mVertexCount; i += vertex_per_edge)
{
@@ -818,7 +933,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
vertex.mV[VY] = *(vertexp+1);
vertex.mV[VZ] = *(vertexp+2);
if (dist_vec_squared2D(vertex, camera_region) > PROPERTY_LINE_CLIP_DIST*PROPERTY_LINE_CLIP_DIST)
if (dist_vec_squared2D(vertex, camera_region) > PROPERTY_LINE_CLIP_DIST_SQUARED)
{
continue;
}

View File

@@ -36,6 +36,7 @@
// The ownership data for land parcels.
// One of these structures per region.
#include "llbbox.h"
#include "lldarray.h"
#include "llframetimer.h"
#include "lluuid.h"
@@ -60,6 +61,14 @@ public:
BOOL isOwnedSelf(const LLVector3& pos) const;
BOOL isOwnedGroup(const LLVector3& pos) const;
BOOL isOwnedOther(const LLVector3& pos) const;
// "encroaches" means the prim hangs over the parcel, but its center
// might be in another parcel. for now, we simply test axis aligned
// bounding boxes which isn't perfect, but is close
bool encroachesOwned(const std::vector<LLBBox>& boxes) const;
bool encroachesOnUnowned(const std::vector<LLBBox>& boxes) const;
bool encroachesOnNearbyParcel(const std::vector<LLBBox>& boxes) const;
BOOL isSoundLocal(const LLVector3& pos) const;
BOOL isBuildCameraAllowed(const LLVector3& pos) const;

View File

@@ -35,7 +35,7 @@
#include "lldarrayptr.h"
#include "llframetimer.h"
#include "llmemory.h"
#include "llpointer.h"
#include "llpartdata.h"
#include "llviewerpartsource.h"

View File

@@ -33,8 +33,9 @@
#ifndef LL_LLVIEWERPARTSOURCE_H
#define LL_LLVIEWERPARTSOURCE_H
#include "llmemory.h"
#include "llrefcount.h"
#include "llpartdata.h"
#include "llpointer.h"
#include "llquaternion.h"
#include "v3math.h"

View File

@@ -39,6 +39,7 @@
#include "v3math.h"
#include "llsurface.h"
#include "lltextureview.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "noise.h"

View File

@@ -46,6 +46,7 @@
#include "llregionhandle.h"
#include "llsurface.h"
#include "llviewercamera.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewernetwork.h"
#include "llviewerobjectlist.h"