From c0761b99b78e9ae4e694b7b4af6ae3e9020cb87e Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 7 Jul 2010 12:19:24 -0600 Subject: EXT-8002: FIXED: Crossing a sim boundary in a vehicle results in unexpected catapulting --- indra/newview/llviewerobject.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9a2866832a..6d93de2383 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -765,12 +765,19 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle); - if(regionp != mRegionp && regionp && mRegionp) + if(regionp != mRegionp && regionp && mRegionp)//region cross { + //this is the redundant position and region update, but it is necessary in case the viewer misses the following + //position and region update messages from sim. + //this redundant update should not cause any problems. LLVector3 delta_pos = mRegionp->getOriginAgent() - regionp->getOriginAgent(); - setPosition(getPosition() + delta_pos) ; //update the region position immediately. + setPositionParent(getPosition() + delta_pos); //update to the new region position immediately. + setRegion(regionp) ; //change the region. + } + else + { + mRegionp = regionp ; } - mRegionp = regionp ; } if (!mRegionp) -- cgit v1.2.3