aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorSignpostMarv Martin2011-10-26 13:33:52 +0100
committerBlueWall2011-10-26 08:41:07 -0400
commit9a28e7a4e0392ef0a5b890b4c1875a44af57a90c (patch)
treec8334631d8e464b4e19edcc398bb191f3761f94e /OpenSim/Region/ScriptEngine/Shared
parentImplementing PRIM_LINK_TARGET, but only for setting params (diff)
downloadopensim-SC-9a28e7a4e0392ef0a5b890b4c1875a44af57a90c.zip
opensim-SC-9a28e7a4e0392ef0a5b890b4c1875a44af57a90c.tar.gz
opensim-SC-9a28e7a4e0392ef0a5b890b4c1875a44af57a90c.tar.bz2
opensim-SC-9a28e7a4e0392ef0a5b890b4c1875a44af57a90c.tar.xz
Implementation of PRIM_OMEGA, but only for setting
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
2 files changed, 18 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 fe8d358..82701ce 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3325,12 +3325,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3325 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) 3325 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
3326 { 3326 {
3327 m_host.AddScriptLPS(1); 3327 m_host.AddScriptLPS(1);
3328 m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 3328 TargetOmega(m_host, axis, spinrate, gain);
3329 m_host.ScheduleTerseUpdate();
3330 m_host.SendTerseUpdateToAllClients();
3331 m_host.ParentGroup.HasGroupChanged = true;
3332 } 3329 }
3333 3330
3331 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3332 {
3333 part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
3334 part.ScheduleTerseUpdate();
3335 part.SendTerseUpdateToAllClients();
3336 part.ParentGroup.HasGroupChanged = true;
3337 }
3338
3334 public LSL_Integer llGetStartParameter() 3339 public LSL_Integer llGetStartParameter()
3335 { 3340 {
3336 m_host.AddScriptLPS(1); 3341 m_host.AddScriptLPS(1);
@@ -7397,6 +7402,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7397 LSL_Rotation lr = rules.GetQuaternionItem(idx++); 7402 LSL_Rotation lr = rules.GetQuaternionItem(idx++);
7398 SetRot(part, Rot2Quaternion(lr)); 7403 SetRot(part, Rot2Quaternion(lr));
7399 break; 7404 break;
7405 case (int)ScriptBaseClass.PRIM_OMEGA:
7406 if (remain < 3)
7407 return;
7408 LSL_Vector axis = rules.GetVector3Item(idx++);
7409 LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
7410 LSL_Float gain = rules.GetLSLFloatItem(idx++);
7411 TargetOmega(part, axis, (double)spinrate, (double)gain);
7412 break;
7400 case (int)ScriptBaseClass.PRIM_LINK_TARGET: 7413 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
7401 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. 7414 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
7402 return; 7415 return;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 50c18a8..ce4661c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -321,6 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
321 public const int PRIM_NAME = 27; 321 public const int PRIM_NAME = 27;
322 public const int PRIM_DESC = 28; 322 public const int PRIM_DESC = 28;
323 public const int PRIM_ROT_LOCAL = 29; 323 public const int PRIM_ROT_LOCAL = 29;
324 public const int PRIM_OMEGA = 32;
324 public const int PRIM_LINK_TARGET = 34; 325 public const int PRIM_LINK_TARGET = 34;
325 public const int PRIM_TEXGEN_DEFAULT = 0; 326 public const int PRIM_TEXGEN_DEFAULT = 0;
326 public const int PRIM_TEXGEN_PLANAR = 1; 327 public const int PRIM_TEXGEN_PLANAR = 1;