Ported unpackLocalToGlobalPosition() in llworld.cpp from Firestorm; possible fix for PHOE-3922

Sun, 18 Mar 2012 12:52:47 +0100

author
Ansariel
date
Sun, 18 Mar 2012 12:52:47 +0100
changeset 1682
89234d0de3a6
parent 1681
4aa27e7bebb8
child 1683
d34f0f4cb8a4

Ported unpackLocalToGlobalPosition() in llworld.cpp from Firestorm; possible fix for PHOE-3922

indra/newview/llworld.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llworld.cpp	Sat Mar 17 11:43:21 2012 -0500
     1.2 +++ b/indra/newview/llworld.cpp	Sun Mar 18 12:52:47 2012 +0100
     1.3 @@ -1462,24 +1462,13 @@
     1.4  
     1.5  static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin)
     1.6  {
     1.7 -	LLVector3d pos_global;
     1.8 -	LLVector3 pos_local;
     1.9 -	U8 bits;
    1.10 +	LLVector3d pos_local;
    1.11  
    1.12 -	bits = compact_local & 0xFF;
    1.13 -	pos_local.mV[VZ] = F32(bits) * 4.f;
    1.14 -	compact_local >>= 8;
    1.15 +	pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4;
    1.16 +	pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU;
    1.17 +	pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU;
    1.18  
    1.19 -	bits = compact_local & 0xFF;
    1.20 -	pos_local.mV[VY] = (F32)bits;
    1.21 -	compact_local >>= 8;
    1.22 -
    1.23 -	bits = compact_local & 0xFF;
    1.24 -	pos_local.mV[VX] = (F32)bits;
    1.25 -
    1.26 -	pos_global.setVec( pos_local );
    1.27 -	pos_global += region_origin;
    1.28 -	return pos_global;
    1.29 +	return region_origin + pos_local;
    1.30  }
    1.31  
    1.32  void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const

mercurial