Added physics parameters support to MSSQL and SQLite (not tested)
parent
a08e1b60ec
commit
85b81ff7f2
|
@ -351,7 +351,8 @@ IF EXISTS (SELECT UUID FROM prims WHERE UUID = @UUID)
|
|||
ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice,
|
||||
SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem,
|
||||
ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches,
|
||||
LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs
|
||||
LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs,
|
||||
PhysicsShapeType = @PhysicsShapeType, Density = @Density, GravityModifier = @GravityModifier, Friction = @Friction, Restitution = @Restitution
|
||||
WHERE UUID = @UUID
|
||||
END
|
||||
ELSE
|
||||
|
@ -366,7 +367,8 @@ ELSE
|
|||
PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX,
|
||||
OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ,
|
||||
ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA,
|
||||
ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs
|
||||
ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs,
|
||||
PhysicsShapeType, Density, GravityModifier, Friction, Restitution
|
||||
) VALUES (
|
||||
@UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask,
|
||||
@EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX,
|
||||
|
@ -376,7 +378,8 @@ ELSE
|
|||
@PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX,
|
||||
@OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ,
|
||||
@ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA,
|
||||
@ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs
|
||||
@ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs,
|
||||
@PhysicsShapeType, @Density, @GravityModifier, @Friction, @Restitution
|
||||
)
|
||||
END";
|
||||
|
||||
|
@ -1697,6 +1700,12 @@ VALUES
|
|||
else
|
||||
prim.DynAttrs = new DAMap();
|
||||
|
||||
prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
|
||||
prim.Density = Convert.ToSingle(primRow["Density"]);
|
||||
prim.GravityModifier = Convert.ToSingle(primRow["GravityModifier"]);
|
||||
prim.Friction = Convert.ToSingle(primRow["Friction"]);
|
||||
prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
|
||||
|
||||
return prim;
|
||||
}
|
||||
|
||||
|
@ -2096,6 +2105,12 @@ VALUES
|
|||
else
|
||||
parameters.Add(_Database.CreateParameter("DynAttrs", null));
|
||||
|
||||
parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType));
|
||||
parameters.Add(_Database.CreateParameter("Density", (double)prim.Density));
|
||||
parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier));
|
||||
parameters.Add(_Database.CreateParameter("Friction", (double)prim.Friction));
|
||||
parameters.Add(_Database.CreateParameter("Restitution", (double)prim.Restitution));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
|
||||
|
|
|
@ -1156,3 +1156,15 @@ BEGIN TRANSACTION
|
|||
ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 39 #---------------- Extra physics params
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0';
|
||||
ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000';
|
||||
ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1';
|
||||
ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6';
|
||||
ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
|
||||
|
||||
COMMIT
|
||||
|
|
|
@ -173,9 +173,9 @@ namespace OpenSim.Data.MySQL
|
|||
"ParticleSystem, ClickAction, Material, " +
|
||||
"CollisionSound, CollisionSoundVolume, " +
|
||||
"PassTouches, " +
|
||||
"LinkNumber, MediaURL, " +
|
||||
"LinkNumber, MediaURL, DynAttrs, " +
|
||||
"PhysicsShapeType, Density, GravityModifier, " +
|
||||
"Friction, Restitution, DynAttrs " +
|
||||
"Friction, Restitution " +
|
||||
") values (" + "?UUID, " +
|
||||
"?CreationDate, ?Name, ?Text, " +
|
||||
"?Description, ?SitName, ?TouchName, " +
|
||||
|
@ -208,9 +208,9 @@ namespace OpenSim.Data.MySQL
|
|||
"?ColorB, ?ColorA, ?ParticleSystem, " +
|
||||
"?ClickAction, ?Material, ?CollisionSound, " +
|
||||
"?CollisionSoundVolume, ?PassTouches, " +
|
||||
"?LinkNumber, ?MediaURL, " +
|
||||
"?LinkNumber, ?MediaURL, ?DynAttrs, " +
|
||||
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
|
||||
"?Friction, ?Restitution, ?DynAttrs)";
|
||||
"?Friction, ?Restitution)";
|
||||
|
||||
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
|
||||
|
||||
|
@ -1659,16 +1659,17 @@ namespace OpenSim.Data.MySQL
|
|||
cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
|
||||
cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
|
||||
|
||||
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.Restitution);
|
||||
|
||||
if (prim.DynAttrs.Count > 0)
|
||||
cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml());
|
||||
else
|
||||
cmd.Parameters.AddWithValue("DynAttrs", null);
|
||||
|
||||
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.Restitution);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -911,7 +911,7 @@ ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
|
|||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 47 #---------------- Extra prim params
|
||||
:VERSION 47 #---------------- Extra physics params
|
||||
|
||||
BEGIN;
|
||||
|
||||
|
|
|
@ -580,3 +580,15 @@ COMMIT;
|
|||
BEGIN;
|
||||
ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 28
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0';
|
||||
ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000';
|
||||
ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1';
|
||||
ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6';
|
||||
ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1235,6 +1235,12 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
createCol(prims, "DynAttrs", typeof(String));
|
||||
|
||||
createCol(prims, "PhysicsShapeType", typeof(Byte));
|
||||
createCol(prims, "Density", typeof(Double));
|
||||
createCol(prims, "GravityModifier", typeof(Double));
|
||||
createCol(prims, "Friction", typeof(Double));
|
||||
createCol(prims, "Restitution", typeof(Double));
|
||||
|
||||
// Add in contraints
|
||||
prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
|
||||
|
||||
|
@ -1724,6 +1730,12 @@ namespace OpenSim.Data.SQLite
|
|||
prim.DynAttrs = new DAMap();
|
||||
}
|
||||
|
||||
prim.PhysicsShapeType = Convert.ToByte(row["PhysicsShapeType"]);
|
||||
prim.Density = Convert.ToSingle(row["Density"]);
|
||||
prim.GravityModifier = Convert.ToSingle(row["GravityModifier"]);
|
||||
prim.Friction = Convert.ToSingle(row["Friction"]);
|
||||
prim.Restitution = Convert.ToSingle(row["Restitution"]);
|
||||
|
||||
return prim;
|
||||
}
|
||||
|
||||
|
@ -2150,6 +2162,12 @@ namespace OpenSim.Data.SQLite
|
|||
row["DynAttrs"] = prim.DynAttrs.ToXml();
|
||||
else
|
||||
row["DynAttrs"] = null;
|
||||
|
||||
row["PhysicsShapeType"] = prim.PhysicsShapeType;
|
||||
row["Density"] = (double)prim.Density;
|
||||
row["GravityModifier"] = (double)prim.GravityModifier;
|
||||
row["Friction"] = (double)prim.Friction;
|
||||
row["Restitution"] = (double)prim.Restitution;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue