• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LSL_Types.list类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list的典型用法代码示例。如果您正苦于以下问题:C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list类的具体用法?C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list怎么用?C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list类属于命名空间,在下文中一共展示了Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1:

        /// <summary>
        /// Process the supplied list and return the
        /// content of the list formatted as a comma
        /// separated list. There is a space after
        /// each comma.
        /// </summary>

        public LSL_String llList2CSV(LSL_List src)
        {

            string ret = String.Empty;
            int    x   = 0;

            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            if (src.Data.Length > 0)
            {
                ret = src.Data[x++].ToString();
                for (; x < src.Data.Length; x++)
                {
                    ret += ", "+src.Data[x].ToString();
                }
            }

            return ret;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:27,代码来源:LSL_Api.cs


示例2: ParseString

        //  <summary>
        //  Scan the string supplied in 'src' and
        //  tokenize it based upon two sets of
        //  tokenizers provided in two lists,
        //  separators and spacers.
        //  </summary>
        //
        //  <remarks>
        //  Separators demarcate tokens and are
        //  elided as they are encountered. Spacers
        //  also demarcate tokens, but are themselves
        //  retained as tokens.
        //
        //  Both separators and spacers may be arbitrarily
        //  long strings. i.e. ":::".
        //
        //  The function returns an ordered list
        //  representing the tokens found in the supplied
        //  sources string. If two successive tokenizers
        //  are encountered, then a NULL entry is added
        //  to the list.
        //
        //  It is a precondition that the source and
        //  toekizer lisst are non-null. If they are null,
        //  then a null pointer exception will be thrown
        //  while their lengths are being determined.
        //
        //  A small amount of working memoryis required
        //  of approximately 8*#tokenizers.
        //
        //  There are many ways in which this function
        //  can be implemented, this implementation is
        //  fairly naive and assumes that when the
        //  function is invooked with a short source
        //  string and/or short lists of tokenizers, then
        //  performance will not be an issue.
        //
        //  In order to minimize the perofrmance
        //  effects of long strings, or large numbers
        //  of tokeizers, the function skips as far as
        //  possible whenever a toekenizer is found,
        //  and eliminates redundant tokenizers as soon
        //  as is possible.
        //
        //  The implementation tries to avoid any copying
        //  of arrays or other objects.
        //  </remarks>

        private LSL_List ParseString(string src, LSL_List separators, LSL_List spacers, bool keepNulls)
        {
            int beginning = 0;
            int srclen = src.Length;
            int seplen = separators.Length;
            object[] separray = separators.Data;
            int spclen = spacers.Length;
            object[] spcarray = spacers.Data;
            int mlen = seplen + spclen;

            int[] offset = new int[mlen + 1];
            bool[] active = new bool[mlen];

            int best;
            int j;

            //    Initial capacity reduces resize cost

            LSL_List tokens = new LSL_List();

            //    All entries are initially valid

            for (int i = 0; i < mlen; i++)
                active[i] = true;

            offset[mlen] = srclen;

            while (beginning < srclen)
            {

                best = mlen;    // as bad as it gets

                //    Scan for separators

                for (j = 0; j < seplen; j++)
                {
                    if (separray[j].ToString() == String.Empty)
                        active[j] = false;

                    if (active[j])
                    {
                        // scan all of the markers
                        if ((offset[j] = src.IndexOf(separray[j].ToString(), beginning)) == -1)
                        {
                            // not present at all
                            active[j] = false;
                        }
                        else
                        {
                            // present and correct
                            if (offset[j] < offset[best])
                            {
//.........这里部分代码省略.........
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:101,代码来源:LSL_Api.cs


示例3: llListInsertList

        /// <summary>
        /// Insert the list identified by <src> into the
        /// list designated by <dest> such that the first
        /// new element has the index specified by <index>
        /// </summary>

        public LSL_List llListInsertList(LSL_List dest, LSL_List src, int index)
        {
			ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            
            LSL_List pref = null;
            LSL_List suff = null;

            

            if (index < 0)
            {
                index = index+dest.Length;
                if (index < 0)
                {
                    index = 0;
                }
            }

            if (index != 0)
            {
                pref = dest.GetSublist(0,index-1);
                if (index < dest.Length)
                {
                    suff = dest.GetSublist(index,-1);
                    return pref + src + suff;
                }
                else
                {
                    return pref + src;
                }
            }
            else
            {
                if (index < dest.Length)
                {
                    suff = dest.GetSublist(index,-1);
                    return src + suff;
                }
                else
                {
                    return src;
                }
            }

        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:51,代码来源:LSL_Api.cs


示例4: llListFindList

        /// <summary>
        /// Returns the index of the first occurrence of test
        /// in src.
        /// </summary>

        public LSL_Integer llListFindList(LSL_List src, LSL_List test)
        {

            int index  = -1;
            int length = src.Length - test.Length + 1;

            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            // If either list is empty, do not match

            if (src.Length != 0 && test.Length != 0)
            {
                for (int i = 0; i < length; i++)
                {
                    if (src.Data[i].Equals(test.Data[0]))
                    {
                        int j;
                        for (j = 1; j < test.Length; j++)
                            if (!src.Data[i+j].Equals(test.Data[j]))
                                break;
                        if (j == test.Length)
                        {
                            index = i;
                            break;
                        }
                    }
                }
            }

            return index;

        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:38,代码来源:LSL_Api.cs


示例5: llList2ListStrided

        /// <summary>
        /// Elements in the source list starting with 0 and then
        /// every i+stride. If the stride is negative then the scan
        /// is backwards producing an inverted result.
        /// Only those elements that are also in the specified
        /// range are included in the result.
        /// </summary>

        public LSL_List llList2ListStrided(LSL_List src, int start, int end, int stride)
        {

            LSL_List result = new LSL_List();
            int[] si = new int[2];
            int[] ei = new int[2];
            bool twopass = false;

            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            //  First step is always to deal with negative indices

            if (start < 0)
                start = src.Length+start;
            if (end   < 0)
                end   = src.Length+end;

            //  Out of bounds indices are OK, just trim them
            //  accordingly

            if (start > src.Length)
                start = src.Length;

            if (end > src.Length)
                end = src.Length;

            if (stride == 0)
                stride = 1;

            //  There may be one or two ranges to be considered

            if (start != end)
            {

                if (start <= end)
                {
                   si[0] = start;
                   ei[0] = end;
                }
                else
                {
                   si[1] = start;
                   ei[1] = src.Length;
                   si[0] = 0;
                   ei[0] = end;
                   twopass = true;
                }

                //  The scan always starts from the beginning of the
                //  source list, but members are only selected if they
                //  fall within the specified sub-range. The specified
                //  range values are inclusive.
                //  A negative stride reverses the direction of the
                //  scan producing an inverted list as a result.

                if (stride > 0)
                {
                    for (int i = 0; i < src.Length; i += stride)
                    {
                        if (i<=ei[0] && i>=si[0])
                            result.Add(src.Data[i]);
                        if (twopass && i>=si[1] && i<=ei[1])
                            result.Add(src.Data[i]);
                    }
                }
                else if (stride < 0)
                {
                    for (int i = src.Length - 1; i >= 0; i += stride)
                    {
                        if (i <= ei[0] && i >= si[0])
                            result.Add(src.Data[i]);
                        if (twopass && i >= si[1] && i <= ei[1])
                            result.Add(src.Data[i]);
                    }
                }
            }
            else
            {
                if (start%stride == 0)
                {
                    result.Add(src.Data[start]);
                }
            }

            return result;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:95,代码来源:LSL_Api.cs


示例6: llListRandomize

        ///  <summary>
        ///  Randomizes the list, be arbitrarily reordering
        ///  sublists of stride elements. As the stride approaches
        ///  the size of the list, the options become very
        ///  limited.
        ///  </summary>
        ///  <remarks>
        ///  This could take a while for very large list
        ///  sizes.
        ///  </remarks>

        public LSL_List llListRandomize(LSL_List src, int stride)
        {
            LSL_List result;
            Random rand           = new Random();

            int   chunkk;
            int[] chunks;

            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            if (stride <= 0)
            {
                stride = 1;
            }

            // Stride MUST be a factor of the list length
            // If not, then return the src list. This also
            // traps those cases where stride > length.

            if (src.Length != stride && src.Length%stride == 0)
            {
                chunkk = src.Length/stride;

                chunks = new int[chunkk];

                for (int i = 0; i < chunkk; i++)
                    chunks[i] = i;

                // Knuth shuffle the chunkk index
                for (int i = chunkk - 1; i >= 1; i--)
                {
                    // Elect an unrandomized chunk to swap
                    int index = rand.Next(i + 1);
                    int tmp;

                    // and swap position with first unrandomized chunk
                    tmp = chunks[i];
                    chunks[i] = chunks[index];
                    chunks[index] = tmp;
                }

                // Construct the randomized list

                result = new LSL_List();

                for (int i = 0; i < chunkk; i++)
                {
                    for (int j = 0; j < stride; j++)
                    {
                        result.Add(src.Data[chunks[i]*stride+j]);
                    }
                }
            }
            else {
                object[] array = new object[src.Length];
                Array.Copy(src.Data, 0, array, 0, src.Length);
                result = new LSL_List(array);
            }

            return result;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:73,代码来源:LSL_Api.cs


示例7: switch

        /// <summary>
        /// The supplied string is scanned for commas
        /// and converted into a list. Commas are only
        /// effective if they are encountered outside
        /// of '<' '>' delimiters. Any whitespace
        /// before or after an element is trimmed.
        /// </summary>

        public LSL_List llCSV2List(string src)
        {

            LSL_List result = new LSL_List();
            int parens = 0;
            int start  = 0;
            int length = 0;

            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            for (int i = 0; i < src.Length; i++)
            {
                switch (src[i])
                {
                    case '<':
                        parens++;
                        length++;
                        break;
                    case '>':
                        if (parens > 0)
                            parens--;
                        length++;
                        break;
                    case ',':
                        if (parens == 0)
                        {
                            result.Add(new LSL_String(src.Substring(start,length).Trim()));
                            start += length+1;
                            length = 0;
                        }
                        else
                        {
                            length++;
                        }
                        break;
                    default:
                        length++;
                        break;
                }
            }

            result.Add(src.Substring(start,length).Trim());

            return result;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:54,代码来源:LSL_Api.cs


示例8: aaQueryDatabase

        public LSL_List aaQueryDatabase(LSL_String key, LSL_String token)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AAQueryDatabase", m_host, "AA", m_itemID))
                return new LSL_List();

            List<string> query = AssetConnector.FindLSLData(token.m_string, key.m_string);
            LSL_List list = new LSL_List(query.ToArray());
            return list;
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:9,代码来源:AA_API.cs


示例9: aaSetEnv

 public void aaSetEnv(LSL_String name, LSL_List value)
 {
     if (name == ScriptBaseClass.ENABLE_GRAVITY)
     {
         LSL_Integer enabled = value.GetLSLIntegerItem(0);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(enabled == 1, grav[0], grav[1], grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_X)
     {
         LSL_Float f = value.GetLSLFloatItem(0);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, (float) f.value, grav[1], grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_Y)
     {
         LSL_Float f = value.GetLSLFloatItem(0);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], (float) f.value, grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_Z)
     {
         LSL_Float f = value.GetLSLFloatItem(0);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], grav[1], (float) f.value);
     }
     else if (name == ScriptBaseClass.ADD_GRAVITY_POINT)
     {
         LSL_Vector pos = value.GetVector3Item(0);
         LSL_Float gravForce = value.GetLSLFloatItem(1);
         LSL_Float radius = value.GetLSLFloatItem(2);
         LSL_Integer ident = value.GetLSLIntegerItem(3);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(false,
                                                                new Vector3((float) pos.x, (float) pos.y,
                                                                            (float) pos.z),
                                                                0, 0, 0, (float) gravForce.value,
                                                                (float) radius.value, ident.value);
     }
     else if (name == ScriptBaseClass.ADD_GRAVITY_FORCE)
     {
         LSL_Vector pos = value.GetVector3Item(0);
         LSL_Float xForce = value.GetLSLFloatItem(1);
         LSL_Float yForce = value.GetLSLFloatItem(2);
         LSL_Float zForce = value.GetLSLFloatItem(3);
         LSL_Float radius = value.GetLSLFloatItem(4);
         LSL_Integer ident = value.GetLSLIntegerItem(5);
         float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(true,
                                                                new Vector3((float) pos.x, (float) pos.y,
                                                                            (float) pos.z),
                                                                (float) xForce, (float) yForce, (float) zForce, 0,
                                                                (float) radius.value, ident.value);
     }
     else if (name == ScriptBaseClass.START_TIME_REVERSAL_SAVING)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
         if (physicsState != null)
             physicsState.StartSavingPhysicsTimeReversalStates();
     }
     else if (name == ScriptBaseClass.STOP_TIME_REVERSAL_SAVING)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
         if (physicsState != null)
             physicsState.StopSavingPhysicsTimeReversalStates();
     }
     else if (name == ScriptBaseClass.START_TIME_REVERSAL)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
         if (physicsState != null)
             physicsState.StartPhysicsTimeReversal();
     }
     else if (name == ScriptBaseClass.STOP_TIME_REVERSAL)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
         if (physicsState != null)
             physicsState.StopPhysicsTimeReversal();
     }
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:79,代码来源:AA_API.cs


示例10: aaSerializeXML

 public LSL_String aaSerializeXML(LSL_List keys, LSL_List values)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AASerializeXML", m_host, "AA", m_itemID))
         return new LSL_String();
     XmlDocument doc = new XmlDocument();
     for (int i = 0; i < keys.Length; i++)
     {
         string key = keys.GetLSLStringItem(i);
         string value = values.GetLSLStringItem(i);
         XmlNode node = doc.CreateNode(XmlNodeType.Element, key, "");
         node.InnerText = value;
         doc.AppendChild(node);
     }
     return new LSL_String(doc.OuterXml);
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:15,代码来源:AA_API.cs


示例11: aaDeserializeXMLValues

 public LSL_List aaDeserializeXMLValues(LSL_String xmlFile)
 {
     if (
         !ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AADeserializeXMLValues", m_host, "AA",
                                            m_itemID)) return new LSL_List();
     XmlDocument doc = new XmlDocument();
     doc.LoadXml(xmlFile.m_string);
     XmlNodeList children = doc.ChildNodes;
     LSL_List values = new LSL_List();
     foreach (XmlNode node in children)
     {
         values.Add(node.InnerText);
     }
     return values;
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:15,代码来源:AA_API.cs


示例12: llGetBoundingBox

        /// <summary>
        /// A partial implementation.
        /// http://lslwiki.net/lslwiki/wakka.php?wakka=llGetBoundingBox
        /// So far only valid for standing/flying/ground sitting avatars and single prim objects.
        /// If the object has multiple prims and/or a sitting avatar then the bounding
        /// box is for the root prim only.
        /// </summary>
        public LSL_List llGetBoundingBox(string obj)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            
            UUID objID = UUID.Zero;
            LSL_List result = new LSL_List();
            if (!UUID.TryParse(obj, out objID))
            {
                result.Add(new LSL_Vector());
                result.Add(new LSL_Vector());
                return result;
            }
            ScenePresence presence = World.GetScenePresence(objID);
            if (presence != null)
            {
                if (presence.ParentID == UUID.Zero) // not sat on an object
                {
                    LSL_Vector lower;
                    LSL_Vector upper;
                    if (presence.Animator.Animations.DefaultAnimation.AnimID 
                        == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
                    {
                        // This is for ground sitting avatars
                        float height = presence.Appearance.AvatarHeight / 2.66666667f;
                        lower = new LSL_Vector(-0.3375f, -0.45f, height * -1.0f);
                        upper = new LSL_Vector(0.3375f, 0.45f, 0.0f);
                    }
                    else
                    {
                        // This is for standing/flying avatars
                        float height = presence.Appearance.AvatarHeight / 2.0f;
                        lower = new LSL_Vector(-0.225f, -0.3f, height * -1.0f);
                        upper = new LSL_Vector(0.225f, 0.3f, height + 0.05f);
                    }
                    result.Add(lower);
                    result.Add(upper);
                    return result;
                }
                else
                {
                    // sitting on an object so we need the bounding box of that
                    // which should include the avatar so set the UUID to the
                    // UUID of the object the avatar is sat on and allow it to fall through
                    // to processing an object
                    SceneObjectPart p = World.GetSceneObjectPart(presence.ParentID);
                    objID = p.UUID;
                }
            }
            SceneObjectPart part = World.GetSceneObjectPart(objID);
            // Currently only works for single prims without a sitting avatar
            if (part != null)
            {
                Vector3 halfSize = part.Scale * 0.5f;
                LSL_Vector lower = new LSL_Vector(halfSize.X * -1.0f, halfSize.Y * -1.0f, halfSize.Z * -1.0f);
                LSL_Vector upper = new LSL_Vector(halfSize.X, halfSize.Y, halfSize.Z);
                result.Add(lower);
                result.Add(upper);
                return result;
            }

            // Not found so return empty values
            result.Add(new LSL_Vector());
            result.Add(new LSL_Vector());
            return result;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:72,代码来源:LSL_Api.cs


示例13: llGetLinkPrimitiveParams

        public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            
            
            List<SceneObjectPart> parts = GetLinkParts(linknumber);

            LSL_List res = new LSL_List();

            foreach (var part in parts)
            {
                LSL_List partRes = GetLinkPrimitiveParams(part, rules);
                res += partRes;
            }

            return res;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:17,代码来源:LSL_Api.cs


示例14: llLinkParticleSystem

        public void llLinkParticleSystem(int linknumber, LSL_List rules)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            List<SceneObjectPart> parts = GetLinkParts(linknumber);

            foreach (var part in parts)
            {
                SetParticleSystem(part, rules);
            }
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:12,代码来源:LSL_Api.cs


示例15: llParticleSystem

 public void llParticleSystem(LSL_List rules)
 {
     ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
     
     SetParticleSystem(m_host, rules);
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:6,代码来源:LSL_Api.cs


示例16: SetPrimParams

        protected void SetPrimParams(ISceneEntity part, LSL_List rules)
        {
            int idx = 0;

            while (idx < rules.Length)
            {
                int code = rules.GetLSLIntegerItem(idx++);

                int remain = rules.Length - idx;

                int face;
                LSL_Vector v;

                if (code == (int)ScriptBaseClass.PRIM_NAME)
                {
                    if (remain < 1)
                        return;

                    string name = rules.Data[idx++].ToString();
                    if (part is SceneObjectPart)
                        (part as SceneObjectPart).Name = name;
                }

                else if (code == (int)ScriptBaseClass.PRIM_DESC)
                {
                    if (remain < 1)
                        return;

                    string desc = rules.Data[idx++].ToString();
                    if (part is SceneObjectPart)
                        (part as SceneObjectPart).Description = desc;
                }

                else if (code == (int)ScriptBaseClass.PRIM_ROT_LOCAL)
                {
                    if (remain < 1)
                        return;
                    LSL_Rotation lr = rules.GetQuaternionItem(idx++);
                    if (part is SceneObjectPart)
                        SetRot((part as SceneObjectPart), Rot2Quaternion(lr));
                }

                else if (code == (int)ScriptBaseClass.PRIM_POSITION)
                {
                    if (remain < 1)
                        return;

                    v = rules.GetVector3Item(idx++);
                    if (part is SceneObjectPart)
                        SetPos(part as SceneObjectPart, v);
                    else if (part is ScenePresence)
                    {
                        (part as ScenePresence).OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
                        (part as ScenePresence).SendTerseUpdateToAllClients();
                    }
                }
                else if (code == (int)ScriptBaseClass.PRIM_SIZE)
                {
                    if (remain < 1)
                        return;


                    v = rules.GetVector3Item(idx++);
                    if (part is SceneObjectPart)
                        SetScale(part as SceneObjectPart, v);

                }
                else if (code == (int)ScriptBaseClass.PRIM_ROTATION)
                {
                    if (remain < 1)
                        return;

                    if (part is SceneObjectPart) { }
                    else return;

                    LSL_Rotation q = rules.GetQuaternionItem(idx++);
                    // try to let this work as in SL...
                    if ((part as SceneObjectPart).ParentID == 0)
                    {
                        // special case: If we are root, rotate complete SOG to new rotation
                        SetRot(part as SceneObjectPart, Rot2Quaternion(q));
                    }
                    else
                    {
                        // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
                        SceneObjectGroup group = (part as SceneObjectPart).ParentGroup;
                        if (group != null) // a bit paranoid, maybe
                        {
                            SceneObjectPart rootPart = group.RootPart;
                            if (rootPart != null) // again, better safe than sorry
                            {
                                SetRot((part as SceneObjectPart), rootPart.RotationOffset * Rot2Quaternion(q));
                            }
                        }
                    }

                }

                else if (code == (int)ScriptBaseClass.PRIM_TYPE)
                {
//.........这里部分代码省略.........
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:101,代码来源:LSL_Api.cs


示例17: SetParticleSystem

        private void SetParticleSystem(SceneObjectPart part, LSL_List rules)
        {
            if (rules.Length == 0)
            {
                part.RemoveParticleSystem();
                part.ParentGroup.HasGroupChanged = true;
            }
            else
            {
                Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
                LSL_Vector tempv = new LSL_Vector();

                float tempf = 0;

                for (int i = 0; i < rules.Length; i += 2)
                {
                    LSL_Integer rule = rules.GetLSLIntegerItem(i);
                    if (rule == (int)ScriptBaseClass.PSYS_PART_FLAGS)
                    {
                        prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_START_COLOR)
                    {
                        tempv = rules.GetVector3Item(i + 1);
                        prules.PartStartColor.R = (float)tempv.x;
                        prules.PartStartColor.G = (float)tempv.y;
                        prules.PartStartColor.B = (float)tempv.z;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_START_ALPHA)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.PartStartColor.A = tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_END_COLOR)
                    {
                        tempv = rules.GetVector3Item(i + 1);
                        prules.PartEndColor.R = (float)tempv.x;
                        prules.PartEndColor.G = (float)tempv.y;
                        prules.PartEndColor.B = (float)tempv.z;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_END_ALPHA)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.PartEndColor.A = tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_START_SCALE)
                    {
                        tempv = rules.GetVector3Item(i + 1);
                        prules.PartStartScaleX = (float)tempv.x;
                        prules.PartStartScaleY = (float)tempv.y;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_END_SCALE)
                    {
                        tempv = rules.GetVector3Item(i + 1);
                        prules.PartEndScaleX = (float)tempv.x;
                        prules.PartEndScaleY = (float)tempv.y;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_PART_MAX_AGE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.PartMaxAge = tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_ACCEL)
                    {
                        tempv = rules.GetVector3Item(i + 1);
                        prules.PartAcceleration.X = (float)tempv.x;
                        prules.PartAcceleration.Y = (float)tempv.y;
                        prules.PartAcceleration.Z = (float)tempv.z;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_PATTERN)
                    {
                        int tmpi = (int)rules.GetLSLIntegerItem(i + 1);
                        prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
                    }

                    // PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
                    // PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
                    // client tells the difference between the two by looking at the 0x02 bit in
                    // the PartFlags variable.
                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_INNERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.InnerAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.OuterAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
//.........这里部分代码省略.........
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:101,代码来源:LSL_Api.cs


示例18: llGetAnimationList

        public LSL_List llGetAnimationList(string id)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            LSL_List l = new LSL_List();
            ScenePresence av = World.GetScenePresence((UUID)id);
            if (av == null || av.IsChildAgent) // only if in the region
                return l;
            UUID[] anims;
            anims = av.Animator.GetAnimationArray();
            foreach (UUID foo in anims)
                l.Add(foo.ToString());
            return l;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:15,代码来源:LSL_Api.cs


示例19: llGiveInventoryList

        public void llGiveInventoryList(string destination, string category, LSL_List inventory)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            UUID destID;
            if (!UUID.TryParse(destination, out destID))
                return;

            List<UUID> itemList = new List<UUID>();

            foreach (Object item in inventory.Data)
            {
                UUID itemID;
                if (UUID.TryParse(item.ToString(), out itemID))
                {
                    itemList.Add(itemID);
                }
                else
                {
                    itemID = GetTaskInventoryItem(item.ToString());
                    if (itemID != UUID.Zero)
                        itemList.Add(itemID);
                }
            }

            if (itemList.Count == 0)
                return;
            UUID folderID = UUID.Zero;
            ILLClientInventory inventoryModule = World.RequestModuleInterface<ILLClientInventory>();
            if (inventoryModule != null)
                folderID = inventoryModule.MoveTaskInventoryItemsToUserInventory(destID, category, m_host, itemList);

            if (folderID == UUID.Zero)
                return;

            byte[] bucket = new byte[17];
            bucket[0] = (byte)AssetType.Folder;
            byte[] objBytes = folderID.GetBytes();
            Array.Copy(objBytes, 0, bucket, 1, 16);

            GridInstantMessage msg = new GridInstantMessage(World,
                    m_host.UUID, m_host.Name+", an object owned by "+
                    resolveName(m_host.OwnerID)+",", destID,
                    (byte)InstantMessageDialog.InventoryOffered,
                    false, category+"\n"+m_host.Name+" is located at "+
                    World.RegionInfo.RegionName+" "+
                    m_host.AbsolutePosition.ToString(),
                    folderID, true, m_host.AbsolutePosition,
                    bucket);

            if (m_TransferModule != null)
                m_TransferModule.SendInstantMessage(msg);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:54,代码来源:LSL_Api.cs


示例20: llGetPrimitiveParams

 public LSL_List llGetPrimitiveParams(LSL_List rules)
 {
     ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
     
     return GetLinkPrimitiveParams(m_host, rules);
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:6,代码来源:LSL_Api.cs



注:本文中的Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list类示例整理自


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AuthContext类代码示例发布时间:2022-05-24
下一篇:
C# LSL_Types.Vector3类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap