Thanks Gerhard for a patch that implements part 3 of VolumeDetection / persistance
parent
1fbbdb6714
commit
6e68a11082
|
@ -0,0 +1,5 @@
|
|||
BEGIN;
|
||||
|
||||
ALTER TABLE prims ADD COLUMN VolumeDetect INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT;
|
|
@ -879,6 +879,8 @@ namespace OpenSim.Data.SQLite
|
|||
createCol(prims, "CollisionSound", typeof(String));
|
||||
createCol(prims, "CollisionSoundVolume", typeof(Double));
|
||||
|
||||
createCol(prims, "VolumeDetect", typeof(Int16));
|
||||
|
||||
// Add in contraints
|
||||
prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]};
|
||||
|
||||
|
@ -1240,6 +1242,9 @@ namespace OpenSim.Data.SQLite
|
|||
prim.CollisionSound = new UUID(row["CollisionSound"].ToString());
|
||||
prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]);
|
||||
|
||||
if (Convert.ToInt16(row["VolumeDetect"]) != 0)
|
||||
prim.VolumeDetectActive = true;
|
||||
|
||||
return prim;
|
||||
}
|
||||
|
||||
|
@ -1569,6 +1574,11 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
row["CollisionSound"] = prim.CollisionSound.ToString();
|
||||
row["CollisionSoundVolume"] = prim.CollisionSoundVolume;
|
||||
if (prim.VolumeDetectActive)
|
||||
row["VolumeDetect"] = 1;
|
||||
else
|
||||
row["VolumeDetect"] = 0;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -858,7 +858,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
m_rootPart.AttachedAvatar = UUID.Zero;
|
||||
m_rootPart.SetParentLocalId(0);
|
||||
SetAttachmentPoint((byte)0);
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
|
||||
HasGroupChanged = true;
|
||||
RootPart.Rezzed = DateTime.Now;
|
||||
RootPart.RemFlag(PrimFlags.TemporaryOnRez);
|
||||
|
@ -1161,12 +1161,12 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (m_parts.Count > 1)
|
||||
{
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim);
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
if (part.LocalId != m_rootPart.LocalId)
|
||||
{
|
||||
part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim);
|
||||
part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
else
|
||||
{
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim);
|
||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1281,11 +1281,15 @@ if (m_shape != null) {
|
|||
/// </summary>
|
||||
/// <param name="rootObjectFlags"></param>
|
||||
/// <param name="m_physicalPrim"></param>
|
||||
public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim)
|
||||
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim)
|
||||
{
|
||||
bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
|
||||
bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
|
||||
|
||||
// Special case for VolumeDetection: If VolumeDetection is set, the phantom flag is locally ignored
|
||||
if (VolumeDetectActive)
|
||||
isPhantom = false;
|
||||
|
||||
// Added clarification.. since A rigid body is an object that you can kick around, etc.
|
||||
bool RigidBody = isPhysical && !isPhantom;
|
||||
|
||||
|
@ -1305,6 +1309,7 @@ if (m_shape != null) {
|
|||
{
|
||||
PhysActor.LocalID = LocalId;
|
||||
DoPhysicsPropertyUpdate(RigidBody, true);
|
||||
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue