diff options
author | Oren Hurvitz | 2013-02-07 08:23:57 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-09 01:03:58 +0000 |
commit | 85b81ff7f20334ebe50a5a33e41060fdcbd69d65 (patch) | |
tree | 6129255f4db03b1a7a7f15349fbd7838904f6712 /OpenSim/Data/SQLite | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-85b81ff7f20334ebe50a5a33e41060fdcbd69d65.zip opensim-SC-85b81ff7f20334ebe50a5a33e41060fdcbd69d65.tar.gz opensim-SC-85b81ff7f20334ebe50a5a33e41060fdcbd69d65.tar.bz2 opensim-SC-85b81ff7f20334ebe50a5a33e41060fdcbd69d65.tar.xz |
Added physics parameters support to MSSQL and SQLite (not tested)
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r-- | OpenSim/Data/SQLite/Resources/RegionStore.migrations | 12 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index e583dc2..c6f4b48 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations | |||
@@ -580,3 +580,15 @@ COMMIT; | |||
580 | BEGIN; | 580 | BEGIN; |
581 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; | 581 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; |
582 | COMMIT; | 582 | COMMIT; |
583 | |||
584 | :VERSION 28 | ||
585 | |||
586 | BEGIN; | ||
587 | |||
588 | ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0'; | ||
589 | ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000'; | ||
590 | ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1'; | ||
591 | ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6'; | ||
592 | ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5'; | ||
593 | |||
594 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 91fc704..d4734a6 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -1235,6 +1235,12 @@ namespace OpenSim.Data.SQLite | |||
1235 | 1235 | ||
1236 | createCol(prims, "DynAttrs", typeof(String)); | 1236 | createCol(prims, "DynAttrs", typeof(String)); |
1237 | 1237 | ||
1238 | createCol(prims, "PhysicsShapeType", typeof(Byte)); | ||
1239 | createCol(prims, "Density", typeof(Double)); | ||
1240 | createCol(prims, "GravityModifier", typeof(Double)); | ||
1241 | createCol(prims, "Friction", typeof(Double)); | ||
1242 | createCol(prims, "Restitution", typeof(Double)); | ||
1243 | |||
1238 | // Add in contraints | 1244 | // Add in contraints |
1239 | prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; | 1245 | prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; |
1240 | 1246 | ||
@@ -1724,6 +1730,12 @@ namespace OpenSim.Data.SQLite | |||
1724 | prim.DynAttrs = new DAMap(); | 1730 | prim.DynAttrs = new DAMap(); |
1725 | } | 1731 | } |
1726 | 1732 | ||
1733 | prim.PhysicsShapeType = Convert.ToByte(row["PhysicsShapeType"]); | ||
1734 | prim.Density = Convert.ToSingle(row["Density"]); | ||
1735 | prim.GravityModifier = Convert.ToSingle(row["GravityModifier"]); | ||
1736 | prim.Friction = Convert.ToSingle(row["Friction"]); | ||
1737 | prim.Restitution = Convert.ToSingle(row["Restitution"]); | ||
1738 | |||
1727 | return prim; | 1739 | return prim; |
1728 | } | 1740 | } |
1729 | 1741 | ||
@@ -2150,6 +2162,12 @@ namespace OpenSim.Data.SQLite | |||
2150 | row["DynAttrs"] = prim.DynAttrs.ToXml(); | 2162 | row["DynAttrs"] = prim.DynAttrs.ToXml(); |
2151 | else | 2163 | else |
2152 | row["DynAttrs"] = null; | 2164 | row["DynAttrs"] = null; |
2165 | |||
2166 | row["PhysicsShapeType"] = prim.PhysicsShapeType; | ||
2167 | row["Density"] = (double)prim.Density; | ||
2168 | row["GravityModifier"] = (double)prim.GravityModifier; | ||
2169 | row["Friction"] = (double)prim.Friction; | ||
2170 | row["Restitution"] = (double)prim.Restitution; | ||
2153 | } | 2171 | } |
2154 | 2172 | ||
2155 | /// <summary> | 2173 | /// <summary> |