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!
|
// Called at taint-time!
|
||||||
public abstract bool MakeDynamic(BSPrimLinkable child);
|
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
|
// The object is going static (non-physical). Do any setup necessary
|
||||||
// for a static linkset.
|
// for a static linkset.
|
||||||
// Return 'true' if any properties updated on the passed object.
|
// 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,
|
// A linkset is incomplete when base objects are incomplete, waiting for assets,
|
||||||
// or being rebuilt.
|
// or being rebuilt.
|
||||||
bool ret = false;
|
return (base.IsIncomplete || Linkset.RebuildScheduled || !Linkset.AllPartsComplete);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue