From e1153394c1346bd3741590c17ab38c735384e642 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 29 Nov 2008 07:05:33 +0000 Subject: Stop attachments from twisting away. Thismakes attachments phantom, which is the proper way to handle this --- OpenSim/Region/Environment/Scenes/Scene.cs | 1 + OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c67d994..c8285a3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2173,6 +2173,7 @@ namespace OpenSim.Region.Environment.Scenes if (sp != null) parentLocalID = sp.LocalId; + sceneObject.RootPart.IsAttachment = true; sceneObject.RootPart.SetParentLocalId(parentLocalID); AddRestoredSceneObject(sceneObject, false, false); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9fa4405..b15aff8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -541,7 +541,7 @@ namespace OpenSim.Region.Environment.Scenes get { // We don't want the physics engine mucking up the rotations in a linkset - if (PhysActor != null && _parentID == 0) + if ((_parentID == 0) && (Shape.PCode != 9 || Shape.State == 0) && (PhysActor != null)) { if (PhysActor.Orientation.X != 0 || PhysActor.Orientation.Y != 0 || PhysActor.Orientation.Z != 0 || PhysActor.Orientation.W != 0) @@ -1193,8 +1193,8 @@ if (m_shape != null) { // Added clarification.. since A rigid body is an object that you can kick around, etc. bool RigidBody = isPhysical && !isPhantom; - // The only time the physics scene shouldn't know about the prim is if it's phantom - if (!isPhantom) + // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition + if (!isPhantom && !IsAttachment) { PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( Name, @@ -3090,7 +3090,7 @@ if (m_shape != null) { } } - if (IsPhantom) + if (IsPhantom || IsAttachment) { AddFlag(PrimFlags.Phantom); if (PhysActor != null) -- cgit v1.1