aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2016-11-02 21:42:32 +0000
committerUbitUmarov2016-11-02 21:42:32 +0000
commit9480da06b971e7ffa500c33399cdb2114a39637f (patch)
tree11db75d3f5c62ec9c31bd61c876406477dc44c86
parentignore prims with shape type none on max size check for physics (diff)
downloadopensim-SC-9480da06b971e7ffa500c33399cdb2114a39637f.zip
opensim-SC-9480da06b971e7ffa500c33399cdb2114a39637f.tar.gz
opensim-SC-9480da06b971e7ffa500c33399cdb2114a39637f.tar.bz2
opensim-SC-9480da06b971e7ffa500c33399cdb2114a39637f.tar.xz
only add a prim to physics in PhysicsShapeType if changing from type none. when viewers change ExtraPhysics parameters, send back the new values.
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs1
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs97
3 files changed, 43 insertions, 57 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index ad25bc8..17e4400 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2920,7 +2920,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2920 { 2920 {
2921 m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString()); 2921 m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString());
2922 } 2922 }
2923 part.UpdatePhysRequired = false;
2924 } 2923 }
2925 } 2924 }
2926 2925
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 238ec8e..1141f54 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1660,7 +1660,7 @@ namespace OpenSim.Region.Framework.Scenes
1660 if (part != null) 1660 if (part != null)
1661 { 1661 {
1662 part.UpdateExtraPhysics(PhysData); 1662 part.UpdateExtraPhysics(PhysData);
1663 if (part.UpdatePhysRequired && remoteClient != null) 1663 if (remoteClient != null)
1664 remoteClient.SendPartPhysicsProprieties(part); 1664 remoteClient.SendPartPhysicsProprieties(part);
1665 } 1665 }
1666 } 1666 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 06d767d..9d1dca2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1222,7 +1222,6 @@ namespace OpenSim.Region.Framework.Scenes
1222 } 1222 }
1223 1223
1224 public UpdateRequired UpdateFlag { get; set; } 1224 public UpdateRequired UpdateFlag { get; set; }
1225 public bool UpdatePhysRequired { get; set; }
1226 1225
1227 /// <summary> 1226 /// <summary>
1228 /// Used for media on a prim. 1227 /// Used for media on a prim.
@@ -1637,7 +1636,6 @@ namespace OpenSim.Region.Framework.Scenes
1637 if(ParentGroup != null) 1636 if(ParentGroup != null)
1638 ParentGroup.HasGroupChanged = true; 1637 ParentGroup.HasGroupChanged = true;
1639 ScheduleFullUpdateIfNone(); 1638 ScheduleFullUpdateIfNone();
1640 UpdatePhysRequired = true;
1641 } 1639 }
1642 } 1640 }
1643 } 1641 }
@@ -1729,7 +1727,7 @@ namespace OpenSim.Region.Framework.Scenes
1729 set 1727 set
1730 { 1728 {
1731 byte oldv = m_physicsShapeType; 1729 byte oldv = m_physicsShapeType;
1732 1730
1733 if (value >= 0 && value <= (byte)PhysShapeType.convex) 1731 if (value >= 0 && value <= (byte)PhysShapeType.convex)
1734 { 1732 {
1735 if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) 1733 if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this)
@@ -1748,28 +1746,21 @@ namespace OpenSim.Region.Framework.Scenes
1748 { 1746 {
1749 ParentGroup.Scene.RemovePhysicalPrim(1); 1747 ParentGroup.Scene.RemovePhysicalPrim(1);
1750 RemoveFromPhysics(); 1748 RemoveFromPhysics();
1751 Stop(); 1749// Stop();
1752 } 1750 }
1753 } 1751 }
1754 else if (PhysActor == null) 1752 else if (PhysActor == null)
1755 { 1753 {
1756 ApplyPhysics((uint)Flags, VolumeDetectActive, false); 1754 if(oldv == (byte)PhysShapeType.none)
1757 UpdatePhysicsSubscribedEvents(); 1755 {
1756 ApplyPhysics((uint)Flags, VolumeDetectActive, false);
1757 UpdatePhysicsSubscribedEvents();
1758 }
1758 } 1759 }
1759 else 1760 else
1760 {
1761 PhysActor.PhysicsShapeType = m_physicsShapeType; 1761 PhysActor.PhysicsShapeType = m_physicsShapeType;
1762// if (Shape.SculptEntry)
1763// CheckSculptAndLoad();
1764 }
1765 1762
1766 if (ParentGroup != null) 1763 ParentGroup.HasGroupChanged = true;
1767 ParentGroup.HasGroupChanged = true;
1768 }
1769
1770 if (m_physicsShapeType != value)
1771 {
1772 UpdatePhysRequired = true;
1773 } 1764 }
1774 } 1765 }
1775 } 1766 }
@@ -1782,17 +1773,16 @@ namespace OpenSim.Region.Framework.Scenes
1782 if (value >=1 && value <= 22587.0) 1773 if (value >=1 && value <= 22587.0)
1783 { 1774 {
1784 m_density = value; 1775 m_density = value;
1785 UpdatePhysRequired = true;
1786 }
1787 1776
1788 ScheduleFullUpdateIfNone(); 1777 ScheduleFullUpdateIfNone();
1789 1778
1790 if (ParentGroup != null) 1779 if (ParentGroup != null)
1791 ParentGroup.HasGroupChanged = true; 1780 ParentGroup.HasGroupChanged = true;
1792 1781
1793 PhysicsActor pa = PhysActor; 1782 PhysicsActor pa = PhysActor;
1794 if (pa != null) 1783 if (pa != null)
1795 pa.Density = Density; 1784 pa.Density = m_density;
1785 }
1796 } 1786 }
1797 } 1787 }
1798 1788
@@ -1804,17 +1794,16 @@ namespace OpenSim.Region.Framework.Scenes
1804 if( value >= -1 && value <=28.0f) 1794 if( value >= -1 && value <=28.0f)
1805 { 1795 {
1806 m_gravitymod = value; 1796 m_gravitymod = value;
1807 UpdatePhysRequired = true;
1808 }
1809 1797
1810 ScheduleFullUpdateIfNone(); 1798 ScheduleFullUpdateIfNone();
1811 1799
1812 if (ParentGroup != null) 1800 if (ParentGroup != null)
1813 ParentGroup.HasGroupChanged = true; 1801 ParentGroup.HasGroupChanged = true;
1814 1802
1815 PhysicsActor pa = PhysActor; 1803 PhysicsActor pa = PhysActor;
1816 if (pa != null) 1804 if (pa != null)
1817 pa.GravModifier = GravityModifier; 1805 pa.GravModifier = m_gravitymod;
1806 }
1818 } 1807 }
1819 } 1808 }
1820 1809
@@ -1826,17 +1815,16 @@ namespace OpenSim.Region.Framework.Scenes
1826 if (value >= 0 && value <= 255.0f) 1815 if (value >= 0 && value <= 255.0f)
1827 { 1816 {
1828 m_friction = value; 1817 m_friction = value;
1829 UpdatePhysRequired = true;
1830 }
1831 1818
1832 ScheduleFullUpdateIfNone(); 1819 ScheduleFullUpdateIfNone();
1833 1820
1834 if (ParentGroup != null) 1821 if (ParentGroup != null)
1835 ParentGroup.HasGroupChanged = true; 1822 ParentGroup.HasGroupChanged = true;
1836 1823
1837 PhysicsActor pa = PhysActor; 1824 PhysicsActor pa = PhysActor;
1838 if (pa != null) 1825 if (pa != null)
1839 pa.Friction = Friction; 1826 pa.Friction = m_friction;
1827 }
1840 } 1828 }
1841 } 1829 }
1842 1830
@@ -1848,17 +1836,16 @@ namespace OpenSim.Region.Framework.Scenes
1848 if (value >= 0 && value <= 1.0f) 1836 if (value >= 0 && value <= 1.0f)
1849 { 1837 {
1850 m_bounce = value; 1838 m_bounce = value;
1851 UpdatePhysRequired = true;
1852 }
1853 1839
1854 ScheduleFullUpdateIfNone(); 1840 ScheduleFullUpdateIfNone();
1855 1841
1856 if (ParentGroup != null) 1842 if (ParentGroup != null)
1857 ParentGroup.HasGroupChanged = true; 1843 ParentGroup.HasGroupChanged = true;
1858 1844
1859 PhysicsActor pa = PhysActor; 1845 PhysicsActor pa = PhysActor;
1860 if (pa != null) 1846 if (pa != null)
1861 pa.Restitution = Restitution; 1847 pa.Restitution = m_bounce;
1848 }
1862 } 1849 }
1863 } 1850 }
1864 1851
@@ -4541,24 +4528,24 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
4541 } 4528 }
4542 } 4529 }
4543 4530
4544
4545 public void UpdateExtraPhysics(ExtraPhysicsData physdata) 4531 public void UpdateExtraPhysics(ExtraPhysicsData physdata)
4546 { 4532 {
4547 if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null) 4533 if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null)
4548 return; 4534 return;
4549 4535
4550 if (PhysicsShapeType != (byte)physdata.PhysShapeType) 4536 byte newtype = (byte)physdata.PhysShapeType;
4551 { 4537 if (PhysicsShapeType != newtype)
4552 PhysicsShapeType = (byte)physdata.PhysShapeType; 4538 PhysicsShapeType = newtype;
4553
4554 }
4555 4539
4556 if(Density != physdata.Density) 4540 if(Density != physdata.Density)
4557 Density = physdata.Density; 4541 Density = physdata.Density;
4542
4558 if(GravityModifier != physdata.GravitationModifier) 4543 if(GravityModifier != physdata.GravitationModifier)
4559 GravityModifier = physdata.GravitationModifier; 4544 GravityModifier = physdata.GravitationModifier;
4545
4560 if(Friction != physdata.Friction) 4546 if(Friction != physdata.Friction)
4561 Friction = physdata.Friction; 4547 Friction = physdata.Friction;
4548
4562 if(Restitution != physdata.Bounce) 4549 if(Restitution != physdata.Bounce)
4563 Restitution = physdata.Bounce; 4550 Restitution = physdata.Bounce;
4564 } 4551 }