aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDahlia Trimble2008-12-22 09:29:59 +0000
committerDahlia Trimble2008-12-22 09:29:59 +0000
commit6e68a11082c0928395450d70fcb5b3f18bdfb35f (patch)
tree2276875a4b59b60f412f2f92d77bdffe69dd9713
parenttest commit - no functional change (diff)
downloadopensim-SC-6e68a11082c0928395450d70fcb5b3f18bdfb35f.zip
opensim-SC-6e68a11082c0928395450d70fcb5b3f18bdfb35f.tar.gz
opensim-SC-6e68a11082c0928395450d70fcb5b3f18bdfb35f.tar.bz2
opensim-SC-6e68a11082c0928395450d70fcb5b3f18bdfb35f.tar.xz
Thanks Gerhard for a patch that implements part 3 of VolumeDetection / persistance
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/Resources/016_RegionStore.sql5
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs7
4 files changed, 25 insertions, 5 deletions
diff --git a/OpenSim/Data/SQLite/Resources/016_RegionStore.sql b/OpenSim/Data/SQLite/Resources/016_RegionStore.sql
new file mode 100644
index 0000000..71be55b
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/016_RegionStore.sql
@@ -0,0 +1,5 @@
1BEGIN;
2
3ALTER TABLE prims ADD COLUMN VolumeDetect INTEGER NOT NULL DEFAULT 0;
4
5COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 78c57ed..7f929a8 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -879,6 +879,8 @@ namespace OpenSim.Data.SQLite
879 createCol(prims, "CollisionSound", typeof(String)); 879 createCol(prims, "CollisionSound", typeof(String));
880 createCol(prims, "CollisionSoundVolume", typeof(Double)); 880 createCol(prims, "CollisionSoundVolume", typeof(Double));
881 881
882 createCol(prims, "VolumeDetect", typeof(Int16));
883
882 // Add in contraints 884 // Add in contraints
883 prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]}; 885 prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]};
884 886
@@ -1240,6 +1242,9 @@ namespace OpenSim.Data.SQLite
1240 prim.CollisionSound = new UUID(row["CollisionSound"].ToString()); 1242 prim.CollisionSound = new UUID(row["CollisionSound"].ToString());
1241 prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]); 1243 prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]);
1242 1244
1245 if (Convert.ToInt16(row["VolumeDetect"]) != 0)
1246 prim.VolumeDetectActive = true;
1247
1243 return prim; 1248 return prim;
1244 } 1249 }
1245 1250
@@ -1569,6 +1574,11 @@ namespace OpenSim.Data.SQLite
1569 1574
1570 row["CollisionSound"] = prim.CollisionSound.ToString(); 1575 row["CollisionSound"] = prim.CollisionSound.ToString();
1571 row["CollisionSoundVolume"] = prim.CollisionSoundVolume; 1576 row["CollisionSoundVolume"] = prim.CollisionSoundVolume;
1577 if (prim.VolumeDetectActive)
1578 row["VolumeDetect"] = 1;
1579 else
1580 row["VolumeDetect"] = 0;
1581
1572 } 1582 }
1573 1583
1574 /// <summary> 1584 /// <summary>
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 857f193..2f6a61a 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -858,7 +858,7 @@ namespace OpenSim.Region.Environment.Scenes
858 m_rootPart.AttachedAvatar = UUID.Zero; 858 m_rootPart.AttachedAvatar = UUID.Zero;
859 m_rootPart.SetParentLocalId(0); 859 m_rootPart.SetParentLocalId(0);
860 SetAttachmentPoint((byte)0); 860 SetAttachmentPoint((byte)0);
861 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 861 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
862 HasGroupChanged = true; 862 HasGroupChanged = true;
863 RootPart.Rezzed = DateTime.Now; 863 RootPart.Rezzed = DateTime.Now;
864 RootPart.RemFlag(PrimFlags.TemporaryOnRez); 864 RootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -1161,12 +1161,12 @@ namespace OpenSim.Region.Environment.Scenes
1161 { 1161 {
1162 if (m_parts.Count > 1) 1162 if (m_parts.Count > 1)
1163 { 1163 {
1164 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); 1164 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
1165 foreach (SceneObjectPart part in m_parts.Values) 1165 foreach (SceneObjectPart part in m_parts.Values)
1166 { 1166 {
1167 if (part.LocalId != m_rootPart.LocalId) 1167 if (part.LocalId != m_rootPart.LocalId)
1168 { 1168 {
1169 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); 1169 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
1170 } 1170 }
1171 } 1171 }
1172 1172
@@ -1175,7 +1175,7 @@ namespace OpenSim.Region.Environment.Scenes
1175 } 1175 }
1176 else 1176 else
1177 { 1177 {
1178 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); 1178 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
1179 } 1179 }
1180 } 1180 }
1181 } 1181 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0315c92..ddfb413 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1281,11 +1281,15 @@ if (m_shape != null) {
1281 /// </summary> 1281 /// </summary>
1282 /// <param name="rootObjectFlags"></param> 1282 /// <param name="rootObjectFlags"></param>
1283 /// <param name="m_physicalPrim"></param> 1283 /// <param name="m_physicalPrim"></param>
1284 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) 1284 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim)
1285 { 1285 {
1286 bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim); 1286 bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
1287 bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0); 1287 bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
1288 1288
1289 // Special case for VolumeDetection: If VolumeDetection is set, the phantom flag is locally ignored
1290 if (VolumeDetectActive)
1291 isPhantom = false;
1292
1289 // Added clarification.. since A rigid body is an object that you can kick around, etc. 1293 // Added clarification.. since A rigid body is an object that you can kick around, etc.
1290 bool RigidBody = isPhysical && !isPhantom; 1294 bool RigidBody = isPhysical && !isPhantom;
1291 1295
@@ -1305,6 +1309,7 @@ if (m_shape != null) {
1305 { 1309 {
1306 PhysActor.LocalID = LocalId; 1310 PhysActor.LocalID = LocalId;
1307 DoPhysicsPropertyUpdate(RigidBody, true); 1311 DoPhysicsPropertyUpdate(RigidBody, true);
1312 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
1308 } 1313 }
1309 } 1314 }
1310 } 1315 }