aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs25
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a7d1809..a23ebbf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2319,6 +2319,17 @@ namespace OpenSim.Region.Framework.Scenes
2319 2319
2320 if (pa != null) 2320 if (pa != null)
2321 { 2321 {
2322 if (UsePhysics != pa.IsPhysical)
2323 {
2324 float minsize = UsePhysics ? ParentGroup.Scene.m_minPhys : ParentGroup.Scene.m_minNonphys;
2325 float maxsize = UsePhysics ? ParentGroup.Scene.m_maxPhys : ParentGroup.Scene.m_maxNonphys;
2326 Vector3 scale = Scale;
2327 scale.X = Util.Clamp(scale.X, minsize, maxsize);
2328 scale.Y = Util.Clamp(scale.Y, minsize, maxsize);
2329 scale.Z = Util.Clamp(scale.Z, minsize, maxsize);
2330 Scale = scale;
2331 }
2332
2322 if (UsePhysics != pa.IsPhysical || isNew) 2333 if (UsePhysics != pa.IsPhysical || isNew)
2323 { 2334 {
2324 if (pa.IsPhysical) // implies UsePhysics==false for this block 2335 if (pa.IsPhysical) // implies UsePhysics==false for this block
@@ -4776,10 +4787,20 @@ namespace OpenSim.Region.Framework.Scenes
4776 /// <param name="applyDynamics">applies velocities, force and torque</param> 4787 /// <param name="applyDynamics">applies velocities, force and torque</param>
4777 private void AddToPhysics(bool isPhysical, bool isPhantom, bool building, bool applyDynamics) 4788 private void AddToPhysics(bool isPhysical, bool isPhantom, bool building, bool applyDynamics)
4778 { 4789 {
4779 PhysicsActor pa; 4790 if (ParentGroup.Scene != null)
4791 {
4792 float minsize = isPhysical ? ParentGroup.Scene.m_minPhys : ParentGroup.Scene.m_minNonphys;
4793 float maxsize = isPhysical ? ParentGroup.Scene.m_maxPhys : ParentGroup.Scene.m_maxNonphys;
4794 Vector3 scale = Scale;
4795 scale.X = Util.Clamp(scale.X, minsize, maxsize);
4796 scale.Y = Util.Clamp(scale.Y, minsize, maxsize);
4797 scale.Z = Util.Clamp(scale.Z, minsize, maxsize);
4798 Scale = scale;
4799 }
4780 4800
4801 PhysicsActor pa;
4781 Vector3 velocity = Velocity; 4802 Vector3 velocity = Velocity;
4782 Vector3 rotationalVelocity = AngularVelocity;; 4803 Vector3 rotationalVelocity = AngularVelocity; ;
4783 4804
4784 try 4805 try
4785 { 4806 {