本文整理汇总了C#中OpenSim.Region.Framework.Scenes.ScenePresence.GetWorldRotation方法的典型用法代码示例。如果您正苦于以下问题:C# ScenePresence.GetWorldRotation方法的具体用法?C# ScenePresence.GetWorldRotation怎么用?C# ScenePresence.GetWorldRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.ScenePresence
的用法示例。
在下文中一共展示了ScenePresence.GetWorldRotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAgentParams
/// <summary>
/// Gets params for a seated avatar in a linkset.
/// </summary>
/// <returns></returns>
/// <param name='sp'></param>
/// <param name='rules'></param>
/// <param name='res'></param>
public LSL_List GetAgentParams(ScenePresence sp, LSL_List rules, ref LSL_List res)
{
int idx = 0;
while (idx < rules.Length)
{
int code = (int)rules.GetLSLIntegerItem(idx++);
int remain = rules.Length-idx;
switch (code)
{
case (int)ScriptBaseClass.PRIM_MATERIAL:
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MATERIAL_FLESH));
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
res.Add(ScriptBaseClass.FALSE);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
res.Add(ScriptBaseClass.FALSE);
break;
case (int)ScriptBaseClass.PRIM_PHANTOM:
res.Add(ScriptBaseClass.FALSE);
break;
case (int)ScriptBaseClass.PRIM_POSITION:
res.Add(new LSL_Vector(sp.AbsolutePosition));
break;
case (int)ScriptBaseClass.PRIM_SIZE:
res.Add(GetAgentSize(sp));
break;
case (int)ScriptBaseClass.PRIM_ROTATION:
res.Add(sp.GetWorldRotation());
break;
case (int)ScriptBaseClass.PRIM_TYPE:
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TYPE_BOX));
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_HOLE_DEFAULT));
res.Add(new LSL_Vector(0, 1, 0));
res.Add(new LSL_Float(0));
res.Add(new LSL_Vector(0, 0, 0));
res.Add(new LSL_Vector(1, 1, 0));
res.Add(new LSL_Vector(0, 0, 0));
break;
case (int)ScriptBaseClass.PRIM_TEXTURE:
if (remain < 1)
return null;
int face = (int)rules.GetLSLIntegerItem(idx++);
if (face > 21)
break;
res.Add(new LSL_String(""));
res.Add(ScriptBaseClass.ZERO_VECTOR);
res.Add(ScriptBaseClass.ZERO_VECTOR);
res.Add(new LSL_Float(0));
break;
case (int)ScriptBaseClass.PRIM_COLOR:
if (remain < 1)
return null;
face = (int)rules.GetLSLIntegerItem(idx++);
if (face > 21)
break;
res.Add(ScriptBaseClass.ZERO_VECTOR);
res.Add(new LSL_Float(0));
break;
case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
if (remain < 1)
return null;
face = (int)rules.GetLSLIntegerItem(idx++);
if (face > 21)
break;
res.Add(ScriptBaseClass.PRIM_SHINY_NONE);
res.Add(ScriptBaseClass.PRIM_BUMP_NONE);
break;
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
if (remain < 1)
return null;
face = (int)rules.GetLSLIntegerItem(idx++);
if (face > 21)
break;
//.........这里部分代码省略.........
示例2: GetPrimParams
public LSL_List GetPrimParams(ScenePresence avatar, LSL_List rules, ref LSL_List res)
{
// avatars case
// replies as SL wiki
// SceneObjectPart sitPart = avatar.ParentPart; // most likelly it will be needed
SceneObjectPart sitPart = World.GetSceneObjectPart(avatar.ParentID); // maybe better do this expensive search for it in case it's gone??
int idx = 0;
while (idx < rules.Length)
{
int code = (int)rules.GetLSLIntegerItem(idx++);
int remain = rules.Length - idx;
switch (code)
{
case (int)ScriptBaseClass.PRIM_MATERIAL:
res.Add(new LSL_Integer((int)SOPMaterialData.SopMaterial.Flesh));
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
res.Add(new LSL_Integer(0));
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
res.Add(new LSL_Integer(0));
break;
case (int)ScriptBaseClass.PRIM_PHANTOM:
res.Add(new LSL_Integer(0));
break;
case (int)ScriptBaseClass.PRIM_POSITION:
Vector3 pos;
if (sitPart.ParentGroup.RootPart != null)
{
pos = avatar.OffsetPosition;
if(!avatar.LegacySitOffsets)
{
Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f);
pos -= sitOffset;
}
SceneObjectPart sitroot = sitPart.ParentGroup.RootPart;
pos = sitroot.AbsolutePosition + pos * sitroot.GetWorldRotation();
}
else
pos = avatar.AbsolutePosition;
res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z));
break;
case (int)ScriptBaseClass.PRIM_SIZE:
Vector3 s = avatar.Appearance.AvatarSize;
res.Add(new LSL_Vector(s.X, s.Y, s.Z));
break;
case (int)ScriptBaseClass.PRIM_ROTATION:
res.Add(new LSL_Rotation(avatar.GetWorldRotation()));
break;
case (int)ScriptBaseClass.PRIM_TYPE:
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TYPE_BOX));
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_HOLE_DEFAULT));
res.Add(new LSL_Vector(0f,1.0f,0f));
res.Add(new LSL_Float(0.0f));
res.Add(new LSL_Vector(0, 0, 0));
res.Add(new LSL_Vector(1.0f,1.0f,0f));
res.Add(new LSL_Vector(0, 0, 0));
break;
case (int)ScriptBaseClass.PRIM_TEXTURE:
if (remain < 1)
return new LSL_List();
int face = (int)rules.GetLSLIntegerItem(idx++);
if (face == ScriptBaseClass.ALL_SIDES)
{
for (face = 0; face < 21; face++)
{
res.Add(new LSL_String(""));
res.Add(new LSL_Vector(0,0,0));
res.Add(new LSL_Vector(0,0,0));
res.Add(new LSL_Float(0.0));
}
}
else
{
if (face >= 0 && face < 21)
{
res.Add(new LSL_String(""));
res.Add(new LSL_Vector(0,0,0));
res.Add(new LSL_Vector(0,0,0));
res.Add(new LSL_Float(0.0));
}
}
break;
//.........这里部分代码省略.........