當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneObjectPart.UpdateExtraPhysics方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.UpdateExtraPhysics方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneObjectPart.UpdateExtraPhysics方法的具體用法?C# SceneObjectPart.UpdateExtraPhysics怎麽用?C# SceneObjectPart.UpdateExtraPhysics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.UpdateExtraPhysics方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetPhysicsMaterial

        private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
                float material_density, float material_friction,
                float material_restitution, float material_gravity_modifier)
        {
            ExtraPhysicsData physdata = new ExtraPhysicsData();
            physdata.PhysShapeType = (PhysShapeType)part.PhysicsShapeType;
            physdata.Density = part.Density;
            physdata.Friction = part.Friction;
            physdata.Bounce = part.Restitution;
            physdata.GravitationModifier = part.GravityModifier;

            if ((material_bits & (int)ScriptBaseClass.DENSITY) != 0)
                physdata.Density = material_density;
            if ((material_bits & (int)ScriptBaseClass.FRICTION) != 0)
                physdata.Friction = material_friction;
            if ((material_bits & (int)ScriptBaseClass.RESTITUTION) != 0)
                physdata.Bounce = material_restitution;
            if ((material_bits & (int)ScriptBaseClass.GRAVITY_MULTIPLIER) != 0)
                physdata.GravitationModifier = material_gravity_modifier;

            part.UpdateExtraPhysics(physdata);
        }
開發者ID:TomDataworks,項目名稱:opensim,代碼行數:22,代碼來源:LSL_Api.cs

示例2: SetPrimParams


//.........這裏部分代碼省略.........
                                 return null;

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

                             break;

                         case (int)ScriptBaseClass.PRIM_PHYSICS:
                            if (remain < 1)
                                 return null;
                             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_PHYSICS_SHAPE_TYPE:
                            if (remain < 1)
                                return null;

                            int shape_type = rules.GetLSLIntegerItem(idx++);

                            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 (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
                            if (remain < 1)
                                return null;
                            string temp = rules.Data[idx++].ToString();

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

                            break;

                        case (int)ScriptBaseClass.PRIM_TEXGEN:
                            if (remain < 2)
                                return null;
                                //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 null;
                            string primText = rules.GetLSLStringItem(idx++);
                            LSL_Vector primTextColor = rules.GetVector3Item(idx++);
                            LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
                            Vector3 av3 = Util.Clip(primTextColor, 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)
開發者ID:Barosonix,項目名稱:Barosonix-Core,代碼行數:67,代碼來源:LSL_Api.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.UpdateExtraPhysics方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。