summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp79
1 files changed, 17 insertions, 62 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f7b48d25f2..d69fe8328d 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -121,8 +121,8 @@ const F32 MIN_FIDGET_TIME = 8.f; // seconds
const F32 MAX_FIDGET_TIME = 20.f; // seconds
const S32 UI_FEATURE_VERSION = 1;
-// For version 1: 1 - inventory, 2 - gltf
-const S32 UI_FEATURE_FLAGS = 3;
+// For version 1, flag holds: 1 - inventory thumbnails, 2 - gltf, 4 - inventory favorites
+const S32 UI_FEATURE_FLAGS = 7;
// The agent instance.
LLAgent gAgent;
@@ -223,7 +223,6 @@ private:
LLVector3d mPosGlobal;
};
-
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation
{
public:
@@ -608,7 +607,7 @@ void LLAgent::getFeatureVersionAndFlags(S32& version, S32& flags)
if (feature_version.isInteger())
{
version = feature_version.asInteger();
- flags = 1; // inventory flag
+ flags = 3; // show 'favorites' notification
}
else if (feature_version.isMap())
{
@@ -634,13 +633,8 @@ void LLAgent::showLatestFeatureNotification(const std::string key)
if (key == "inventory")
{
- // Notify user about new thumbnail support
- flag = 1;
- }
-
- if (key == "gltf")
- {
- flag = 2;
+ // Notify user about new favorites support
+ flag = 4;
}
if ((flags & flag) == 0)
@@ -847,7 +841,6 @@ void LLAgent::movePitch(F32 mag)
}
}
-
// Does this parcel allow you to fly?
bool LLAgent::canFly()
{
@@ -927,7 +920,6 @@ void LLAgent::setFlying(bool fly, bool fail_sound)
LLFloaterMove::setFlyingMode(fly);
}
-
// UI based mechanism of setting fly state
//-----------------------------------------------------------------------------
// toggleFlying()
@@ -1010,7 +1002,6 @@ void LLAgent::capabilityReceivedCallback(const LLUUID &region_id, LLViewerRegion
}
}
-
//-----------------------------------------------------------------------------
// setRegion()
//-----------------------------------------------------------------------------
@@ -1116,7 +1107,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
mRegionChangedSignal();
}
-
//-----------------------------------------------------------------------------
// getRegion()
//-----------------------------------------------------------------------------
@@ -1125,7 +1115,6 @@ LLViewerRegion *LLAgent::getRegion() const
return mRegionp;
}
-
LLHost LLAgent::getRegionHost() const
{
if (mRegionp)
@@ -1156,7 +1145,6 @@ bool LLAgent::inPrelude()
return mRegionp && mRegionp->isPrelude();
}
-
std::string LLAgent::getRegionCapability(const std::string &name)
{
if (!mRegionp)
@@ -1165,7 +1153,6 @@ std::string LLAgent::getRegionCapability(const std::string &name)
return mRegionp->getCapability(name);
}
-
//-----------------------------------------------------------------------------
// canManageEstate()
//-----------------------------------------------------------------------------
@@ -1193,7 +1180,6 @@ void LLAgent::sendMessage()
gMessageSystem->sendMessage(mRegionp->getHost());
}
-
//-----------------------------------------------------------------------------
// sendReliableMessage()
//-----------------------------------------------------------------------------
@@ -1227,7 +1213,6 @@ LLVector3 LLAgent::getVelocity() const
}
}
-
//-----------------------------------------------------------------------------
// setPositionAgent()
//-----------------------------------------------------------------------------
@@ -1301,7 +1286,6 @@ const LLVector3 &LLAgent::getPositionAgent()
}
}
-
return mFrameAgent.getOrigin();
}
@@ -1310,7 +1294,6 @@ boost::signals2::connection LLAgent::whenPositionChanged(position_signal_t::slot
return mOnPositionChanged.connect(fn);
}
-
//-----------------------------------------------------------------------------
// getRegionsVisited()
//-----------------------------------------------------------------------------
@@ -1327,7 +1310,6 @@ F64 LLAgent::getDistanceTraveled() const
return mDistanceTraveled;
}
-
//-----------------------------------------------------------------------------
// getPosAgentFromGlobal()
//-----------------------------------------------------------------------------
@@ -1338,7 +1320,6 @@ LLVector3 LLAgent::getPosAgentFromGlobal(const LLVector3d &pos_global) const
return pos_agent;
}
-
//-----------------------------------------------------------------------------
// getPosGlobalFromAgent()
//-----------------------------------------------------------------------------
@@ -1354,7 +1335,6 @@ void LLAgent::sitDown()
if (mAllowedToSit) setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
-
//-----------------------------------------------------------------------------
// resetAxes()
//-----------------------------------------------------------------------------
@@ -1363,7 +1343,6 @@ void LLAgent::resetAxes()
mFrameAgent.resetAxes();
}
-
// Copied from LLCamera::setOriginAndLookAt
// Look_at must be unit vector
//-----------------------------------------------------------------------------
@@ -1392,7 +1371,6 @@ void LLAgent::resetAxes(const LLVector3 &look_at)
mFrameAgent.setAxes(look_at, left, up);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1401,7 +1379,6 @@ void LLAgent::rotate(F32 angle, const LLVector3 &axis)
mFrameAgent.rotate(angle, axis);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1410,7 +1387,6 @@ void LLAgent::rotate(F32 angle, F32 x, F32 y, F32 z)
mFrameAgent.rotate(angle, x, y, z);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1419,7 +1395,6 @@ void LLAgent::rotate(const LLMatrix3 &matrix)
mFrameAgent.rotate(matrix);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1428,7 +1403,6 @@ void LLAgent::rotate(const LLQuaternion &quaternion)
mFrameAgent.rotate(quaternion);
}
-
//-----------------------------------------------------------------------------
// getReferenceUpVector()
//-----------------------------------------------------------------------------
@@ -1457,7 +1431,6 @@ LLVector3 LLAgent::getReferenceUpVector()
return up_vector;
}
-
// Radians, positive is forward into ground
//-----------------------------------------------------------------------------
// pitch()
@@ -1501,7 +1474,6 @@ void LLAgent::pitch(F32 angle)
}
}
-
//-----------------------------------------------------------------------------
// roll()
//-----------------------------------------------------------------------------
@@ -1510,7 +1482,6 @@ void LLAgent::roll(F32 angle)
mFrameAgent.roll(angle);
}
-
//-----------------------------------------------------------------------------
// yaw()
//-----------------------------------------------------------------------------
@@ -1522,7 +1493,6 @@ void LLAgent::yaw(F32 angle)
}
}
-
// Returns a quat that represents the rotation of the agent in the absolute frame
//-----------------------------------------------------------------------------
// getQuat()
@@ -1548,7 +1518,6 @@ void LLAgent::setControlFlags(U32 mask)
mControlFlags |= mask;
}
-
//-----------------------------------------------------------------------------
// clearControlFlags()
//-----------------------------------------------------------------------------
@@ -1636,7 +1605,6 @@ bool LLAgent::isDoNotDisturb() const
return mIsDoNotDisturb;
}
-
//-----------------------------------------------------------------------------
// startAutoPilotGlobal()
//-----------------------------------------------------------------------------
@@ -1742,7 +1710,6 @@ void LLAgent::startAutoPilotGlobal(
mAutoPilotNoProgressFrameCount = 0;
}
-
//-----------------------------------------------------------------------------
// setAutoPilotTargetGlobal
//-----------------------------------------------------------------------------
@@ -1796,7 +1763,6 @@ void LLAgent::startFollowPilot(const LLUUID &leader_id, bool allow_flying, F32 s
allow_flying);
}
-
//-----------------------------------------------------------------------------
// stopAutoPilot()
//-----------------------------------------------------------------------------
@@ -1838,7 +1804,6 @@ void LLAgent::stopAutoPilot(bool user_cancel)
}
}
-
// Returns necessary agent pitch and yaw changes, radians.
//-----------------------------------------------------------------------------
// autoPilot()
@@ -2027,7 +1992,6 @@ void LLAgent::autoPilot(F32 *delta_yaw)
}
}
-
//-----------------------------------------------------------------------------
// propagate()
//-----------------------------------------------------------------------------
@@ -2048,18 +2012,19 @@ void LLAgent::propagate(const F32 dt)
}
// handle rotation based on keyboard levels
- constexpr F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second
- F32 angle = YAW_RATE * gAgentCamera.getYawKey() * dt;
- if (fabs(angle) > 0.0f)
+ if (fabs(dt) > 1e-6)
{
- yaw(angle);
- }
+ if (fabs(gAgentCamera.getYawKey()) > 1e-6)
+ {
+ static const F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second
+ yaw(YAW_RATE * gAgentCamera.getYawKey() * dt);
+ }
- constexpr F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second
- angle = PITCH_RATE * gAgentCamera.getPitchKey() * dt;
- if (fabs(angle) > 0.0f)
- {
- pitch(angle);
+ if (fabs(gAgentCamera.getPitchKey()) > 1e-6)
+ {
+ static const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second
+ pitch(PITCH_RATE * gAgentCamera.getPitchKey() * dt);
+ }
}
// handle auto-land behavior
@@ -2221,7 +2186,6 @@ void LLAgent::clearRenderState(U8 clearstate)
mRenderState &= ~clearstate;
}
-
//-----------------------------------------------------------------------------
// getRenderState()
//-----------------------------------------------------------------------------
@@ -2263,6 +2227,7 @@ void LLAgent::endAnimationUpdateUI()
{
return;
}
+
if (gAgentCamera.getCameraMode() == gAgentCamera.getLastCameraMode())
{
// We're already done endAnimationUpdateUI for this transition.
@@ -2328,7 +2293,6 @@ void LLAgent::endAnimationUpdateUI()
mViewsPushed = false;
}
-
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
if( gMorphView )
{
@@ -2960,7 +2924,6 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
}
}
-
void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferredMaturity)
{
U8 maturity = SIM_ACCESS_MIN;
@@ -3030,7 +2993,6 @@ void LLAgent::changeInterestListMode(const std::string &new_mode)
}
}
-
bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure)
{
if (getRegion())
@@ -3357,7 +3319,6 @@ void LLAgent::sendAnimationStateReset()
sendReliableMessage();
}
-
// Send a message to the region to revoke sepecified permissions on ALL scripts in the region
// If the target is an object in the region, permissions in scripts on that object are cleared.
// If it is the region ID, all scripts clear the permissions for this agent
@@ -4287,7 +4248,6 @@ void LLAgent::onCapabilitiesReceivedAfterTeleport()
check_merchant_status();
}
-
void LLAgent::teleportRequest(
const U64& region_handle,
const LLVector3& pos_local,
@@ -4401,7 +4361,6 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, bool godlike)
}
}
-
// James Cook, July 28, 2005
void LLAgent::teleportCancel()
{
@@ -4526,7 +4485,6 @@ LLAgent::ETeleportState LLAgent::getTeleportState() const
TELEPORT_NONE : mTeleportState;
}
-
void LLAgent::setTeleportState(ETeleportState state)
{
if (mTeleportRequest && (state != TELEPORT_NONE) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed))
@@ -4571,7 +4529,6 @@ void LLAgent::setTeleportState(ETeleportState state)
}
}
-
void LLAgent::stopCurrentAnimations()
{
LL_DEBUGS("Avatar") << "Stopping current animations" << LL_ENDL;
@@ -4686,7 +4643,6 @@ void LLAgent::stopFidget()
gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP);
}
-
void LLAgent::requestEnterGodMode()
{
LLMessageSystem* msg = gMessageSystem;
@@ -4807,7 +4763,6 @@ void LLAgent::sendAgentUpdateUserInfo(const std::string& directory_visibility)
}
}
-
void LLAgent::updateAgentUserInfoCoro(std::string capurl, std::string directory_visibility)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);