diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 046553b..4bec2d4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1706,6 +1706,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1706 | /// <param name="isNew"></param> | 1706 | /// <param name="isNew"></param> |
1707 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) | 1707 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) |
1708 | { | 1708 | { |
1709 | if (ParentGroup.Scene == null) | ||
1710 | return; | ||
1711 | |||
1709 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) | 1712 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) |
1710 | return; | 1713 | return; |
1711 | 1714 | ||
@@ -4161,7 +4164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4161 | // For now, we use the NINJA naming scheme for identifying joints. | 4164 | // For now, we use the NINJA naming scheme for identifying joints. |
4162 | // In the future, we can support other joint specification schemes such as a | 4165 | // In the future, we can support other joint specification schemes such as a |
4163 | // custom checkbox in the viewer GUI. | 4166 | // custom checkbox in the viewer GUI. |
4164 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4167 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4165 | { | 4168 | { |
4166 | string hingeString = "hingejoint"; | 4169 | string hingeString = "hingejoint"; |
4167 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); | 4170 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); |
@@ -4177,7 +4180,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4177 | // For now, we use the NINJA naming scheme for identifying joints. | 4180 | // For now, we use the NINJA naming scheme for identifying joints. |
4178 | // In the future, we can support other joint specification schemes such as a | 4181 | // In the future, we can support other joint specification schemes such as a |
4179 | // custom checkbox in the viewer GUI. | 4182 | // custom checkbox in the viewer GUI. |
4180 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4183 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4181 | { | 4184 | { |
4182 | string ballString = "balljoint"; | 4185 | string ballString = "balljoint"; |
4183 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); | 4186 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); |
@@ -4193,7 +4196,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4193 | // For now, we use the NINJA naming scheme for identifying joints. | 4196 | // For now, we use the NINJA naming scheme for identifying joints. |
4194 | // In the future, we can support other joint specification schemes such as a | 4197 | // In the future, we can support other joint specification schemes such as a |
4195 | // custom checkbox in the viewer GUI. | 4198 | // custom checkbox in the viewer GUI. |
4196 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4199 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4197 | { | 4200 | { |
4198 | return IsHingeJoint() || IsBallJoint(); | 4201 | return IsHingeJoint() || IsBallJoint(); |
4199 | } | 4202 | } |
@@ -4287,7 +4290,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4287 | AddFlag(PrimFlags.Phantom); | 4290 | AddFlag(PrimFlags.Phantom); |
4288 | 4291 | ||
4289 | if (PhysActor != null) | 4292 | if (PhysActor != null) |
4293 | { | ||
4290 | RemoveFromPhysics(); | 4294 | RemoveFromPhysics(); |
4295 | pa = null; | ||
4296 | } | ||
4291 | } | 4297 | } |
4292 | else // Not phantom | 4298 | else // Not phantom |
4293 | { | 4299 | { |
@@ -4353,7 +4359,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4353 | { | 4359 | { |
4354 | pa.SetVolumeDetect(1); | 4360 | pa.SetVolumeDetect(1); |
4355 | AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active | 4361 | AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active |
4356 | this.VolumeDetectActive = true; | 4362 | VolumeDetectActive = true; |
4357 | } | 4363 | } |
4358 | } | 4364 | } |
4359 | else | 4365 | else |
@@ -4361,9 +4367,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4361 | // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like | 4367 | // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like |
4362 | // (mumbles, well, at least if you have infinte CPU powers :-)) | 4368 | // (mumbles, well, at least if you have infinte CPU powers :-)) |
4363 | if (pa != null) | 4369 | if (pa != null) |
4364 | PhysActor.SetVolumeDetect(0); | 4370 | pa.SetVolumeDetect(0); |
4365 | 4371 | ||
4366 | this.VolumeDetectActive = false; | 4372 | VolumeDetectActive = false; |
4367 | } | 4373 | } |
4368 | 4374 | ||
4369 | if (SetTemporary) | 4375 | if (SetTemporary) |