diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index af04951..849d02d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1803,6 +1803,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1803 | return 0; | 1803 | return 0; |
1804 | } | 1804 | } |
1805 | 1805 | ||
1806 | public LSL_Integer llScaleByFactor(double scaling_factor) | ||
1807 | { | ||
1808 | m_host.AddScriptLPS(1); | ||
1809 | SceneObjectGroup group = m_host.ParentGroup; | ||
1810 | |||
1811 | if(scaling_factor < 1e-6) | ||
1812 | return ScriptBaseClass.FALSE; | ||
1813 | if(scaling_factor > 1e6) | ||
1814 | return ScriptBaseClass.FALSE; | ||
1815 | |||
1816 | if (group == null || group.IsDeleted || group.inTransit) | ||
1817 | return ScriptBaseClass.FALSE; | ||
1818 | |||
1819 | if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical) | ||
1820 | return ScriptBaseClass.FALSE; | ||
1821 | |||
1822 | if (group.RootPart.KeyframeMotion != null) | ||
1823 | return ScriptBaseClass.FALSE; | ||
1824 | |||
1825 | if(group.GroupResize(scaling_factor)) | ||
1826 | return ScriptBaseClass.TRUE; | ||
1827 | else | ||
1828 | return ScriptBaseClass.FALSE; | ||
1829 | } | ||
1830 | |||
1831 | public LSL_Float llGetMaxScaleFactor() | ||
1832 | { | ||
1833 | m_host.AddScriptLPS(1); | ||
1834 | SceneObjectGroup group = m_host.ParentGroup; | ||
1835 | |||
1836 | if (group == null || group.IsDeleted || group.inTransit) | ||
1837 | return 1.0f; | ||
1838 | |||
1839 | return (LSL_Float)group.GetMaxGroupResizeScale(); | ||
1840 | } | ||
1841 | |||
1842 | public LSL_Float llGetMinScaleFactor() | ||
1843 | { | ||
1844 | m_host.AddScriptLPS(1); | ||
1845 | SceneObjectGroup group = m_host.ParentGroup; | ||
1846 | |||
1847 | if (group == null || group.IsDeleted || group.inTransit) | ||
1848 | return 1.0f; | ||
1849 | |||
1850 | return (LSL_Float)group.GetMinGroupResizeScale(); | ||
1851 | } | ||
1852 | |||
1806 | public void llSetScale(LSL_Vector scale) | 1853 | public void llSetScale(LSL_Vector scale) |
1807 | { | 1854 | { |
1808 | m_host.AddScriptLPS(1); | 1855 | m_host.AddScriptLPS(1); |
@@ -3049,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3049 | { | 3096 | { |
3050 | m_host.AddScriptLPS(1); | 3097 | m_host.AddScriptLPS(1); |
3051 | double ScriptTime = Util.GetTimeStampMS() - m_timer; | 3098 | double ScriptTime = Util.GetTimeStampMS() - m_timer; |
3052 | return (ScriptTime / 1000.0); | 3099 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3053 | } | 3100 | } |
3054 | 3101 | ||
3055 | public void llResetTime() | 3102 | public void llResetTime() |
@@ -3064,7 +3111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3064 | double now = Util.GetTimeStampMS(); | 3111 | double now = Util.GetTimeStampMS(); |
3065 | double ScriptTime = now - m_timer; | 3112 | double ScriptTime = now - m_timer; |
3066 | m_timer = now; | 3113 | m_timer = now; |
3067 | return (ScriptTime / 1000.0); | 3114 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3068 | } | 3115 | } |
3069 | 3116 | ||
3070 | public void llSound(string sound, double volume, int queue, int loop) | 3117 | public void llSound(string sound, double volume, int queue, int loop) |
@@ -3482,13 +3529,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3482 | 3529 | ||
3483 | if (item == null) | 3530 | if (item == null) |
3484 | { | 3531 | { |
3485 | Error("llRezAtRoot", "Can't find object '" + inventory + "'"); | 3532 | Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); |
3486 | return; | 3533 | return; |
3487 | } | 3534 | } |
3488 | 3535 | ||
3489 | if (item.InvType != (int)InventoryType.Object) | 3536 | if (item.InvType != (int)InventoryType.Object) |
3490 | { | 3537 | { |
3491 | Error("llRezAtRoot", "Can't create requested object; object is missing from database"); | 3538 | Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); |
3492 | return; | 3539 | return; |
3493 | } | 3540 | } |
3494 | 3541 | ||
@@ -3532,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3532 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | 3579 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) |
3533 | } | 3580 | } |
3534 | 3581 | ||
3535 | }, null, "LSL_Api.llRezAtRoot"); | 3582 | }, null, "LSL_Api.doObjectRez"); |
3536 | 3583 | ||
3537 | //ScriptSleep((int)((groupmass * velmag) / 10)); | 3584 | //ScriptSleep((int)((groupmass * velmag) / 10)); |
3538 | ScriptSleep(m_sleepMsOnRezAtRoot); | 3585 | ScriptSleep(m_sleepMsOnRezAtRoot); |