aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorMelanie2012-04-07 04:52:14 +0100
committerMelanie2012-04-07 04:52:14 +0100
commitb39de2425cac4c2a94a7fdd6c77100ef831d66b4 (patch)
tree9258928681a82d68b408354e534c32bcf283ad3a /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
parentMerge branch 'ubitwork' (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-b39de2425cac4c2a94a7fdd6c77100ef831d66b4.zip
opensim-SC_OLD-b39de2425cac4c2a94a7fdd6c77100ef831d66b4.tar.gz
opensim-SC_OLD-b39de2425cac4c2a94a7fdd6c77100ef831d66b4.tar.bz2
opensim-SC_OLD-b39de2425cac4c2a94a7fdd6c77100ef831d66b4.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/CoreModules/World/Land/LandObject.cs OpenSim/Region/Framework/Scenes/Scene.Inventory.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs82
1 files changed, 60 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 951e987..969ddaf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -126,12 +126,14 @@ namespace OpenSim.Region.Framework.Scenes
126 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 126 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
127 127
128 /// <value> 128 /// <value>
129 /// Is this sop a root part? 129 /// Is this a root part?
130 /// </value> 130 /// </value>
131 131 /// <remarks>
132 /// This will return true even if the whole object is attached to an avatar.
133 /// </remarks>
132 public bool IsRoot 134 public bool IsRoot
133 { 135 {
134 get { return ParentGroup.RootPart == this; } 136 get { return ParentGroup.RootPart == this; }
135 } 137 }
136 138
137 #region Fields 139 #region Fields
@@ -160,15 +162,7 @@ namespace OpenSim.Region.Framework.Scenes
160 /// If another thread is simultaneously turning physics off on this part then this refernece could become 162 /// If another thread is simultaneously turning physics off on this part then this refernece could become
161 /// null at any time. 163 /// null at any time.
162 /// </remarks> 164 /// </remarks>
163 public PhysicsActor PhysActor 165 public PhysicsActor PhysActor { get; set; }
164 {
165 get { return m_physActor; }
166 set
167 {
168// m_log.DebugFormat("[SOP]: PhysActor set to {0} for {1} {2}", value, Name, UUID);
169 m_physActor = value;
170 }
171 }
172 166
173 //Xantor 20080528 Sound stuff: 167 //Xantor 20080528 Sound stuff:
174 // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. 168 // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet.
@@ -188,10 +182,6 @@ namespace OpenSim.Region.Framework.Scenes
188 public uint TimeStampLastActivity; // Will be used for AutoReturn 182 public uint TimeStampLastActivity; // Will be used for AutoReturn
189 183
190 public uint TimeStampTerse; 184 public uint TimeStampTerse;
191
192 public UUID FromItemID;
193
194 public UUID FromFolderID;
195 185
196 // The following two are to hold the attachment data 186 // The following two are to hold the attachment data
197 // while an object is inworld 187 // while an object is inworld
@@ -275,7 +265,6 @@ namespace OpenSim.Region.Framework.Scenes
275 265
276 private bool m_passTouches; 266 private bool m_passTouches;
277 267
278 private PhysicsActor m_physActor;
279 protected Vector3 m_acceleration; 268 protected Vector3 m_acceleration;
280 protected Vector3 m_angularVelocity; 269 protected Vector3 m_angularVelocity;
281 270
@@ -1149,6 +1138,14 @@ namespace OpenSim.Region.Framework.Scenes
1149 } 1138 }
1150 } 1139 }
1151 1140
1141 /// <summary>
1142 /// The parent ID of this part.
1143 /// </summary>
1144 /// <remarks>
1145 /// If this is a root part which is not attached to an avatar then the value will be 0.
1146 /// If this is a root part which is attached to an avatar then the value is the local id of that avatar.
1147 /// If this is a child part then the value is the local ID of the root part.
1148 /// </remarks>
1152 public uint ParentID 1149 public uint ParentID
1153 { 1150 {
1154 get { return _parentID; } 1151 get { return _parentID; }
@@ -1847,9 +1844,6 @@ namespace OpenSim.Region.Framework.Scenes
1847// if (VolumeDetectActive) 1844// if (VolumeDetectActive)
1848// isPhantom = false; 1845// isPhantom = false;
1849 1846
1850 // Added clarification.. since A rigid body is an object that you can kick around, etc.
1851// bool RigidBody = isPhysical && !isPhantom;
1852
1853 // 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 1847 // 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
1854 // or flexible 1848 // or flexible
1855 // if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible)) 1849 // if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible))
@@ -1876,7 +1870,6 @@ namespace OpenSim.Region.Framework.Scenes
1876 PhysActor = null; 1870 PhysActor = null;
1877 } 1871 }
1878 1872
1879 // Basic Physics can also return null as well as an exception catch.
1880 PhysicsActor pa = PhysActor; 1873 PhysicsActor pa = PhysActor;
1881 1874
1882 if (pa != null) 1875 if (pa != null)
@@ -4859,7 +4852,52 @@ namespace OpenSim.Region.Framework.Scenes
4859 } 4852 }
4860 4853
4861 /// <summary> 4854 /// <summary>
4862 /// This removes the part from physics 4855 /// Adds this part to the physics scene.
4856 /// </summary>
4857 /// <remarks>This method also sets the PhysActor property.</remarks>
4858 /// <param name="rigidBody">Add this prim with a rigid body.</param>
4859 /// <returns>
4860 /// The physics actor. null if there was a failure.
4861 /// </returns>
4862 private PhysicsActor AddToPhysics(bool rigidBody)
4863 {
4864 PhysicsActor pa;
4865
4866 try
4867 {
4868 pa = ParentGroup.Scene.PhysicsScene.AddPrimShape(
4869 string.Format("{0}/{1}", Name, UUID),
4870 Shape,
4871 AbsolutePosition,
4872 Scale,
4873 RotationOffset,
4874 rigidBody,
4875 m_localId);
4876 }
4877 catch
4878 {
4879 m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid);
4880 pa = null;
4881 }
4882
4883 // FIXME: Ideally we wouldn't set the property here to reduce situations where threads changing physical
4884 // properties can stop on each other. However, DoPhysicsPropertyUpdate() currently relies on PhysActor
4885 // being set.
4886 PhysActor = pa;
4887
4888 // Basic Physics can also return null as well as an exception catch.
4889 if (pa != null)
4890 {
4891 pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info
4892 pa.SetMaterial(Material);
4893 DoPhysicsPropertyUpdate(rigidBody, true);
4894 }
4895
4896 return pa;
4897 }
4898
4899 /// <summary>
4900 /// This removes the part from the physics scene.
4863 /// </summary> 4901 /// </summary>
4864 /// <remarks> 4902 /// <remarks>
4865 /// This isn't the same as turning off physical, since even without being physical the prim has a physics 4903 /// This isn't the same as turning off physical, since even without being physical the prim has a physics