diff options
Merge branch 'ubitwork' into avination
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd30a59..16a8588 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -959,7 +959,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
959 | } | 959 | } |
960 | return m_angularVelocity; | 960 | return m_angularVelocity; |
961 | } | 961 | } |
962 | set { m_angularVelocity = value; } | 962 | set |
963 | { | ||
964 | m_angularVelocity = value; | ||
965 | PhysicsActor actor = PhysActor; | ||
966 | if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this && VehicleType == (int)Vehicle.TYPE_NONE) | ||
967 | { | ||
968 | actor.RotationalVelocity = m_angularVelocity; | ||
969 | } | ||
970 | } | ||
963 | } | 971 | } |
964 | 972 | ||
965 | /// <summary></summary> | 973 | /// <summary></summary> |
@@ -1845,7 +1853,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1845 | } | 1853 | } |
1846 | } | 1854 | } |
1847 | 1855 | ||
1848 | // SetVelocity for LSL llSetVelocity.. may need revision if having other uses in future | 1856 | // SetVelocity for LSL llSetVelocity.. may need revision if having other uses in future |
1849 | public void SetVelocity(Vector3 pVel, bool localGlobalTF) | 1857 | public void SetVelocity(Vector3 pVel, bool localGlobalTF) |
1850 | { | 1858 | { |
1851 | if (ParentGroup == null || ParentGroup.IsDeleted) | 1859 | if (ParentGroup == null || ParentGroup.IsDeleted) |
@@ -1871,6 +1879,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
1871 | 1879 | ||
1872 | ParentGroup.Velocity = pVel; | 1880 | ParentGroup.Velocity = pVel; |
1873 | } | 1881 | } |
1882 | |||
1883 | // SetAngularVelocity for LSL llSetAngularVelocity.. may need revision if having other uses in future | ||
1884 | public void SetAngularVelocity(Vector3 pAngVel, bool localGlobalTF) | ||
1885 | { | ||
1886 | if (ParentGroup == null || ParentGroup.IsDeleted) | ||
1887 | return; | ||
1888 | |||
1889 | if (ParentGroup.IsAttachment) | ||
1890 | return; // don't work on attachments (for now ??) | ||
1891 | |||
1892 | SceneObjectPart root = ParentGroup.RootPart; | ||
1893 | |||
1894 | if (root.VehicleType != (int)Vehicle.TYPE_NONE) // don't mess with vehicles | ||
1895 | return; | ||
1896 | |||
1897 | PhysicsActor pa = root.PhysActor; | ||
1898 | |||
1899 | if (pa == null || !pa.IsPhysical) | ||
1900 | return; | ||
1901 | |||
1902 | if (localGlobalTF) | ||
1903 | { | ||
1904 | pAngVel = pAngVel * GetWorldRotation(); | ||
1905 | } | ||
1906 | |||
1907 | root.AngularVelocity = pAngVel; | ||
1908 | } | ||
1874 | 1909 | ||
1875 | 1910 | ||
1876 | /// <summary> | 1911 | /// <summary> |