aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorubit2012-07-06 18:15:58 +0200
committerubit2012-07-06 18:15:58 +0200
commitd4640f856947226229b531e3a4f46971a910cc93 (patch)
tree6fb42b3d2fed041133ee5bdcc11ba92d65330f4a /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parent added llSetVelocity. will refuse to work on vehicles and on attachments ( th... (diff)
downloadopensim-SC-d4640f856947226229b531e3a4f46971a910cc93.zip
opensim-SC-d4640f856947226229b531e3a4f46971a910cc93.tar.gz
opensim-SC-d4640f856947226229b531e3a4f46971a910cc93.tar.bz2
opensim-SC-d4640f856947226229b531e3a4f46971a910cc93.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs28
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