From 6e68a11082c0928395450d70fcb5b3f18bdfb35f Mon Sep 17 00:00:00 2001
From: Dahlia Trimble
Date: Mon, 22 Dec 2008 09:29:59 +0000
Subject: Thanks Gerhard for a patch that implements part 3 of VolumeDetection
/ persistance
---
OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 8 ++++----
OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 7 ++++++-
2 files changed, 10 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Environment')
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 857f193..2f6a61a 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -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);
}
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0315c92..ddfb413 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1281,11 +1281,15 @@ if (m_shape != null) {
///
///
///
- 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);
}
}
}
--
cgit v1.1