Commits

Scott Lawrence committed 8ea4160 Merge

merge changes for DRTVWR-189

Comments (0)

Files changed (5)

 1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1
 81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
 cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
+9ee9387789701d597130f879d9011a4958753862 DRTVWR-189

indra/newview/llfloaterpathfindingconsole.h

 
 	LLPathingLib::LLPLCharacterType getRenderHeatmapType() const;
 	void                            setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType);
-
+	void onRegionBoundaryCross();
 protected:
 
 private:
 	void onClearPathClicked();
 
 	void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus);
-	void onRegionBoundaryCross();
+	
 	void onPathEvent();
 
 	void setDefaultInputs();

indra/newview/llfloaterpreference.cpp

 #include "llviewerthrottle.h"
 #include "llvotree.h"
 #include "llvosky.h"
-
+#include "llfloaterpathfindingconsole.h"
 // linden library includes
 #include "llavatarnamecache.h"
 #include "llerror.h"
 	{
 		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)
 		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 

indra/newview/llviewerobject.cpp

 	mNumFaces(0),
 	mTimeDilation(1.f),
 	mRotTime(0.f),
+	mAngularVelocityRot(),
 	mState(0),
 	mMedia(NULL),
 	mClickAction(0),
 	{
 		mPositionAgent = mRegionp->getOriginAgent();
 	}
+	resetRot();
 
 	LLViewerObject::sNumObjects++;
 }
 	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();
 	}
 
 
 
 		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);
 	}
 void LLViewerObject::resetRot()
 {
 	mRotTime = 0.0f;
+
+	// Reset the accumulated angular velocity rotation
+	mAngularVelocityRot.loadIdentity(); 
 }
 
 U32 LLViewerObject::getPartitionType() const

indra/newview/llviewerobject.h

 
 	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