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 | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0e0c2b7..e53fd5d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3648,12 +3648,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3648 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) | 3648 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) |
3649 | { | 3649 | { |
3650 | m_host.AddScriptLPS(1); | 3650 | m_host.AddScriptLPS(1); |
3651 | m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); | 3651 | TargetOmega(m_host, axis, spinrate, gain); |
3652 | m_host.ScheduleTerseUpdate(); | ||
3653 | m_host.SendTerseUpdateToAllClients(); | ||
3654 | m_host.ParentGroup.HasGroupChanged = true; | ||
3655 | } | 3652 | } |
3656 | 3653 | ||
3654 | protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) | ||
3655 | { | ||
3656 | part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); | ||
3657 | part.ScheduleTerseUpdate(); | ||
3658 | part.SendTerseUpdateToAllClients(); | ||
3659 | part.ParentGroup.HasGroupChanged = true; | ||
3660 | } | ||
3661 | |||
3657 | public LSL_Integer llGetStartParameter() | 3662 | public LSL_Integer llGetStartParameter() |
3658 | { | 3663 | { |
3659 | m_host.AddScriptLPS(1); | 3664 | m_host.AddScriptLPS(1); |
@@ -7936,6 +7941,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7936 | LSL_Rotation lr = rules.GetQuaternionItem(idx++); | 7941 | LSL_Rotation lr = rules.GetQuaternionItem(idx++); |
7937 | SetRot(part, Rot2Quaternion(lr)); | 7942 | SetRot(part, Rot2Quaternion(lr)); |
7938 | break; | 7943 | break; |
7944 | case (int)ScriptBaseClass.PRIM_OMEGA: | ||
7945 | if (remain < 3) | ||
7946 | return; | ||
7947 | LSL_Vector axis = rules.GetVector3Item(idx++); | ||
7948 | LSL_Float spinrate = rules.GetLSLFloatItem(idx++); | ||
7949 | LSL_Float gain = rules.GetLSLFloatItem(idx++); | ||
7950 | TargetOmega(part, axis, (double)spinrate, (double)gain); | ||
7951 | break; | ||
7952 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | ||
7953 | if (remain < 1) | ||
7954 | return; | ||
7955 | LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); | ||
7956 | part = part.ParentGroup.GetLinkNumPart((int)new_linknumber); | ||
7957 | break; | ||
7939 | } | 7958 | } |
7940 | } | 7959 | } |
7941 | 7960 | ||