Store and reload extra physics from database

avinationmerge
Melanie 2012-03-20 12:04:55 +01:00
parent 5768a151ff
commit 7779b1eabc
1 changed files with 20 additions and 2 deletions

View File

@ -170,7 +170,9 @@ namespace OpenSim.Data.MySQL
"ParticleSystem, ClickAction, Material, " + "ParticleSystem, ClickAction, Material, " +
"CollisionSound, CollisionSoundVolume, " + "CollisionSound, CollisionSoundVolume, " +
"PassTouches, " + "PassTouches, " +
"LinkNumber, MediaURL, KeyframeMotion) values (" + "?UUID, " + "LinkNumber, MediaURL, KeyframeMotion, " +
"PhysicsShapeType, Density, GravityModifier, " +
"Friction, Restitution) values (" + "?UUID, " +
"?CreationDate, ?Name, ?Text, " + "?CreationDate, ?Name, ?Text, " +
"?Description, ?SitName, ?TouchName, " + "?Description, ?SitName, ?TouchName, " +
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
@ -201,7 +203,10 @@ namespace OpenSim.Data.MySQL
"?SaleType, ?ColorR, ?ColorG, " + "?SaleType, ?ColorR, ?ColorG, " +
"?ColorB, ?ColorA, ?ParticleSystem, " + "?ColorB, ?ColorA, ?ParticleSystem, " +
"?ClickAction, ?Material, ?CollisionSound, " + "?ClickAction, ?Material, ?CollisionSound, " +
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?KeyframeMotion)"; "?CollisionSoundVolume, ?PassTouches, " +
"?LinkNumber, ?MediaURL, ?KeyframeMotion, " +
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
"?Friction, ?Restitution)";
FillPrimCommand(cmd, prim, obj.UUID, regionUUID); FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
@ -1243,6 +1248,13 @@ namespace OpenSim.Data.MySQL
{ {
prim.KeyframeMotion = null; prim.KeyframeMotion = null;
} }
prim.PhysicsShapeType = (byte)row["PhysicsShapeType"];
prim.Density = (float)(double)row["Density"];
prim.GravityModifier = (float)(double)row["GravityModifier"];
prim.Friction = (float)(double)row["Friction"];
prim.Bounciness = (float)(double)row["Restitution"];
return prim; return prim;
} }
@ -1600,6 +1612,12 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize()); cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize());
else else
cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]); cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]);
cmd.Parameters.AddWithValue("PhysicsShapeType", prim.PhysicsShapeType);
cmd.Parameters.AddWithValue("Density", (double)prim.Density);
cmd.Parameters.AddWithValue("GravityModifier", (double)prim.GravityModifier);
cmd.Parameters.AddWithValue("Friction", (double)prim.Friction);
cmd.Parameters.AddWithValue("Restitution", (double)prim.Bounciness);
} }
/// <summary> /// <summary>