Implementation of PRIM_OMEGA, but only for setting

Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
remove-scene-viewer
SignpostMarv Martin 2011-10-26 13:33:52 +01:00 committed by BlueWall
parent 059f4b6a3a
commit 9a28e7a4e0
2 changed files with 18 additions and 4 deletions

View File

@ -3325,12 +3325,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
{
m_host.AddScriptLPS(1);
m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
m_host.ScheduleTerseUpdate();
m_host.SendTerseUpdateToAllClients();
m_host.ParentGroup.HasGroupChanged = true;
TargetOmega(m_host, axis, spinrate, gain);
}
protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
{
part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
part.ScheduleTerseUpdate();
part.SendTerseUpdateToAllClients();
part.ParentGroup.HasGroupChanged = true;
}
public LSL_Integer llGetStartParameter()
{
m_host.AddScriptLPS(1);
@ -7397,6 +7402,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr));
break;
case (int)ScriptBaseClass.PRIM_OMEGA:
if (remain < 3)
return;
LSL_Vector axis = rules.GetVector3Item(idx++);
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
LSL_Float gain = rules.GetLSLFloatItem(idx++);
TargetOmega(part, axis, (double)spinrate, (double)gain);
break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
return;

View File

@ -321,6 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_NAME = 27;
public const int PRIM_DESC = 28;
public const int PRIM_ROT_LOCAL = 29;
public const int PRIM_OMEGA = 32;
public const int PRIM_LINK_TARGET = 34;
public const int PRIM_TEXGEN_DEFAULT = 0;
public const int PRIM_TEXGEN_PLANAR = 1;