diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a0f267c..b179646 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1838,6 +1838,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
1838 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); | 1838 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); |
1839 | dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; | 1839 | dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; |
1840 | 1840 | ||
1841 | if (userExposed) | ||
1842 | dupe.m_rootPart.TrimPermissions(); | ||
1843 | |||
1844 | /// may need to create a new Physics actor. | ||
1845 | if (dupe.RootPart.PhysActor != null && userExposed) | ||
1846 | { | ||
1847 | PrimitiveBaseShape pbs = dupe.RootPart.Shape; | ||
1848 | |||
1849 | dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( | ||
1850 | dupe.RootPart.Name, | ||
1851 | pbs, | ||
1852 | dupe.RootPart.AbsolutePosition, | ||
1853 | dupe.RootPart.Scale, | ||
1854 | dupe.RootPart.RotationOffset, | ||
1855 | dupe.RootPart.PhysActor.IsPhysical); | ||
1856 | |||
1857 | dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId; | ||
1858 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); | ||
1859 | } | ||
1860 | |||
1841 | lockPartsForRead(true); | 1861 | lockPartsForRead(true); |
1842 | 1862 | ||
1843 | List<SceneObjectPart> partList; | 1863 | List<SceneObjectPart> partList; |
@@ -1860,34 +1880,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
1860 | 1880 | ||
1861 | newPart.LinkNum = part.LinkNum; | 1881 | newPart.LinkNum = part.LinkNum; |
1862 | } | 1882 | } |
1863 | } | ||
1864 | 1883 | ||
1884 | // Need to duplicate the physics actor as well | ||
1885 | if (part.PhysActor != null && userExposed) | ||
1886 | { | ||
1887 | PrimitiveBaseShape pbs = part.Shape; | ||
1888 | |||
1889 | part.PhysActor | ||
1890 | = m_scene.PhysicsScene.AddPrimShape( | ||
1891 | part.Name, | ||
1892 | pbs, | ||
1893 | part.AbsolutePosition, | ||
1894 | part.Scale, | ||
1895 | part.RotationOffset, | ||
1896 | part.PhysActor.IsPhysical); | ||
1897 | |||
1898 | part.PhysActor.LocalID = part.LocalId; | ||
1899 | part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); | ||
1900 | } | ||
1901 | |||
1902 | } | ||
1865 | if (userExposed) | 1903 | if (userExposed) |
1866 | { | 1904 | { |
1867 | SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); | 1905 | dupe.UpdateParentIDs(); |
1868 | newPart.LinkNum = part.LinkNum; | 1906 | dupe.HasGroupChanged = true; |
1907 | dupe.AttachToBackup(); | ||
1908 | |||
1909 | ScheduleGroupForFullUpdate(); | ||
1869 | } | 1910 | } |
1870 | 1911 | ||
1871 | // Need to duplicate the physics actor as well | ||
1872 | if (part.PhysActor != null && userExposed) | ||
1873 | { | ||
1874 | PrimitiveBaseShape pbs = part.Shape; | ||
1875 | |||
1876 | part.PhysActor | ||
1877 | = m_scene.PhysicsScene.AddPrimShape( | ||
1878 | part.Name, | ||
1879 | pbs, | ||
1880 | part.AbsolutePosition, | ||
1881 | part.Scale, | ||
1882 | part.RotationOffset, | ||
1883 | part.PhysActor.IsPhysical); | ||
1884 | |||
1885 | part.PhysActor.LocalID = part.LocalId; | ||
1886 | part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); | ||
1887 | } | ||
1888 | } | 1912 | } |
1889 | 1913 | finally | |
1890 | if (userExposed) | ||
1891 | { | 1914 | { |
1892 | m_dupeInProgress = false; | 1915 | m_dupeInProgress = false; |
1893 | } | 1916 | } |
@@ -1905,6 +1928,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1905 | SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed)); | 1928 | SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed)); |
1906 | } | 1929 | } |
1907 | 1930 | ||
1931 | public void ScriptSetPhysicsStatus(bool UsePhysics) | ||
1908 | { | 1932 | { |
1909 | bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0); | 1933 | bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0); |
1910 | bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0); | 1934 | bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0); |