Browse Source

Fix avatar clothing bounds test.

Bounds type needs be checked after refreshing the bsp tree.
Skoader 13 years ago committed by Adam Johnson
parent
commit
2290aab5a8
  1. 33
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

33
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

@ -1232,24 +1232,21 @@ hsBool plClothingOutfit::MsgReceive(plMessage* msg)
if (fAvatar && fGroup != plClothingMgr::kClothingBaseNoOptions) if (fAvatar && fGroup != plClothingMgr::kClothingBaseNoOptions)
{ {
plDrawable *spans = fAvatar->FindDrawable(); plDrawable *spans = fAvatar->FindDrawable();
const hsBounds3Ext &bnds = spans->GetWorldBounds(); // This is a bit hacky... The drawable code has just run through and updated
if (bnds.GetType() == kBoundsNormal) // each span's bounds (see plDrawableSpans::IUpdateMatrixPaletteBoundsHack())
{ // but not the world bounds for the entire drawable. So we tell the space tree
// This is a bit hacky... The drawable code has just run through and updated // to refresh. However, the pageTreeMgr would then get confused because the
// each span's bounds (see plDrawableSpans::IUpdateMatrixPaletteBoundsHack()) // space tree is no longer dirty (see plPageTreeMgr::IRefreshTree()),
// but not the world bounds for the entire drawable. So we tell the space tree // causing the avatar to only draw if the origin is in view.
// to refresh. However, the pageTreeMgr would then get confused because the // So we just force it dirty, and everyone's happy.
// space tree is no longer dirty (see plPageTreeMgr::IRefreshTree()), spans->GetSpaceTree()->Refresh();
// causing the avatar to only draw if the origin is in view. spans->GetSpaceTree()->MakeDirty();
// So we just force it dirty, and everyone's happy.
spans->GetSpaceTree()->Refresh(); // Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell
spans->GetSpaceTree()->MakeDirty(); // the pipeline.
const hsBounds3Ext &bnds = spans->GetSpaceTree()->GetWorldBounds();
// Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell if ((bnds.GetType() == kBoundsNormal) && preMsg->Pipeline()->TestVisibleWorld(bnds))
// the pipeline. preMsg->Pipeline()->SubmitClothingOutfit(this);
if (preMsg->Pipeline()->TestVisibleWorld(spans->GetSpaceTree()->GetWorldBounds()))
preMsg->Pipeline()->SubmitClothingOutfit(this);
}
} }
} }

Loading…
Cancel
Save