aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolgrab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lltoolgrab.cpp')
-rw-r--r--linden/indra/newview/lltoolgrab.cpp72
1 files changed, 54 insertions, 18 deletions
diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp
index 74810d1..5eb688b 100644
--- a/linden/indra/newview/lltoolgrab.cpp
+++ b/linden/indra/newview/lltoolgrab.cpp
@@ -400,6 +400,14 @@ void LLToolGrab::startGrab()
400 mGrabHiddenOffsetFromCamera = mDragStartFromCamera; 400 mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
401 401
402 mGrabTimer.reset(); 402 mGrabTimer.reset();
403
404 mLastUVCoords = mGrabPick.mUVCoords;
405 mLastSTCoords = mGrabPick.mSTCoords;
406 mLastFace = mGrabPick.mObjectFace;
407 mLastIntersection = mGrabPick.mIntersection;
408 mLastNormal = mGrabPick.mNormal;
409 mLastBinormal = mGrabPick.mBinormal;
410 mLastGrabPos = LLVector3(-1.f, -1.f, -1.f);
403} 411}
404 412
405 413
@@ -797,26 +805,54 @@ void LLToolGrab::handleHoverNonPhysical(S32 x, S32 y, MASK mask)
797 grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global ); 805 grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global );
798 } 806 }
799 807
800 LLMessageSystem *msg = gMessageSystem;
801 msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
802 msg->nextBlockFast(_PREHASH_AgentData);
803 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
804 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
805 msg->nextBlockFast(_PREHASH_ObjectData);
806 msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
807 msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
808 msg->addVector3Fast(_PREHASH_GrabPosition, grab_pos_region );
809 msg->addU32Fast(_PREHASH_TimeSinceLast, dt_milliseconds );
810 msg->nextBlock("SurfaceInfo");
811 msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
812 msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
813 msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
814 msg->addVector3("Position", pick.mIntersection);
815 msg->addVector3("Normal", pick.mNormal);
816 msg->addVector3("Binormal", pick.mBinormal);
817 808
818 msg->sendMessage( objectp->getRegion()->getHost() ); 809 // only send message if something has changed since last message
810
811 BOOL changed_since_last_update = FALSE;
812
813 // test if touch data needs to be updated
814 if ((pick.mObjectFace != mLastFace) ||
815 (pick.mUVCoords != mLastUVCoords) ||
816 (pick.mSTCoords != mLastSTCoords) ||
817 (pick.mIntersection != mLastIntersection) ||
818 (pick.mNormal != mLastNormal) ||
819 (pick.mBinormal != mLastBinormal) ||
820 (grab_pos_region != mLastGrabPos))
821 {
822 changed_since_last_update = TRUE;
823 }
819 824
825 if (changed_since_last_update)
826 {
827 LLMessageSystem *msg = gMessageSystem;
828 msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
829 msg->nextBlockFast(_PREHASH_AgentData);
830 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
831 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
832 msg->nextBlockFast(_PREHASH_ObjectData);
833 msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
834 msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
835 msg->addVector3Fast(_PREHASH_GrabPosition, grab_pos_region );
836 msg->addU32Fast(_PREHASH_TimeSinceLast, dt_milliseconds );
837 msg->nextBlock("SurfaceInfo");
838 msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
839 msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
840 msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
841 msg->addVector3("Position", pick.mIntersection);
842 msg->addVector3("Normal", pick.mNormal);
843 msg->addVector3("Binormal", pick.mBinormal);
844
845 msg->sendMessage( objectp->getRegion()->getHost() );
846
847 mLastUVCoords = pick.mUVCoords;
848 mLastSTCoords = pick.mSTCoords;
849 mLastFace = pick.mObjectFace;
850 mLastIntersection = pick.mIntersection;
851 mLastNormal= pick.mNormal;
852 mLastBinormal= pick.mBinormal;
853 mLastGrabPos = grab_pos_region;
854 }
855
820 // update point-at / look-at 856 // update point-at / look-at
821 if (pick.mObjectFace != -1) // if the intersection was on the surface of the obejct 857 if (pick.mObjectFace != -1) // if the intersection was on the surface of the obejct
822 { 858 {