add suport for PRIM_SIT_TARGET on get(link)PrimitveParameters and fix typos

melanie
UbitUmarov 2016-11-05 16:50:41 +00:00
parent be0a957363
commit 060350832a
2 changed files with 24 additions and 12 deletions

View File

@ -662,15 +662,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
List<SceneObjectPart> ret = new List<SceneObjectPart>(); List<SceneObjectPart> ret = new List<SceneObjectPart>();
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return ret; return ret;
ret.Add(part);
switch (linkType) switch (linkType)
{ {
case ScriptBaseClass.LINK_SET: case ScriptBaseClass.LINK_SET:
return new List<SceneObjectPart>(part.ParentGroup.Parts); return new List<SceneObjectPart>(part.ParentGroup.Parts);
case ScriptBaseClass.LINK_ROOT: case ScriptBaseClass.LINK_ROOT:
ret = new List<SceneObjectPart>();
ret.Add(part.ParentGroup.RootPart); ret.Add(part.ParentGroup.RootPart);
return ret; return ret;
@ -690,16 +688,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return ret; return ret;
case ScriptBaseClass.LINK_THIS: case ScriptBaseClass.LINK_THIS:
ret.Add(part);
return ret; return ret;
default: default:
if (linkType < 0) if (linkType < 0)
return new List<SceneObjectPart>(); return ret;
SceneObjectPart target = part.ParentGroup.GetLinkNumPart(linkType); SceneObjectPart target = part.ParentGroup.GetLinkNumPart(linkType);
if (target == null) if (target == null)
return new List<SceneObjectPart>(); return ret;
ret = new List<SceneObjectPart>();
ret.Add(target); ret.Add(target);
return ret; return ret;
} }
@ -11182,7 +11180,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Float(spin)); res.Add(new LSL_Float(spin));
res.Add(new LSL_Float(gain)); res.Add(new LSL_Float(gain));
break; break;
case (int)ScriptBaseClass.PRIM_SIT_TARGET:
if(part.IsSitTargetSet)
{
res.Add(new LSL_Integer(1));
res.Add(new LSL_Vector(part.SitTargetPosition));
res.Add(new LSL_Rotation(part.SitTargetOrientation));
}
else
{
res.Add(new LSL_Integer(0));
res.Add(new LSL_Vector(Vector3.Zero));
res.Add(new LSL_Rotation(Quaternion.Identity));
}
break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET: case (int)ScriptBaseClass.PRIM_LINK_TARGET:
// TODO: Should be issuing a runtime script warning in this case. // TODO: Should be issuing a runtime script warning in this case.

View File

@ -339,7 +339,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
// LINK flags // LINK flags
public const int LINK_SET = -1; public const int LINK_SET = -1;
public const int LINK_TRUEROOT = 0; // possible this should had been ROOT all the time
public const int LINK_ROOT = 1; public const int LINK_ROOT = 1;
public const int LINK_ALL_OTHERS = -2; public const int LINK_ALL_OTHERS = -2;
public const int LINK_ALL_CHILDREN = -3; public const int LINK_ALL_CHILDREN = -3;
@ -418,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_DESC = 28; public const int PRIM_DESC = 28;
public const int PRIM_ROT_LOCAL = 29; public const int PRIM_ROT_LOCAL = 29;
public const int PRIM_PHYSICS_SHAPE_TYPE = 30; public const int PRIM_PHYSICS_SHAPE_TYPE = 30;
public const int PRIM_PHYSICS_MATERIAL = 31; // aparently not SL public const int PRIM_PHYSICS_MATERIAL = 31; // apparently not on SL wiki
public const int PRIM_OMEGA = 32; public const int PRIM_OMEGA = 32;
public const int PRIM_POS_LOCAL = 33; public const int PRIM_POS_LOCAL = 33;
public const int PRIM_LINK_TARGET = 34; public const int PRIM_LINK_TARGET = 34;
@ -426,9 +425,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_SPECULAR = 36; public const int PRIM_SPECULAR = 36;
public const int PRIM_NORMAL = 37; public const int PRIM_NORMAL = 37;
public const int PRIM_ALPHA_MODE = 38; public const int PRIM_ALPHA_MODE = 38;
public const int PRIM_ALLOW_UNSIT = 39; // experiences related. Unsuport public const int PRIM_ALLOW_UNSIT = 39; // experiences related. unsupported
public const int PRIM_SCRIPTED_SIT_ONLY = 40; // experiences related. Unsuport public const int PRIM_SCRIPTED_SIT_ONLY = 40; // experiences related. unsupported
public const int PRIM_SIT_TARGET = 40; public const int PRIM_SIT_TARGET = 41;
// parameters // parameters