BulletSim: fix exceptions caused by setting physical properties before the prim body is initialized.

user_profiles
Robert Adams 2013-02-07 14:44:12 -08:00
parent ebb63b55aa
commit b545e13184
1 changed files with 10 additions and 5 deletions

View File

@ -587,6 +587,7 @@ public sealed class BSPrim : BSPhysObject
base.SetMaterial(material); base.SetMaterial(material);
PhysicsScene.TaintedObject("BSPrim.SetMaterial", delegate() PhysicsScene.TaintedObject("BSPrim.SetMaterial", delegate()
{ {
if (PhysBody.HasPhysicalBody)
UpdatePhysicalParameters(); UpdatePhysicalParameters();
}); });
} }
@ -600,6 +601,7 @@ public sealed class BSPrim : BSPhysObject
base.Friction = value; base.Friction = value;
PhysicsScene.TaintedObject("BSPrim.setFriction", delegate() PhysicsScene.TaintedObject("BSPrim.setFriction", delegate()
{ {
if (PhysBody.HasPhysicalBody)
UpdatePhysicalParameters(); UpdatePhysicalParameters();
}); });
} }
@ -615,6 +617,7 @@ public sealed class BSPrim : BSPhysObject
base.Restitution = value; base.Restitution = value;
PhysicsScene.TaintedObject("BSPrim.setRestitution", delegate() PhysicsScene.TaintedObject("BSPrim.setRestitution", delegate()
{ {
if (PhysBody.HasPhysicalBody)
UpdatePhysicalParameters(); UpdatePhysicalParameters();
}); });
} }
@ -630,6 +633,7 @@ public sealed class BSPrim : BSPhysObject
base.Density = value; base.Density = value;
PhysicsScene.TaintedObject("BSPrim.setDensity", delegate() PhysicsScene.TaintedObject("BSPrim.setDensity", delegate()
{ {
if (PhysBody.HasPhysicalBody)
UpdatePhysicalParameters(); UpdatePhysicalParameters();
}); });
} }
@ -645,6 +649,7 @@ public sealed class BSPrim : BSPhysObject
base.GravityModifier = value; base.GravityModifier = value;
PhysicsScene.TaintedObject("BSPrim.setGravityModifier", delegate() PhysicsScene.TaintedObject("BSPrim.setGravityModifier", delegate()
{ {
if (PhysBody.HasPhysicalBody)
UpdatePhysicalParameters(); UpdatePhysicalParameters();
}); });
} }