diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a48605d..ed32adc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1845,6 +1845,34 @@ 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 | ||
1849 | public void SetVelocity(Vector3 pVel, bool localGlobalTF) | ||
1850 | { | ||
1851 | if (ParentGroup == null || ParentGroup.IsDeleted) | ||
1852 | return; | ||
1853 | |||
1854 | if (ParentGroup.IsAttachment) | ||
1855 | return; // don't work on attachments (for now ??) | ||
1856 | |||
1857 | SceneObjectPart root = ParentGroup.RootPart; | ||
1858 | |||
1859 | if (root.VehicleType != (int)Vehicle.TYPE_NONE) // don't mess with vehicles | ||
1860 | return; | ||
1861 | |||
1862 | PhysicsActor pa = root.PhysActor; | ||
1863 | |||
1864 | if (pa == null || !pa.IsPhysical) | ||
1865 | return; | ||
1866 | |||
1867 | if (localGlobalTF) | ||
1868 | { | ||
1869 | pVel = pVel * GetWorldRotation(); | ||
1870 | } | ||
1871 | |||
1872 | ParentGroup.Velocity = pVel; | ||
1873 | } | ||
1874 | |||
1875 | |||
1848 | /// <summary> | 1876 | /// <summary> |
1849 | /// hook to the physics scene to apply angular impulse | 1877 | /// hook to the physics scene to apply angular impulse |
1850 | /// This is sent up to the group, which then finds the root prim | 1878 | /// This is sent up to the group, which then finds the root prim |