1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-19 03:39:08 +00:00

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.
This commit is contained in:
Skoader
2012-01-28 13:08:16 +11:00
parent a35a942ab2
commit c0b428b342

View File

@ -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();
spans->GetSpaceTree()->MakeDirty();
// Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell // Where were we? Oh yeah... if this avatar is in view it needs a texture. Tell
// the pipeline. // the pipeline.
if (preMsg->Pipeline()->TestVisibleWorld(spans->GetSpaceTree()->GetWorldBounds())) const hsBounds3Ext &bnds = spans->GetSpaceTree()->GetWorldBounds();
preMsg->Pipeline()->SubmitClothingOutfit(this); if ((bnds.GetType() == kBoundsNormal) && preMsg->Pipeline()->TestVisibleWorld(bnds))
} preMsg->Pipeline()->SubmitClothingOutfit(this);
} }
} }