diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a57e9bc..bb8d065 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1016,7 +1016,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1016 | public int LinkNum | 1016 | public int LinkNum |
1017 | { | 1017 | { |
1018 | get { return m_linkNum; } | 1018 | get { return m_linkNum; } |
1019 | set { m_linkNum = value; } | 1019 | set |
1020 | { | ||
1021 | // if (ParentGroup != null) | ||
1022 | // { | ||
1023 | // m_log.DebugFormat( | ||
1024 | // "[SCENE OBJECT PART]: Setting linknum of {0}@{1} to {2} from {3}", | ||
1025 | // Name, AbsolutePosition, value, m_linkNum); | ||
1026 | // Util.PrintCallStack(); | ||
1027 | // } | ||
1028 | |||
1029 | m_linkNum = value; | ||
1030 | } | ||
1020 | } | 1031 | } |
1021 | 1032 | ||
1022 | public byte ClickAction | 1033 | public byte ClickAction |
@@ -2153,6 +2164,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2153 | /// <param name="isNew"></param> | 2164 | /// <param name="isNew"></param> |
2154 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) | 2165 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) |
2155 | { | 2166 | { |
2167 | if (ParentGroup.Scene == null) | ||
2168 | return; | ||
2169 | |||
2156 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) | 2170 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) |
2157 | return; | 2171 | return; |
2158 | 2172 | ||
@@ -3621,7 +3635,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3621 | hasProfileCut = hasDimple; // is it the same thing? | 3635 | hasProfileCut = hasDimple; // is it the same thing? |
3622 | } | 3636 | } |
3623 | 3637 | ||
3624 | |||
3625 | public void SetGroup(UUID groupID, IClientAPI client) | 3638 | public void SetGroup(UUID groupID, IClientAPI client) |
3626 | { | 3639 | { |
3627 | // Scene.AddNewPrims() calls with client == null so can't use this. | 3640 | // Scene.AddNewPrims() calls with client == null so can't use this. |
@@ -3651,10 +3664,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3651 | 3664 | ||
3652 | public void SetPhysicsAxisRotation() | 3665 | public void SetPhysicsAxisRotation() |
3653 | { | 3666 | { |
3654 | if (PhysActor != null) | 3667 | PhysicsActor pa = PhysActor; |
3668 | |||
3669 | if (pa != null) | ||
3655 | { | 3670 | { |
3656 | PhysActor.LockAngularMotion(RotationAxis); | 3671 | pa.LockAngularMotion(RotationAxis); |
3657 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 3672 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); |
3658 | } | 3673 | } |
3659 | } | 3674 | } |
3660 | 3675 | ||
@@ -4371,7 +4386,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4371 | // For now, we use the NINJA naming scheme for identifying joints. | 4386 | // For now, we use the NINJA naming scheme for identifying joints. |
4372 | // In the future, we can support other joint specification schemes such as a | 4387 | // In the future, we can support other joint specification schemes such as a |
4373 | // custom checkbox in the viewer GUI. | 4388 | // custom checkbox in the viewer GUI. |
4374 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4389 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4375 | { | 4390 | { |
4376 | string hingeString = "hingejoint"; | 4391 | string hingeString = "hingejoint"; |
4377 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); | 4392 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); |
@@ -4387,7 +4402,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4387 | // For now, we use the NINJA naming scheme for identifying joints. | 4402 | // For now, we use the NINJA naming scheme for identifying joints. |
4388 | // In the future, we can support other joint specification schemes such as a | 4403 | // In the future, we can support other joint specification schemes such as a |
4389 | // custom checkbox in the viewer GUI. | 4404 | // custom checkbox in the viewer GUI. |
4390 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4405 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4391 | { | 4406 | { |
4392 | string ballString = "balljoint"; | 4407 | string ballString = "balljoint"; |
4393 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); | 4408 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); |
@@ -4403,7 +4418,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4403 | // For now, we use the NINJA naming scheme for identifying joints. | 4418 | // For now, we use the NINJA naming scheme for identifying joints. |
4404 | // In the future, we can support other joint specification schemes such as a | 4419 | // In the future, we can support other joint specification schemes such as a |
4405 | // custom checkbox in the viewer GUI. | 4420 | // custom checkbox in the viewer GUI. |
4406 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4421 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4407 | { | 4422 | { |
4408 | return IsHingeJoint() || IsBallJoint(); | 4423 | return IsHingeJoint() || IsBallJoint(); |
4409 | } | 4424 | } |
@@ -4524,7 +4539,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4524 | } | 4539 | } |
4525 | */ | 4540 | */ |
4526 | } | 4541 | } |
4527 | |||
4528 | else // it already has a physical representation | 4542 | else // it already has a physical representation |
4529 | { | 4543 | { |
4530 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. | 4544 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. |