aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-04-20 00:17:14 +0100
committerMelanie2012-04-20 00:17:14 +0100
commit65b3e13010cae460573db0f027efa94a6a958192 (patch)
tree71158af5b6f985b93b4e6bdb4814987cda386e81 /OpenSim/Region/Framework/Scenes
parentFx up estate settings (diff)
parent changed - VolumeDetect and phantom setting interaction. Script VD(true) forc... (diff)
downloadopensim-SC-65b3e13010cae460573db0f027efa94a6a958192.zip
opensim-SC-65b3e13010cae460573db0f027efa94a6a958192.tar.gz
opensim-SC-65b3e13010cae460573db0f027efa94a6a958192.tar.bz2
opensim-SC-65b3e13010cae460573db0f027efa94a6a958192.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs39
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs12
4 files changed, 57 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 0a1b921..f6f6a1a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1519,8 +1519,18 @@ namespace OpenSim.Region.Framework.Scenes
1519 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) 1519 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
1520 { 1520 {
1521 // VolumeDetect can't be set via UI and will always be off when a change is made there 1521 // VolumeDetect can't be set via UI and will always be off when a change is made there
1522 if (PhysData.PhysShapeType == PhysShapeType.invalid) 1522 // now only change volume dtc if phantom off
1523 group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, false); 1523
1524 if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data
1525 {
1526 bool vdtc;
1527 if (SetPhantom) // if phantom keep volumedtc
1528 vdtc = group.RootPart.VolumeDetectActive;
1529 else // else turn it off
1530 vdtc = false;
1531
1532 group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc);
1533 }
1524 else 1534 else
1525 { 1535 {
1526 SceneObjectPart part = GetSceneObjectPart(localID); 1536 SceneObjectPart part = GetSceneObjectPart(localID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7bd6c11..cb0a57a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1941,6 +1941,12 @@ namespace OpenSim.Region.Framework.Scenes
1941// "[SCENE]: Storing {0}, {1} in {2}", 1941// "[SCENE]: Storing {0}, {1} in {2}",
1942// Name, UUID, m_scene.RegionInfo.RegionName); 1942// Name, UUID, m_scene.RegionInfo.RegionName);
1943 1943
1944 if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
1945 {
1946 RootPart.Shape.State = 0;
1947 ScheduleGroupForFullUpdate();
1948 }
1949
1944 SceneObjectGroup backup_group = Copy(false); 1950 SceneObjectGroup backup_group = Copy(false);
1945 backup_group.RootPart.Velocity = RootPart.Velocity; 1951 backup_group.RootPart.Velocity = RootPart.Velocity;
1946 backup_group.RootPart.Acceleration = RootPart.Acceleration; 1952 backup_group.RootPart.Acceleration = RootPart.Acceleration;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 511ab19..c73fc98 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1830,7 +1830,7 @@ namespace OpenSim.Region.Framework.Scenes
1830 1830
1831 public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building) 1831 public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building)
1832 { 1832 {
1833 VolumeDetectActive = _VolumeDetectActive; //?? as is used this is redundante 1833 VolumeDetectActive = _VolumeDetectActive;
1834 1834
1835 if (!ParentGroup.Scene.CollidablePrims) 1835 if (!ParentGroup.Scene.CollidablePrims)
1836 return; 1836 return;
@@ -1839,7 +1839,10 @@ namespace OpenSim.Region.Framework.Scenes
1839 return; 1839 return;
1840 1840
1841 bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0; 1841 bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0;
1842 bool isPhantom = (_ObjectFlags & (uint) PrimFlags.Phantom) != 0; 1842 bool isPhantom = (_ObjectFlags & (uint)PrimFlags.Phantom) != 0;
1843
1844 if (_VolumeDetectActive)
1845 isPhantom = true;
1843 1846
1844 if (IsJoint()) 1847 if (IsJoint())
1845 { 1848 {
@@ -2065,6 +2068,7 @@ namespace OpenSim.Region.Framework.Scenes
2065 2068
2066 /// <summary> 2069 /// <summary>
2067 /// Do a physics propery update for this part. 2070 /// Do a physics propery update for this part.
2071 /// now also updates phantom and volume detector
2068 /// </summary> 2072 /// </summary>
2069 /// <param name="UsePhysics"></param> 2073 /// <param name="UsePhysics"></param>
2070 /// <param name="isNew"></param> 2074 /// <param name="isNew"></param>
@@ -2096,7 +2100,7 @@ namespace OpenSim.Region.Framework.Scenes
2096 if (ParentGroup.RootPart == this) 2100 if (ParentGroup.RootPart == this)
2097 AngularVelocity = new Vector3(0, 0, 0); 2101 AngularVelocity = new Vector3(0, 0, 0);
2098 2102
2099 if (pa.Phantom) 2103 if (pa.Phantom && !VolumeDetectActive)
2100 { 2104 {
2101 RemoveFromPhysics(); 2105 RemoveFromPhysics();
2102 return; 2106 return;
@@ -2143,6 +2147,14 @@ namespace OpenSim.Region.Framework.Scenes
2143 if (pa.Phantom != phan) 2147 if (pa.Phantom != phan)
2144 pa.Phantom = phan; 2148 pa.Phantom = phan;
2145 2149
2150// some engines dont' have this check still
2151// if (VolumeDetectActive != pa.IsVolumeDtc)
2152 {
2153 if (VolumeDetectActive)
2154 pa.SetVolumeDetect(1);
2155 else
2156 pa.SetVolumeDetect(0);
2157 }
2146 2158
2147 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the 2159 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the
2148 // mesh data. 2160 // mesh data.
@@ -4599,6 +4611,12 @@ namespace OpenSim.Region.Framework.Scenes
4599 if ((UsePhysics == wasUsingPhysics) && (wasTemporary == SetTemporary) && (wasPhantom == SetPhantom) && (SetVD == wasVD)) 4611 if ((UsePhysics == wasUsingPhysics) && (wasTemporary == SetTemporary) && (wasPhantom == SetPhantom) && (SetVD == wasVD))
4600 return; 4612 return;
4601 4613
4614 VolumeDetectActive = SetVD;
4615
4616 // volume detector implies phantom
4617 if (VolumeDetectActive)
4618 SetPhantom = true;
4619
4602 if (UsePhysics) 4620 if (UsePhysics)
4603 AddFlag(PrimFlags.Physics); 4621 AddFlag(PrimFlags.Physics);
4604 else 4622 else
@@ -4614,7 +4632,6 @@ namespace OpenSim.Region.Framework.Scenes
4614 else 4632 else
4615 RemFlag(PrimFlags.TemporaryOnRez); 4633 RemFlag(PrimFlags.TemporaryOnRez);
4616 4634
4617 VolumeDetectActive = SetVD;
4618 4635
4619 if (ParentGroup.Scene == null) 4636 if (ParentGroup.Scene == null)
4620 return; 4637 return;
@@ -4624,7 +4641,7 @@ namespace OpenSim.Region.Framework.Scenes
4624 if (pa != null && building && pa.Building != building) 4641 if (pa != null && building && pa.Building != building)
4625 pa.Building = building; 4642 pa.Building = building;
4626 4643
4627 if ((SetPhantom && !UsePhysics) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none 4644 if ((SetPhantom && !UsePhysics && !SetVD) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none
4628 || (Shape.PathCurve == (byte)Extrusion.Flexible)) 4645 || (Shape.PathCurve == (byte)Extrusion.Flexible))
4629 { 4646 {
4630 if (pa != null) 4647 if (pa != null)
@@ -4669,12 +4686,12 @@ namespace OpenSim.Region.Framework.Scenes
4669 else // it already has a physical representation 4686 else // it already has a physical representation
4670 { 4687 {
4671 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. 4688 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
4672 4689 /* moved into DoPhysicsPropertyUpdate
4673 if(VolumeDetectActive) 4690 if(VolumeDetectActive)
4674 pa.SetVolumeDetect(1); 4691 pa.SetVolumeDetect(1);
4675 else 4692 else
4676 pa.SetVolumeDetect(0); 4693 pa.SetVolumeDetect(0);
4677 4694 */
4678 if (pa.Building != building) 4695 if (pa.Building != building)
4679 pa.Building = building; 4696 pa.Building = building;
4680 } 4697 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 292dbdc..ac791ae 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1076,6 +1076,11 @@ namespace OpenSim.Region.Framework.Scenes
1076 1076
1077 public void TeleportWithMomentum(Vector3 pos) 1077 public void TeleportWithMomentum(Vector3 pos)
1078 { 1078 {
1079 TeleportWithMomentum(pos, null);
1080 }
1081
1082 public void TeleportWithMomentum(Vector3 pos, Vector3? v)
1083 {
1079 bool isFlying = Flying; 1084 bool isFlying = Flying;
1080 Vector3 vel = Velocity; 1085 Vector3 vel = Velocity;
1081 RemoveFromPhysicalScene(); 1086 RemoveFromPhysicalScene();
@@ -1083,7 +1088,12 @@ namespace OpenSim.Region.Framework.Scenes
1083 AbsolutePosition = pos; 1088 AbsolutePosition = pos;
1084 AddToPhysicalScene(isFlying); 1089 AddToPhysicalScene(isFlying);
1085 if (PhysicsActor != null) 1090 if (PhysicsActor != null)
1086 PhysicsActor.SetMomentum(vel); 1091 {
1092 if (v.HasValue)
1093 PhysicsActor.SetMomentum((Vector3)v);
1094 else
1095 PhysicsActor.SetMomentum(vel);
1096 }
1087 1097
1088 SendTerseUpdateToAllClients(); 1098 SendTerseUpdateToAllClients();
1089 } 1099 }