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.cpp68
1 files changed, 50 insertions, 18 deletions
diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp
index 74810d1..b49e8de 100644
--- a/linden/indra/newview/lltoolgrab.cpp
+++ b/linden/indra/newview/lltoolgrab.cpp
@@ -400,6 +400,13 @@ 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;
403} 410}
404 411
405 412
@@ -797,26 +804,51 @@ void LLToolGrab::handleHoverNonPhysical(S32 x, S32 y, MASK mask)
797 grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global ); 804 grab_pos_region = objectp->getRegion()->getPosRegionFromGlobal( grab_point_global );
798 } 805 }
799 806
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 807
818 msg->sendMessage( objectp->getRegion()->getHost() ); 808 // only send message if something has changed since last message
809
810 BOOL changed_since_last_update = FALSE;
811
812 if ((pick.mObjectFace != mLastFace) ||
813 (pick.mUVCoords != mLastUVCoords) ||
814 (pick.mSTCoords != mLastSTCoords) ||
815 (pick.mIntersection != mLastIntersection) ||
816 (pick.mNormal != mLastNormal) ||
817 (pick.mBinormal != mLastBinormal))
818 {
819 changed_since_last_update = TRUE;
820 }
819 821
822 if (changed_since_last_update)
823 {
824 LLMessageSystem *msg = gMessageSystem;
825 msg->newMessageFast(_PREHASH_ObjectGrabUpdate);
826 msg->nextBlockFast(_PREHASH_AgentData);
827 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
828 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
829 msg->nextBlockFast(_PREHASH_ObjectData);
830 msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
831 msg->addVector3Fast(_PREHASH_GrabOffsetInitial, mGrabOffsetFromCenterInitial );
832 msg->addVector3Fast(_PREHASH_GrabPosition, grab_pos_region );
833 msg->addU32Fast(_PREHASH_TimeSinceLast, dt_milliseconds );
834 msg->nextBlock("SurfaceInfo");
835 msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
836 msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
837 msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
838 msg->addVector3("Position", pick.mIntersection);
839 msg->addVector3("Normal", pick.mNormal);
840 msg->addVector3("Binormal", pick.mBinormal);
841
842 msg->sendMessage( objectp->getRegion()->getHost() );
843
844 mLastUVCoords = pick.mUVCoords;
845 mLastSTCoords = pick.mSTCoords;
846 mLastFace = pick.mObjectFace;
847 mLastIntersection = pick.mIntersection;
848 mLastNormal= pick.mNormal;
849 mLastBinormal= pick.mBinormal;
850 }
851
820 // update point-at / look-at 852 // update point-at / look-at
821 if (pick.mObjectFace != -1) // if the intersection was on the surface of the obejct 853 if (pick.mObjectFace != -1) // if the intersection was on the surface of the obejct
822 { 854 {