From c0b428b3425b714e3c78884dee0583dd6c298900 Mon Sep 17 00:00:00 2001 From: Skoader Date: Sat, 28 Jan 2012 13:08:16 +1100 Subject: [PATCH] Fix avatar clothing bounds test. The bounds type test was performed on stale bounding data from the previous frame resulting in the avatar being drawn without textures for a frame after switching from 1st to 3rd person camera. --- .../PubUtilLib/plAvatar/plAvatarClothing.cpp | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 4bbf6d9e..d43751b0 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -1232,24 +1232,21 @@ hsBool plClothingOutfit::MsgReceive(plMessage* msg) if (fAvatar && fGroup != plClothingMgr::kClothingBaseNoOptions) { plDrawable *spans = fAvatar->FindDrawable(); - const hsBounds3Ext &bnds = spans->GetWorldBounds(); - if (bnds.GetType() == kBoundsNormal) - { - // This is a bit hacky... The drawable code has just run through and updated - // each span's bounds (see plDrawableSpans::IUpdateMatrixPaletteBoundsHack()) - // but not the world bounds for the entire drawable. So we tell the space tree - // to refresh. However, the pageTreeMgr would then get confused because the - // space tree is no longer dirty (see plPageTreeMgr::IRefreshTree()), - // causing the avatar to only draw if the origin is in view. - // So we just force it dirty, and everyone's happy. - spans->GetSpaceTree()->Refresh(); - spans->GetSpaceTree()->MakeDirty(); - - // Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell - // the pipeline. - if (preMsg->Pipeline()->TestVisibleWorld(spans->GetSpaceTree()->GetWorldBounds())) - preMsg->Pipeline()->SubmitClothingOutfit(this); - } + // This is a bit hacky... The drawable code has just run through and updated + // each span's bounds (see plDrawableSpans::IUpdateMatrixPaletteBoundsHack()) + // but not the world bounds for the entire drawable. So we tell the space tree + // to refresh. However, the pageTreeMgr would then get confused because the + // space tree is no longer dirty (see plPageTreeMgr::IRefreshTree()), + // causing the avatar to only draw if the origin is in view. + // So we just force it dirty, and everyone's happy. + spans->GetSpaceTree()->Refresh(); + spans->GetSpaceTree()->MakeDirty(); + + // Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell + // the pipeline. + const hsBounds3Ext &bnds = spans->GetSpaceTree()->GetWorldBounds(); + if ((bnds.GetType() == kBoundsNormal) && preMsg->Pipeline()->TestVisibleWorld(bnds)) + preMsg->Pipeline()->SubmitClothingOutfit(this); } }