当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectPart.ScriptSetPhysicsStatus方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.ScriptSetPhysicsStatus方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.ScriptSetPhysicsStatus方法的具体用法?C# SceneObjectPart.ScriptSetPhysicsStatus怎么用?C# SceneObjectPart.ScriptSetPhysicsStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.ScriptSetPhysicsStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetPrimParams


//.........这里部分代码省略.........
                             return;
                         face = rules.GetLSLIntegerItem(idx++);
                         bool st = rules.GetLSLIntegerItem(idx++);
                         SetFullBright(part, face , st);
                         break;

                     case (int)ScriptBaseClass.PRIM_MATERIAL:
                         if (remain < 1)
                             return;
                         int mat = rules.GetLSLIntegerItem(idx++);
                         if (mat < 0 || mat > 7)
                             return;

                         part.Material = Convert.ToByte(mat);
                         break;

                     case (int)ScriptBaseClass.PRIM_PHANTOM:
                        if (remain < 1)
                             return;

                         string ph = rules.Data[idx++].ToString();
                         bool phantom;

                         if (ph.Equals("1"))
                             phantom = true;
                         else
                             phantom = false;

                         part.ScriptSetPhantomStatus(phantom);
                         break;

                     case (int)ScriptBaseClass.PRIM_PHYSICS:
                        if (remain < 1)
                             return;
                         string phy = rules.Data[idx++].ToString();
                         bool physics;

                         if (phy.Equals("1"))
                             physics = true;
                         else
                             physics = false;

                         part.ScriptSetPhysicsStatus(physics);
                         break;

                    case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
                        if (remain < 1)
                            return;
                        string temp = rules.Data[idx++].ToString();
                        bool tempOnRez;

                        if (temp.Equals("1"))
                            tempOnRez = true;
                        else
                            tempOnRez = false;

                        part.ScriptSetTemporaryStatus(tempOnRez);
                        break;

                    case (int)ScriptBaseClass.PRIM_TEXGEN:
                        if (remain < 2)
                            return;
                            //face,type
                        face = rules.GetLSLIntegerItem(idx++);
                        int style = rules.GetLSLIntegerItem(idx++);
                        SetTexGen(part, face, style);
                        break;
                    case (int)ScriptBaseClass.PRIM_TEXT:
                        if (remain < 3)
                            return;
                        string primText = rules.GetLSLStringItem(idx++);
                        LSL_Vector primTextColor = rules.GetVector3Item(idx++);
                        LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
                        Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
                                      Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
                                      Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
                        part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));

                        break;
                    case (int)ScriptBaseClass.PRIM_NAME:
                        if (remain < 1)
                            return;
                        string primName = rules.GetLSLStringItem(idx++);
                        part.Name = primName;
                        break;
                    case (int)ScriptBaseClass.PRIM_DESC:
                        if (remain < 1)
                            return;
                        string primDesc = rules.GetLSLStringItem(idx++);
                        part.Description = primDesc;
                        break;
                    case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
                        if (remain < 1)
                            return;
                        LSL_Rotation lr = rules.GetQuaternionItem(idx++);
                        SetRot(part, Rot2Quaternion(lr));
                        break;
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:101,代码来源:LSL_Api.cs

示例2: SetPrimParams


//.........这里部分代码省略.........
                             SetFullBright(part, face , st);
                             break;

                         case (int)ScriptBaseClass.PRIM_MATERIAL:
                             if (remain < 1)
                                 return;
                             int mat = rules.GetLSLIntegerItem(idx++);
                             if (mat < 0 || mat > 7)
                                 return;

                             part.Material = Convert.ToByte(mat);
                             break;

                         case (int)ScriptBaseClass.PRIM_PHANTOM:
                             if (remain < 1)
                                 return;

                             string ph = rules.Data[idx++].ToString();
                             m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));

                             break;

                         case (int)ScriptBaseClass.PRIM_PHYSICS:
                            if (remain < 1)
                                 return;
                             string phy = rules.Data[idx++].ToString();
                             bool physics;

                             if (phy.Equals("1"))
                                 physics = true;
                             else
                                 physics = false;

                             part.ScriptSetPhysicsStatus(physics);
                             break;

                        case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
                            if (remain < 1)
                                return;
                            string temp = rules.Data[idx++].ToString();

                            m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));

                            break;

                        case (int)ScriptBaseClass.PRIM_TEXGEN:
                            if (remain < 2)
                                return;
                                //face,type
                            face = rules.GetLSLIntegerItem(idx++);
                            int style = rules.GetLSLIntegerItem(idx++);
                            SetTexGen(part, face, style);
                            break;
                        case (int)ScriptBaseClass.PRIM_TEXT:
                            if (remain < 3)
                                return;
                            string primText = rules.GetLSLStringItem(idx++);
                            LSL_Vector primTextColor = rules.GetVector3Item(idx++);
                            LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
                            Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
                                          Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
                                          Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
                            part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));

                            break;
                        case (int)ScriptBaseClass.PRIM_NAME:
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:67,代码来源:LSL_Api.cs

示例3: SetPrimParams


//.........这里部分代码省略.........
                        case ScriptBaseClass.PRIM_MATERIAL:
                            if (remain < 1)
                                return new LSL_List();
                            int mat;

                            try
                            {
                                mat = rules.GetLSLIntegerItem(idx++);
                            }
                            catch(InvalidCastException)
                            {
                               Error(originFunc, string.Format("Error running rule #{0} -> PRIM_MATERIAL: arg #{1} - parameter 2 must be integer", rulesParsed, idx - idxStart - 1));
                               return new LSL_List();
                            }
                            if (mat < 0 || mat > 7)
                                return new LSL_List();

                            part.Material = Convert.ToByte(mat);
                            break;

                        case ScriptBaseClass.PRIM_PHANTOM:
                            if (remain < 1)
                                return new LSL_List();

                            string ph = rules.Data[idx++].ToString();
                            part.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));

                            break;

                        case ScriptBaseClass.PRIM_PHYSICS:
                           if (remain < 1)
                                return new LSL_List();
                            string phy = rules.Data[idx++].ToString();
                            part.ScriptSetPhysicsStatus(phy.Equals("1"));
                            break;

                        case ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE:
                            if (remain < 1)
                                return new LSL_List();

                            int shape_type;

                            try
                            {
                                shape_type = rules.GetLSLIntegerItem(idx++);
                            }
                            catch(InvalidCastException)
                            {
                                Error(originFunc, string.Format("Error running rule #{0} -> PRIM_PHYSICS_SHAPE_TYPE: arg #{1} - parameter 2 must be integer", rulesParsed, idx - idxStart - 1));
                                return new LSL_List();
                            }

                            ExtraPhysicsData physdata = new ExtraPhysicsData();
                            physdata.Density = part.Density;
                            physdata.Bounce = part.Restitution;
                            physdata.GravitationModifier = part.GravityModifier;
                            physdata.PhysShapeType = (PhysShapeType)shape_type;

                            part.UpdateExtraPhysics(physdata);

                            break;

                        case ScriptBaseClass.PRIM_TEMP_ON_REZ:
                            if (remain < 1)
                                return new LSL_List();
                            string temp = rules.Data[idx++].ToString();
开发者ID:Gitlab11,项目名称:opensim,代码行数:67,代码来源:LSL_Api.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.ScriptSetPhysicsStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。