BulletSim: add BSLinkset.AllPartsComplete that checks of all linkset members are not Incomplete and not waiting for assets. Change BSPrimLinkable to use AllPartsComplete.
parent
eef954a214
commit
41a943bfd0
|
@ -316,6 +316,23 @@ public abstract class BSLinkset
|
|||
// Called at taint-time!
|
||||
public abstract bool MakeDynamic(BSPrimLinkable child);
|
||||
|
||||
public virtual bool AllPartsComplete
|
||||
{
|
||||
get {
|
||||
bool ret = true;
|
||||
this.ForEachMember((member) =>
|
||||
{
|
||||
if (member.IsIncomplete || member.PrimAssetState == BSPhysObject.PrimAssetCondition.Waiting)
|
||||
{
|
||||
ret = false;
|
||||
return true; // exit loop
|
||||
}
|
||||
return false; // continue loop
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// The object is going static (non-physical). Do any setup necessary
|
||||
// for a static linkset.
|
||||
// Return 'true' if any properties updated on the passed object.
|
||||
|
|
|
@ -60,27 +60,7 @@ public class BSPrimLinkable : BSPrimDisplaced
|
|||
{
|
||||
// A linkset is incomplete when base objects are incomplete, waiting for assets,
|
||||
// or being rebuilt.
|
||||
bool ret = false;
|
||||
if (base.IsIncomplete || Linkset.RebuildScheduled)
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Linkset.IsRoot(this))
|
||||
{
|
||||
Linkset.ForEachMember((member) =>
|
||||
{
|
||||
if (member.PrimAssetState == PrimAssetCondition.Waiting)
|
||||
{
|
||||
ret = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return (base.IsIncomplete || Linkset.RebuildScheduled || !Linkset.AllPartsComplete);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue