store the physics inertia override in SQlite

httptests
UbitUmarov 2017-04-01 18:15:47 +01:00
parent 443fc60cdf
commit 44993550a8
3 changed files with 19 additions and 5 deletions

View File

@ -1452,13 +1452,10 @@ namespace OpenSim.Data.MySQL
prim.VehicleParams = vehicle; prim.VehicleParams = vehicle;
} }
PhysicsInertiaData pdata; PhysicsInertiaData pdata = null;
if (row["PhysInertia"].ToString() != String.Empty) if (row["PhysInertia"].ToString() != String.Empty)
{
pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
if (pdata != null) prim.PhysicsInertia = pdata;
prim.PhysicsInertia = pdata;
}
return prim; return prim;
} }

View File

@ -371,3 +371,9 @@ BEGIN;
ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL; ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL;
COMMIT; COMMIT;
:VERSION 36 #----- Add physics inertia data
BEGIN;
ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL;
COMMIT;

View File

@ -1843,6 +1843,12 @@ namespace OpenSim.Data.SQLite
if (vehicle != null) if (vehicle != null)
prim.VehicleParams = vehicle; prim.VehicleParams = vehicle;
} }
PhysicsInertiaData pdata = null;
if (!(row["PhysInertia"] is DBNull) && row["PhysInertia"].ToString() != String.Empty)
pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
prim.PhysicsInertia = pdata;
return prim; return prim;
} }
@ -2266,6 +2272,11 @@ namespace OpenSim.Data.SQLite
else else
row["Vehicle"] = String.Empty; row["Vehicle"] = String.Empty;
if (prim.PhysicsInertia != null)
row["PhysInertia"] = prim.PhysicsInertia.ToXml2();
else
row["PhysInertia"] = String.Empty;
} }
/// <summary> /// <summary>