aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive/llprimitive.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llprimitive/llprimitive.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llprimitive/llprimitive.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp
index dc389c1..6fc0a55 100644
--- a/linden/indra/llprimitive/llprimitive.cpp
+++ b/linden/indra/llprimitive/llprimitive.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -114,6 +115,11 @@ const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = FALSE;
114 115
115const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e"; 116const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e";
116 117
118// Texture rotations are sent over the wire as a S16. This is used to scale the actual float
119// value to a S16. Don't use 7FFF as it introduces some odd rounding with 180 since it
120// can't be divided by 2. See DEV-19108
121const F32 TEXTURE_ROTATION_PACK_FACTOR = ((F32) 0x08000);
122
117//static 123//static
118// LEGACY: by default we use the LLVolumeMgr::gVolumeMgr global 124// LEGACY: by default we use the LLVolumeMgr::gVolumeMgr global
119// TODO -- eliminate this global from the codebase! 125// TODO -- eliminate this global from the codebase!
@@ -1176,7 +1182,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
1176 scale_t[face_index] = (F32) te->mScaleT; 1182 scale_t[face_index] = (F32) te->mScaleT;
1177 offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; 1183 offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
1178 offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; 1184 offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
1179 image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * (F32)0x7FFF)); 1185 image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
1180 bump[face_index] = te->getBumpShinyFullbright(); 1186 bump[face_index] = te->getBumpShinyFullbright();
1181 media_flags[face_index] = te->getMediaTexGen(); 1187 media_flags[face_index] = te->getMediaTexGen();
1182 glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); 1188 glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
@@ -1255,7 +1261,7 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
1255 scale_t[face_index] = (F32) te->mScaleT; 1261 scale_t[face_index] = (F32) te->mScaleT;
1256 offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; 1262 offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
1257 offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; 1263 offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
1258 image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * (F32)0x7FFF)); 1264 image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
1259 bump[face_index] = te->getBumpShinyFullbright(); 1265 bump[face_index] = te->getBumpShinyFullbright();
1260 media_flags[face_index] = te->getMediaTexGen(); 1266 media_flags[face_index] = te->getMediaTexGen();
1261 glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); 1267 glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
@@ -1369,7 +1375,7 @@ S32 LLPrimitive::unpackTEMessage(LLMessageSystem *mesgsys, char *block_name, con
1369 retval |= setTETexture(i, ((LLUUID*)image_data)[i]); 1375 retval |= setTETexture(i, ((LLUUID*)image_data)[i]);
1370 retval |= setTEScale(i, scale_s[i], scale_t[i]); 1376 retval |= setTEScale(i, scale_s[i], scale_t[i]);
1371 retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF); 1377 retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF);
1372 retval |= setTERotation(i, ((F32)image_rot[i]/ (F32)0x7FFF) * F_TWO_PI); 1378 retval |= setTERotation(i, ((F32)image_rot[i] / TEXTURE_ROTATION_PACK_FACTOR) * F_TWO_PI);
1373 retval |= setTEBumpShinyFullbright(i, bump[i]); 1379 retval |= setTEBumpShinyFullbright(i, bump[i]);
1374 retval |= setTEMediaTexGen(i, media_flags[i]); 1380 retval |= setTEMediaTexGen(i, media_flags[i]);
1375 retval |= setTEGlow(i, (F32)glow[i] / (F32)0xFF); 1381 retval |= setTEGlow(i, (F32)glow[i] / (F32)0xFF);
@@ -1463,7 +1469,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
1463 retval |= setTETexture(i, image_ids[i]); 1469 retval |= setTETexture(i, image_ids[i]);
1464 retval |= setTEScale(i, scale_s[i], scale_t[i]); 1470 retval |= setTEScale(i, scale_s[i], scale_t[i]);
1465 retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF); 1471 retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF);
1466 retval |= setTERotation(i, ((F32)image_rot[i]/ (F32)0x7FFF) * F_TWO_PI); 1472 retval |= setTERotation(i, ((F32)image_rot[i] / TEXTURE_ROTATION_PACK_FACTOR) * F_TWO_PI);
1467 retval |= setTEBumpShinyFullbright(i, bump[i]); 1473 retval |= setTEBumpShinyFullbright(i, bump[i]);
1468 retval |= setTEMediaTexGen(i, media_flags[i]); 1474 retval |= setTEMediaTexGen(i, media_flags[i]);
1469 retval |= setTEGlow(i, (F32)glow[i] / (F32)0xFF); 1475 retval |= setTEGlow(i, (F32)glow[i] / (F32)0xFF);