diff options
author | Jacek Antonelli | 2009-05-24 02:59:02 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-05-24 02:59:08 -0500 |
commit | 811454f47ea1f3c5cb8971f0fed0959b18bd0747 (patch) | |
tree | 1b8689df2dc8857cdc5a956a5233d5bf94b5c8d7 /linden/indra/newview/llvoavatar.cpp | |
parent | Second Life viewer sources 1.23.0-RC (diff) | |
download | meta-impy-811454f47ea1f3c5cb8971f0fed0959b18bd0747.zip meta-impy-811454f47ea1f3c5cb8971f0fed0959b18bd0747.tar.gz meta-impy-811454f47ea1f3c5cb8971f0fed0959b18bd0747.tar.bz2 meta-impy-811454f47ea1f3c5cb8971f0fed0959b18bd0747.tar.xz |
Second Life viewer sources 1.23.1-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 56 |
1 files changed, 42 insertions, 14 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index b06652a..3491dd3 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -1451,6 +1451,7 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax) | |||
1451 | LLVector3 pos = getRenderPosition(); | 1451 | LLVector3 pos = getRenderPosition(); |
1452 | newMin = pos - buffer; | 1452 | newMin = pos - buffer; |
1453 | newMax = pos + buffer; | 1453 | newMax = pos + buffer; |
1454 | float max_attachment_span = DEFAULT_MAX_PRIM_SCALE * 5.0f; | ||
1454 | 1455 | ||
1455 | //stretch bounding box by joint positions | 1456 | //stretch bounding box by joint positions |
1456 | for (polymesh_map_t::iterator i = mMeshes.begin(); i != mMeshes.end(); ++i) | 1457 | for (polymesh_map_t::iterator i = mMeshes.begin(); i != mMeshes.end(); ++i) |
@@ -1487,8 +1488,18 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax) | |||
1487 | if (bridge) | 1488 | if (bridge) |
1488 | { | 1489 | { |
1489 | const LLVector3* ext = bridge->getSpatialExtents(); | 1490 | const LLVector3* ext = bridge->getSpatialExtents(); |
1490 | update_min_max(newMin,newMax,ext[0]); | 1491 | LLVector3 distance = (ext[1] - ext[0]); |
1491 | update_min_max(newMin,newMax,ext[1]); | 1492 | |
1493 | // Only add the prim to spatial extents calculations if it isn't a megaprim. | ||
1494 | // max_attachment_span calculated at the start of the function | ||
1495 | // (currently 5 times our max prim size) | ||
1496 | if (distance.mV[0] < max_attachment_span | ||
1497 | && distance.mV[1] < max_attachment_span | ||
1498 | && distance.mV[2] < max_attachment_span) | ||
1499 | { | ||
1500 | update_min_max(newMin,newMax,ext[0]); | ||
1501 | update_min_max(newMin,newMax,ext[1]); | ||
1502 | } | ||
1492 | } | 1503 | } |
1493 | } | 1504 | } |
1494 | } | 1505 | } |
@@ -4142,7 +4153,8 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) | |||
4142 | const bool should_alpha_mask = mHasBakedHair && isTextureDefined(TEX_HEAD_BAKED) && isTextureDefined(TEX_UPPER_BAKED) | 4153 | const bool should_alpha_mask = mHasBakedHair && isTextureDefined(TEX_HEAD_BAKED) && isTextureDefined(TEX_UPPER_BAKED) |
4143 | && isTextureDefined(TEX_LOWER_BAKED) && mBakedTextureData[BAKED_HEAD].mIsLoaded | 4154 | && isTextureDefined(TEX_LOWER_BAKED) && mBakedTextureData[BAKED_HEAD].mIsLoaded |
4144 | && mBakedTextureData[BAKED_UPPER].mIsLoaded && mBakedTextureData[BAKED_LOWER].mIsLoaded | 4155 | && mBakedTextureData[BAKED_UPPER].mIsLoaded && mBakedTextureData[BAKED_LOWER].mIsLoaded |
4145 | && !LLDrawPoolAlpha::sShowDebugAlpha; // Don't alpha mask if "Highlight Transparent" checked | 4156 | && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked |
4157 | && !(isSelf() && gAgent.cameraCustomizeAvatar()); // don't alpha mask if in customize mode | ||
4146 | 4158 | ||
4147 | LLGLState test(GL_ALPHA_TEST, should_alpha_mask); | 4159 | LLGLState test(GL_ALPHA_TEST, should_alpha_mask); |
4148 | 4160 | ||
@@ -4179,11 +4191,8 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) | |||
4179 | 4191 | ||
4180 | if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender) | 4192 | if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender) |
4181 | { | 4193 | { |
4182 | if (!mIsDummy) | 4194 | LLGLState blend(GL_BLEND, !mIsDummy); |
4183 | { | 4195 | LLGLState test(GL_ALPHA_TEST, !mIsDummy); |
4184 | LLGLEnable blend(GL_BLEND); | ||
4185 | LLGLEnable test(GL_ALPHA_TEST); | ||
4186 | } | ||
4187 | num_indices += renderTransparent(first_pass); | 4196 | num_indices += renderTransparent(first_pass); |
4188 | } | 4197 | } |
4189 | } | 4198 | } |
@@ -4261,7 +4270,7 @@ U32 LLVOAvatar::renderRigid() | |||
4261 | if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) | 4270 | if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) |
4262 | { | 4271 | { |
4263 | // If the meshes need to be drawn, enable alpha masking but not blending | 4272 | // If the meshes need to be drawn, enable alpha masking but not blending |
4264 | bool should_alpha_mask = mHasBakedHair && mBakedTextureData[BAKED_EYES].mIsLoaded; | 4273 | bool should_alpha_mask = mHasBakedHair && mBakedTextureData[BAKED_EYES].mIsLoaded && !(isSelf() && gAgent.cameraCustomizeAvatar()); |
4265 | LLGLState test(GL_ALPHA_TEST, should_alpha_mask); | 4274 | LLGLState test(GL_ALPHA_TEST, should_alpha_mask); |
4266 | 4275 | ||
4267 | if (should_alpha_mask) | 4276 | if (should_alpha_mask) |
@@ -6948,10 +6957,6 @@ void LLVOAvatar::updateMeshTextures() | |||
6948 | } | 6957 | } |
6949 | else | 6958 | else |
6950 | { | 6959 | { |
6951 | for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) | ||
6952 | { | ||
6953 | mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); | ||
6954 | } | ||
6955 | mHasBakedHair = TRUE; | 6960 | mHasBakedHair = TRUE; |
6956 | } | 6961 | } |
6957 | 6962 | ||
@@ -7761,7 +7766,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) | |||
7761 | } | 7766 | } |
7762 | 7767 | ||
7763 | LLMemType mt(LLMemType::MTYPE_AVATAR); | 7768 | LLMemType mt(LLMemType::MTYPE_AVATAR); |
7764 | 7769 | ||
7765 | // llinfos << "processAvatarAppearance start " << mID << llendl; | 7770 | // llinfos << "processAvatarAppearance start " << mID << llendl; |
7766 | BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; | 7771 | BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; |
7767 | 7772 | ||
@@ -7789,6 +7794,18 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) | |||
7789 | unpackTEMessage(mesgsys, _PREHASH_ObjectData); | 7794 | unpackTEMessage(mesgsys, _PREHASH_ObjectData); |
7790 | // dumpAvatarTEs( "POST processAvatarAppearance()" ); | 7795 | // dumpAvatarTEs( "POST processAvatarAppearance()" ); |
7791 | 7796 | ||
7797 | // prevent the overwriting of valid baked textures with invalid baked textures | ||
7798 | for (U8 baked_index = 0; baked_index < mBakedTextureData.size(); baked_index++) | ||
7799 | { | ||
7800 | if (!isTextureDefined(mBakedTextureData[baked_index].mTextureIndex) | ||
7801 | && mBakedTextureData[baked_index].mLastTextureIndex != IMG_DEFAULT | ||
7802 | && baked_index != BAKED_SKIRT) | ||
7803 | { | ||
7804 | setTEImage(mBakedTextureData[baked_index].mTextureIndex, gImageList.getImage(mBakedTextureData[baked_index].mLastTextureIndex)); | ||
7805 | } | ||
7806 | } | ||
7807 | |||
7808 | |||
7792 | //llinfos << "Received AvatarAppearance: " << (mIsSelf ? "(self): " : "(other): ") << std::endl << | 7809 | //llinfos << "Received AvatarAppearance: " << (mIsSelf ? "(self): " : "(other): ") << std::endl << |
7793 | // (isTextureDefined(TEX_HEAD_BAKED) ? "HEAD " : "head " ) << (getTEImage(TEX_HEAD_BAKED)->getID()) << std::endl << | 7810 | // (isTextureDefined(TEX_HEAD_BAKED) ? "HEAD " : "head " ) << (getTEImage(TEX_HEAD_BAKED)->getID()) << std::endl << |
7794 | // (isTextureDefined(TEX_UPPER_BAKED) ? "UPPER " : "upper " ) << (getTEImage(TEX_UPPER_BAKED)->getID()) << std::endl << | 7811 | // (isTextureDefined(TEX_UPPER_BAKED) ? "UPPER " : "upper " ) << (getTEImage(TEX_UPPER_BAKED)->getID()) << std::endl << |
@@ -8095,6 +8112,17 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) | |||
8095 | { | 8112 | { |
8096 | setLocalTexture(*local_tex_iter, getTEImage(*local_tex_iter), TRUE); | 8113 | setLocalTexture(*local_tex_iter, getTEImage(*local_tex_iter), TRUE); |
8097 | } | 8114 | } |
8115 | |||
8116 | // ! BACKWARDS COMPATIBILITY ! | ||
8117 | // Workaround for viewing avatars from old viewers that haven't baked hair textures. | ||
8118 | // This is paired with similar code in updateMeshTextures that sets hair mesh color. | ||
8119 | if (i == BAKED_HAIR) | ||
8120 | { | ||
8121 | for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) | ||
8122 | { | ||
8123 | mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); | ||
8124 | } | ||
8125 | } | ||
8098 | } | 8126 | } |
8099 | } | 8127 | } |
8100 | 8128 | ||