summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-08-08 07:27:59 -0700
committerOz Linden <oz@lindenlab.com>2012-08-08 07:27:59 -0700
commit337976096530729a7d671df68907cd59a7986972 (patch)
tree27d554390e09de3c1994a9d4bd56f189565f84b9 /indra
parent261c10adf3fafc9211e46fdefe41cfdece459d0f (diff)
parent36e36b94972b2f8787c5ce409048743373e44db4 (diff)
merge changes for DRTVWR-189
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h4
-rwxr-xr-xindra/newview/llfloaterpreference.cpp19
-rw-r--r--indra/newview/llviewerobject.cpp20
-rw-r--r--indra/newview/llviewerobject.h1
4 files changed, 35 insertions, 9 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index 4b2f7672e4..e999e57741 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -93,7 +93,7 @@ public:
LLPathingLib::LLPLCharacterType getRenderHeatmapType() const;
void setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType);
-
+ void onRegionBoundaryCross();
protected:
private:
@@ -124,7 +124,7 @@ private:
void onClearPathClicked();
void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus);
- void onRegionBoundaryCross();
+
void onPathEvent();
void setDefaultInputs();
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 60556147a9..5752f839ce 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -77,7 +77,7 @@
#include "llviewerthrottle.h"
#include "llvotree.h"
#include "llvosky.h"
-
+#include "llfloaterpathfindingconsole.h"
// linden library includes
#include "llavatarnamecache.h"
#include "llerror.h"
@@ -632,6 +632,13 @@ void LLFloaterPreference::cancel()
{
advanced_proxy_settings->cancel();
}
+ //Need to reload the navmesh if the pathing console is up
+ LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+ if ( !pathfindingConsoleHandle.isDead() )
+ {
+ LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
+ pPathfindingConsole->onRegionBoundaryCross();
+ }
}
void LLFloaterPreference::onOpen(const LLSD& key)
@@ -779,7 +786,15 @@ void LLFloaterPreference::onBtnOK()
llinfos << "Can't close preferences!" << llendl;
}
- LLPanelLogin::updateLocationSelectorsVisibility();
+ LLPanelLogin::updateLocationSelectorsVisibility();
+ //Need to reload the navmesh if the pathing console is up
+ LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+ if ( !pathfindingConsoleHandle.isDead() )
+ {
+ LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
+ pPathfindingConsole->onRegionBoundaryCross();
+ }
+
}
// static
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 78fa585a41..4ad0547379 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -236,6 +236,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mNumFaces(0),
mTimeDilation(1.f),
mRotTime(0.f),
+ mAngularVelocityRot(),
mState(0),
mMedia(NULL),
mClickAction(0),
@@ -265,6 +266,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
{
mPositionAgent = mRegionp->getOriginAgent();
}
+ resetRot();
LLViewerObject::sNumObjects++;
}
@@ -2039,14 +2041,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if (new_rot != getRotation()
|| new_angv != old_angv)
{
- if (new_rot != getRotation())
+ if (new_angv != old_angv)
{
- setRotation(new_rot);
+ resetRot();
}
-
+
+ // Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega)
+ setRotation(new_rot * mAngularVelocityRot);
setChanged(ROTATED | SILHOUETTE);
-
- resetRot();
}
@@ -5425,8 +5427,13 @@ void LLViewerObject::applyAngularVelocity(F32 dt)
ang_vel *= 1.f/omega;
+ // calculate the delta increment based on the object's angular velocity
dQ.setQuat(angle, ang_vel);
+
+ // accumulate the angular velocity rotations to re-apply in the case of an object update
+ mAngularVelocityRot *= dQ;
+ // Just apply the delta increment to the current rotation
setRotation(getRotation()*dQ);
setChanged(MOVED | SILHOUETTE);
}
@@ -5435,6 +5442,9 @@ void LLViewerObject::applyAngularVelocity(F32 dt)
void LLViewerObject::resetRot()
{
mRotTime = 0.0f;
+
+ // Reset the accumulated angular velocity rotation
+ mAngularVelocityRot.loadIdentity();
}
U32 LLViewerObject::getPartitionType() const
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 6addb383d4..e60c8a8d52 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -721,6 +721,7 @@ protected:
F32 mTimeDilation; // Time dilation sent with the object.
F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)
+ LLQuaternion mAngularVelocityRot; // accumulated rotation from the angular velocity computations
U8 mState; // legacy
LLViewerObjectMedia* mMedia; // NULL if no media associated