diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llvovolume.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvovolume.cpp | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index f425687..0a778e4 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -276,60 +277,41 @@ void LLVOVolume::animateTextures() | |||
276 | 277 | ||
277 | for (S32 i = start; i <= end; i++) | 278 | for (S32 i = start; i <= end; i++) |
278 | { | 279 | { |
279 | LLQuaternion quat; | ||
280 | LLVector3 scale(1,1,1); | ||
281 | |||
282 | LLFace* facep = mDrawable->getFace(i); | 280 | LLFace* facep = mDrawable->getFace(i); |
283 | const LLTextureEntry* te = facep->getTextureEntry(); | 281 | const LLTextureEntry* te = facep->getTextureEntry(); |
284 | LLMatrix4& tex_mat = facep->mTextureMatrix; | ||
285 | 282 | ||
286 | if (!te) | 283 | if (!te) |
287 | { | 284 | { |
288 | continue; | 285 | continue; |
289 | } | 286 | } |
287 | |||
290 | if (!(result & LLViewerTextureAnim::ROTATE)) | 288 | if (!(result & LLViewerTextureAnim::ROTATE)) |
291 | { | 289 | { |
292 | te->getRotation(&rot); | 290 | te->getRotation(&rot); |
293 | } | 291 | } |
294 | |||
295 | { | ||
296 | F32 axis = -1; | ||
297 | F32 s,t; | ||
298 | te->getScale(&s,&t); | ||
299 | if (s < 0) | ||
300 | { | ||
301 | axis = -axis; | ||
302 | } | ||
303 | if (t < 0) | ||
304 | { | ||
305 | axis = -axis; | ||
306 | } | ||
307 | quat.setQuat(rot, 0, 0, axis); | ||
308 | } | ||
309 | |||
310 | if (!(result & LLViewerTextureAnim::TRANSLATE)) | 292 | if (!(result & LLViewerTextureAnim::TRANSLATE)) |
311 | { | 293 | { |
312 | te->getOffset(&off_s,&off_t); | 294 | te->getOffset(&off_s,&off_t); |
313 | } | 295 | } |
296 | if (!(result & LLViewerTextureAnim::SCALE)) | ||
297 | { | ||
298 | te->getScale(&scale_s, &scale_t); | ||
299 | } | ||
314 | 300 | ||
301 | LLVector3 scale(scale_s, scale_t, 1.f); | ||
315 | LLVector3 trans(off_s+0.5f, off_t+0.5f, 0.f); | 302 | LLVector3 trans(off_s+0.5f, off_t+0.5f, 0.f); |
316 | 303 | LLQuaternion quat; | |
304 | quat.setQuat(rot, 0, 0, -1.f); | ||
305 | |||
306 | LLMatrix4& tex_mat = facep->mTextureMatrix; | ||
317 | tex_mat.identity(); | 307 | tex_mat.identity(); |
318 | tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); | 308 | tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); |
319 | tex_mat.rotate(quat); | 309 | tex_mat.rotate(quat); |
320 | 310 | ||
321 | if (!(result & LLViewerTextureAnim::SCALE)) | 311 | LLMatrix4 mat; |
322 | { | 312 | mat.initAll(scale, LLQuaternion(), LLVector3()); |
323 | te->getScale(&scale_s, &scale_t); | 313 | tex_mat *= mat; |
324 | } | 314 | |
325 | |||
326 | { | ||
327 | scale.setVec(scale_s, scale_t, 1.f); | ||
328 | LLMatrix4 mat; | ||
329 | mat.initAll(scale, LLQuaternion(), LLVector3()); | ||
330 | tex_mat *= mat; | ||
331 | } | ||
332 | |||
333 | tex_mat.translate(trans); | 315 | tex_mat.translate(trans); |
334 | } | 316 | } |
335 | } | 317 | } |
@@ -2022,13 +2004,13 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, | |||
2022 | LLVOVolume* volume = (LLVOVolume*) facep->getViewerObject(); | 2004 | LLVOVolume* volume = (LLVOVolume*) facep->getViewerObject(); |
2023 | BOOL is_light = volume->mDrawable->isLight(); | 2005 | BOOL is_light = volume->mDrawable->isLight(); |
2024 | 2006 | ||
2025 | // U8 alpha = is_light ? 196 : 160; | 2007 | U8 alpha = is_light ? 196 : 160; |
2026 | LLColor3 col = is_light ? volume->getLightColor() : LLColor3(0,0,0); | 2008 | LLColor3 col = is_light ? volume->getLightColor() : LLColor3(0,0,0); |
2027 | LLColor4 col2 = facep->getRenderColor(); | 2009 | LLColor4 col2 = facep->getRenderColor(); |
2028 | draw_info->mGlowColor.setVec((U8) (col.mV[0]*col2.mV[0]*255), | 2010 | draw_info->mGlowColor.setVec((U8) (col.mV[0]*col2.mV[0]*255), |
2029 | (U8) (col.mV[1]*col2.mV[1]*255), | 2011 | (U8) (col.mV[1]*col2.mV[1]*255), |
2030 | (U8) (col.mV[2]*col2.mV[2]*255), | 2012 | (U8) (col.mV[2]*col2.mV[2]*255), |
2031 | 196); | 2013 | alpha); |
2032 | draw_info->mTextureMatrix = tex_mat; | 2014 | draw_info->mTextureMatrix = tex_mat; |
2033 | validate_draw_info(*draw_info); | 2015 | validate_draw_info(*draw_info); |
2034 | } | 2016 | } |
@@ -2333,7 +2315,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) | |||
2333 | registerFace(group, facep, LLRenderPass::PASS_BUMP); | 2315 | registerFace(group, facep, LLRenderPass::PASS_BUMP); |
2334 | } | 2316 | } |
2335 | 2317 | ||
2336 | if (vobj->getIsLight()) | 2318 | if (vobj->getIsLight() || |
2319 | (LLPipeline::sRenderGlow && facep->isState(LLFace::FULLBRIGHT))) | ||
2337 | { | 2320 | { |
2338 | registerFace(group, facep, LLRenderPass::PASS_GLOW); | 2321 | registerFace(group, facep, LLRenderPass::PASS_GLOW); |
2339 | } | 2322 | } |