aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorMelanie2012-02-19 20:08:01 +0100
committerMelanie2012-02-19 20:08:01 +0100
commit96409cc2eeb4555609f72c8bc61fbdf4ac3e9933 (patch)
tree394a7a07ff913c8efa390399c190d5c65bf8f95b /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff)
parent moved vehicle from SOG to SOP (diff)
downloadopensim-SC_OLD-96409cc2eeb4555609f72c8bc61fbdf4ac3e9933.zip
opensim-SC_OLD-96409cc2eeb4555609f72c8bc61fbdf4ac3e9933.tar.gz
opensim-SC_OLD-96409cc2eeb4555609f72c8bc61fbdf4ac3e9933.tar.bz2
opensim-SC_OLD-96409cc2eeb4555609f72c8bc61fbdf4ac3e9933.tar.xz
Merge branch 'ubitwork'
Conflicts: OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs54
1 files changed, 45 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cbd45c3..2481dd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -43,6 +43,7 @@ using OpenSim.Region.Framework.Scenes.Serialization;
43 43
44namespace OpenSim.Region.Framework.Scenes 44namespace OpenSim.Region.Framework.Scenes
45{ 45{
46
46 [Flags] 47 [Flags]
47 public enum scriptEvents 48 public enum scriptEvents
48 { 49 {
@@ -1378,7 +1379,8 @@ namespace OpenSim.Region.Framework.Scenes
1378 1379
1379 m_rootPart.SetParentLocalId(0); 1380 m_rootPart.SetParentLocalId(0);
1380 AttachmentPoint = (byte)0; 1381 AttachmentPoint = (byte)0;
1381 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); 1382 // must check if buildind should be true or false here
1383 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
1382 HasGroupChanged = true; 1384 HasGroupChanged = true;
1383 RootPart.Rezzed = DateTime.Now; 1385 RootPart.Rezzed = DateTime.Now;
1384 RootPart.RemFlag(PrimFlags.TemporaryOnRez); 1386 RootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -1677,22 +1679,32 @@ namespace OpenSim.Region.Framework.Scenes
1677 /// </summary> 1679 /// </summary>
1678 public void ApplyPhysics() 1680 public void ApplyPhysics()
1679 { 1681 {
1680 // Apply physics to the root prim
1681 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
1682
1683 // Apply physics to child prims
1684 SceneObjectPart[] parts = m_parts.GetArray(); 1682 SceneObjectPart[] parts = m_parts.GetArray();
1685 if (parts.Length > 1) 1683 if (parts.Length > 1)
1686 { 1684 {
1685 ResetChildPrimPhysicsPositions();
1686
1687 // Apply physics to the root prim
1688 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true);
1689
1690
1687 for (int i = 0; i < parts.Length; i++) 1691 for (int i = 0; i < parts.Length; i++)
1688 { 1692 {
1689 SceneObjectPart part = parts[i]; 1693 SceneObjectPart part = parts[i];
1690 if (part.LocalId != m_rootPart.LocalId) 1694 if (part.LocalId != m_rootPart.LocalId)
1691 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive); 1695 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, true);
1692 } 1696 }
1693
1694 // Hack to get the physics scene geometries in the right spot 1697 // Hack to get the physics scene geometries in the right spot
1695 ResetChildPrimPhysicsPositions(); 1698// ResetChildPrimPhysicsPositions();
1699 if (m_rootPart.PhysActor != null)
1700 {
1701 m_rootPart.PhysActor.Building = false;
1702 }
1703 }
1704 else
1705 {
1706 // Apply physics to the root prim
1707 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false);
1696 } 1708 }
1697 } 1709 }
1698 1710
@@ -1863,6 +1875,7 @@ namespace OpenSim.Region.Framework.Scenes
1863 /// <returns></returns> 1875 /// <returns></returns>
1864 public SceneObjectGroup Copy(bool userExposed) 1876 public SceneObjectGroup Copy(bool userExposed)
1865 { 1877 {
1878 m_dupeInProgress = true;
1866 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); 1879 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
1867 dupe.m_isBackedUp = false; 1880 dupe.m_isBackedUp = false;
1868 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>(); 1881 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>();
@@ -1926,13 +1939,16 @@ namespace OpenSim.Region.Framework.Scenes
1926 pbs, 1939 pbs,
1927 newPart.AbsolutePosition, 1940 newPart.AbsolutePosition,
1928 newPart.Scale, 1941 newPart.Scale,
1929 newPart.RotationOffset, 1942 //newPart.RotationOffset,
1943 newPart.GetWorldRotation(),
1930 part.PhysActor.IsPhysical, 1944 part.PhysActor.IsPhysical,
1931 newPart.LocalId); 1945 newPart.LocalId);
1932 1946
1933 newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); 1947 newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
1934 } 1948 }
1935 } 1949 }
1950 if (dupe.m_rootPart.PhysActor != null && userExposed)
1951 dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
1936 1952
1937 if (userExposed) 1953 if (userExposed)
1938 { 1954 {
@@ -1943,6 +1959,7 @@ namespace OpenSim.Region.Framework.Scenes
1943 ScheduleGroupForFullUpdate(); 1959 ScheduleGroupForFullUpdate();
1944 } 1960 }
1945 1961
1962 m_dupeInProgress = false;
1946 return dupe; 1963 return dupe;
1947 } 1964 }
1948 1965
@@ -2950,12 +2967,31 @@ namespace OpenSim.Region.Framework.Scenes
2950 } 2967 }
2951 } 2968 }
2952 2969
2970/*
2953 RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect); 2971 RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
2954 for (int i = 0; i < parts.Length; i++) 2972 for (int i = 0; i < parts.Length; i++)
2955 { 2973 {
2956 if (parts[i] != RootPart) 2974 if (parts[i] != RootPart)
2957 parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect); 2975 parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
2958 } 2976 }
2977*/
2978 if (parts.Length > 1)
2979 {
2980 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
2981
2982 for (int i = 0; i < parts.Length; i++)
2983 {
2984
2985 if (parts[i].UUID != m_rootPart.UUID)
2986 parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
2987 }
2988
2989 if (m_rootPart.PhysActor != null)
2990 m_rootPart.PhysActor.Building = false;
2991 }
2992 else
2993 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
2994
2959 } 2995 }
2960 } 2996 }
2961 2997