diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd30a59..0f44823 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1845,7 +1845,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1845 | } | 1845 | } |
1846 | } | 1846 | } |
1847 | 1847 | ||
1848 | // SetVelocity for LSL llSetVelocity.. may need revision if having other uses in future | 1848 | // SetVelocity for LSL llSetVelocity.. may need revision if having other uses in future |
1849 | public void SetVelocity(Vector3 pVel, bool localGlobalTF) | 1849 | public void SetVelocity(Vector3 pVel, bool localGlobalTF) |
1850 | { | 1850 | { |
1851 | if (ParentGroup == null || ParentGroup.IsDeleted) | 1851 | if (ParentGroup == null || ParentGroup.IsDeleted) |
@@ -1871,6 +1871,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
1871 | 1871 | ||
1872 | ParentGroup.Velocity = pVel; | 1872 | ParentGroup.Velocity = pVel; |
1873 | } | 1873 | } |
1874 | |||
1875 | // SetAngularVelocity for LSL llSetAngularVelocity.. may need revision if having other uses in future | ||
1876 | public void SetAngularVelocity(Vector3 pAngVel, bool localGlobalTF) | ||
1877 | { | ||
1878 | if (ParentGroup == null || ParentGroup.IsDeleted) | ||
1879 | return; | ||
1880 | |||
1881 | if (ParentGroup.IsAttachment) | ||
1882 | return; // don't work on attachments (for now ??) | ||
1883 | |||
1884 | SceneObjectPart root = ParentGroup.RootPart; | ||
1885 | |||
1886 | if (root.VehicleType != (int)Vehicle.TYPE_NONE) // don't mess with vehicles | ||
1887 | return; | ||
1888 | |||
1889 | PhysicsActor pa = root.PhysActor; | ||
1890 | |||
1891 | if (pa == null || !pa.IsPhysical) | ||
1892 | return; | ||
1893 | |||
1894 | if (localGlobalTF) | ||
1895 | { | ||
1896 | pAngVel = pAngVel * GetWorldRotation(); | ||
1897 | } | ||
1898 | |||
1899 | root.AngularVelocity = pAngVel; | ||
1900 | } | ||
1874 | 1901 | ||
1875 | 1902 | ||
1876 | /// <summary> | 1903 | /// <summary> |