BulletSim: remove the unused RestoreBodyDependencies used by linksets
and vehicles and clean up code by removing their kludgyness.user_profiles
parent
c1795ed399
commit
a0d460e6bf
|
@ -290,13 +290,6 @@ public sealed class BSLinksetCompound : BSLinkset
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Companion to RemoveBodyDependencies(). If RemoveBodyDependencies() returns 'true',
|
||||
// this routine will restore the removed constraints.
|
||||
// Called at taint-time!!
|
||||
public override void RestoreBodyDependencies(BSPrim child)
|
||||
{
|
||||
}
|
||||
|
||||
// When the linkset is built, the child shape is added to the compound shape relative to the
|
||||
// root shape. The linkset then moves around but this does not move the actual child
|
||||
// prim. The child prim's location must be recomputed based on the location of the root shape.
|
||||
|
|
|
@ -110,14 +110,6 @@ public sealed class BSLinksetConstraints : BSLinkset
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Companion to RemoveBodyDependencies(). If RemoveBodyDependencies() returns 'true',
|
||||
// this routine will restore the removed constraints.
|
||||
// Called at taint-time!!
|
||||
public override void RestoreBodyDependencies(BSPrim child)
|
||||
{
|
||||
// The Refresh operation queued by RemoveBodyDependencies() will build any missing constraints.
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
|
||||
// Add a new child to the linkset.
|
||||
|
|
|
@ -1606,11 +1606,6 @@ public sealed class BSPrim : BSPhysObject
|
|||
// Called at taint-time!!!
|
||||
public void CreateGeomAndObject(bool forceRebuild)
|
||||
{
|
||||
// If this prim is part of a linkset, we must remove and restore the physical
|
||||
// links if the body is rebuilt.
|
||||
bool needToRestoreLinkset = false;
|
||||
bool needToRestoreVehicle = false;
|
||||
|
||||
// Create the correct physical representation for this type of object.
|
||||
// Updates PhysBody and PhysShape with the new information.
|
||||
// Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary.
|
||||
|
@ -1619,21 +1614,10 @@ public sealed class BSPrim : BSPhysObject
|
|||
// Called if the current prim body is about to be destroyed.
|
||||
// Remove all the physical dependencies on the old body.
|
||||
// (Maybe someday make the changing of BSShape an event to be subscribed to by BSLinkset, ...)
|
||||
needToRestoreLinkset = Linkset.RemoveBodyDependencies(this);
|
||||
needToRestoreVehicle = _vehicle.RemoveBodyDependencies(this);
|
||||
Linkset.RemoveBodyDependencies(this);
|
||||
_vehicle.RemoveBodyDependencies(this);
|
||||
});
|
||||
|
||||
if (needToRestoreLinkset)
|
||||
{
|
||||
// If physical body dependencies were removed, restore them
|
||||
Linkset.RestoreBodyDependencies(this);
|
||||
}
|
||||
if (needToRestoreVehicle)
|
||||
{
|
||||
// If physical body dependencies were removed, restore them
|
||||
_vehicle.RestoreBodyDependencies(this);
|
||||
}
|
||||
|
||||
// Make sure the properties are set on the new object
|
||||
UpdatePhysicalParameters();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue