diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b0bc188..82bba35 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2091,6 +2091,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2091 | /// <param name="isNew"></param> | 2091 | /// <param name="isNew"></param> |
2092 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) | 2092 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) |
2093 | { | 2093 | { |
2094 | if (ParentGroup.Scene == null) | ||
2095 | return; | ||
2096 | |||
2094 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) | 2097 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) |
2095 | return; | 2098 | return; |
2096 | 2099 | ||
@@ -3832,7 +3835,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3832 | hasProfileCut = hasDimple; // is it the same thing? | 3835 | hasProfileCut = hasDimple; // is it the same thing? |
3833 | } | 3836 | } |
3834 | 3837 | ||
3835 | |||
3836 | public void SetGroup(UUID groupID, IClientAPI client) | 3838 | public void SetGroup(UUID groupID, IClientAPI client) |
3837 | { | 3839 | { |
3838 | // Scene.AddNewPrims() calls with client == null so can't use this. | 3840 | // Scene.AddNewPrims() calls with client == null so can't use this. |
@@ -3862,10 +3864,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3862 | 3864 | ||
3863 | public void SetPhysicsAxisRotation() | 3865 | public void SetPhysicsAxisRotation() |
3864 | { | 3866 | { |
3865 | if (PhysActor != null) | 3867 | PhysicsActor pa = PhysActor; |
3868 | |||
3869 | if (pa != null) | ||
3866 | { | 3870 | { |
3867 | PhysActor.LockAngularMotion(RotationAxis); | 3871 | pa.LockAngularMotion(RotationAxis); |
3868 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 3872 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); |
3869 | } | 3873 | } |
3870 | } | 3874 | } |
3871 | 3875 | ||
@@ -4582,7 +4586,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4582 | // For now, we use the NINJA naming scheme for identifying joints. | 4586 | // For now, we use the NINJA naming scheme for identifying joints. |
4583 | // In the future, we can support other joint specification schemes such as a | 4587 | // In the future, we can support other joint specification schemes such as a |
4584 | // custom checkbox in the viewer GUI. | 4588 | // custom checkbox in the viewer GUI. |
4585 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4589 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4586 | { | 4590 | { |
4587 | string hingeString = "hingejoint"; | 4591 | string hingeString = "hingejoint"; |
4588 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); | 4592 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); |
@@ -4598,7 +4602,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4598 | // For now, we use the NINJA naming scheme for identifying joints. | 4602 | // For now, we use the NINJA naming scheme for identifying joints. |
4599 | // In the future, we can support other joint specification schemes such as a | 4603 | // In the future, we can support other joint specification schemes such as a |
4600 | // custom checkbox in the viewer GUI. | 4604 | // custom checkbox in the viewer GUI. |
4601 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4605 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4602 | { | 4606 | { |
4603 | string ballString = "balljoint"; | 4607 | string ballString = "balljoint"; |
4604 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); | 4608 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); |
@@ -4614,7 +4618,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4614 | // For now, we use the NINJA naming scheme for identifying joints. | 4618 | // For now, we use the NINJA naming scheme for identifying joints. |
4615 | // In the future, we can support other joint specification schemes such as a | 4619 | // In the future, we can support other joint specification schemes such as a |
4616 | // custom checkbox in the viewer GUI. | 4620 | // custom checkbox in the viewer GUI. |
4617 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4621 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4618 | { | 4622 | { |
4619 | return IsHingeJoint() || IsBallJoint(); | 4623 | return IsHingeJoint() || IsBallJoint(); |
4620 | } | 4624 | } |
@@ -4733,7 +4737,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4733 | } | 4737 | } |
4734 | } | 4738 | } |
4735 | } | 4739 | } |
4736 | |||
4737 | else // it already has a physical representation | 4740 | else // it already has a physical representation |
4738 | { | 4741 | { |
4739 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. | 4742 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. |