Ejemplo n.º 1
0
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("Name")) != parameters.End())
            {
                this.name = ni.Value;
            }

            if ((ni = parameters.Find("Position")) != parameters.End())
            {
                this.position = Mogre.StringConverter.ParseVector3(ni.Value);
            }

            if ((ni = parameters.Find("Orientation")) != parameters.End())
            {
                this.orientation = Mogre.StringConverter.ParseQuaternion(ni.Value);
            }

            if ((ni = parameters.Find("ClipDistance")) != parameters.End())
            {
                this.clipDistance = MogreX.StringConverter.ParseVector2(ni.Value);
            }

            if ((ni = parameters.Find("FOV")) != parameters.End())
            {
                this.fov = Mogre.StringConverter.ParseReal(ni.Value);
            }
        }
Ejemplo n.º 2
0
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("Name")) != parameters.End())
            {
                this.name = ni.Value;
            }

            if ((ni = parameters.Find("Position")) != parameters.End())
            {
                this.position = Mogre.StringConverter.ParseVector3(ni.Value);
            }

            if ((ni = parameters.Find("Orientation")) != parameters.End())
            {
                this.orientation = Mogre.StringConverter.ParseQuaternion(ni.Value);
            }

            if ((ni = parameters.Find("Scale")) != parameters.End())
            {
                this.scale = Mogre.StringConverter.ParseVector3(ni.Value);
            }

            if ((ni = parameters.Find("AutoTrackTarget")) != parameters.End())
            {
                this.autoTrackTarget = ni.Value;
            }
        }
Ejemplo n.º 3
0
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("Name")) != parameters.End())
            {
                this.name = ni.Value;
            }
        }
        public BaseEditor CreateEditorObject(BaseEditor parent, string objectTypeString, Mogre.NameValuePairList param, bool addToTreeList, bool display)
        {
            if (parent == null)
            {
                Mogre.NameValuePairList.Iterator ni;
                if ((ni = param.Find("ParentNode")) != param.End())
                {
                    parent = FindObject(ni.Value, 0);
                }

                if (parent == null)
                {
                    if (SceneManager == null)
                    {
                        parent = this.rootEditor;
                    }
                    else
                    {
                        parent = SceneManagerEditor;
                    }
                }
            }

            BaseEditorFactory factory = GetEditorObjectFactory(objectTypeString);

            if (factory == null)
            {
                return(null);
            }

            BaseEditor obj = factory.CreateObject(ref parent, param);

            if (obj == null)
            {
                return(null);
            }

            RegisterObjectName(obj.Name, obj);

            parent.AddChild(obj);

            if (addToTreeList)
            {
                object handle = this.system.InsertTreeItem(parent.TreeItemHandle, obj.Name, obj.ObjectTypeID, System.Windows.Media.Colors.Black);
                obj.TreeItemHandle = handle;
            }

            if (display)
            {
                obj.Load();
                obj.UpdateTreeView();
            }

            IsSceneModified = true;
            return(obj);
        }
Ejemplo n.º 5
0
        public override BaseEditor CreateObject(ref BaseEditor parent, Mogre.NameValuePairList parameters)
        {
            EntityEditor editor = new EntityEditor();

            if (parameters.Find("MeshFile") == parameters.End())
            {
                parameters["MeshFile"] = "scbCamera.mesh";
            }

            if (parameters.Find("Init") != parameters.End())
            {
                string entName = Path.GetFileNameWithoutExtension(parameters["MeshFile"]);
                parameters["Name"] = entName + MogitorsRoot.Instance.CreateUniqueID(entName, "", -1);
            }

            editor.ProcessParameters(parameters);
            editor.Parent = parent;

            InstanceCount++;
            return(editor);
        }
Ejemplo n.º 6
0
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            base.ProcessParameters(parameters);

            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("MeshFile")) != parameters.End())
            {
                this.meshFile = ni.Value;
            }

            if ((ni = parameters.Find("CastShadows")) != parameters.End())
            {
                this.castShadows = Mogre.StringConverter.ParseBool(ni.Value);
            }

            foreach (KeyValuePair <string, string> param in parameters)
            {
                if (!param.Key.StartsWith("SubEntity"))
                {
                    continue;
                }

                string valStr = param.Key;
                valStr = valStr.Remove(0, 9);

                if (valStr.EndsWith("Visible"))
                {
                    valStr = valStr.Remove(valStr.Length - 8, 8);
                    int ID = Mogre.StringConverter.ParseInt(valStr);
                    GetSubMesh(ID).Visible = Mogre.StringConverter.ParseBool(param.Value);
                }
                else if (valStr.EndsWith("Material"))
                {
                    valStr = valStr.Remove(valStr.Length - 9, 9);
                    int ID = Mogre.StringConverter.ParseInt(valStr);
                    GetSubMesh(ID).Material = param.Value;
                }
            }
        }
Ejemplo n.º 7
0
        public override BaseEditor CreateObject(ref BaseEditor parent, Mogre.NameValuePairList parameters)
        {
            CameraEditor obj = new CameraEditor();

            Mogre.NameValuePairList.Iterator ni;
            if ((ni = parameters.Find("Init")) != parameters.End())
            {
                parameters["Name"] = "Camera" + MogitorsRoot.Instance.CreateUniqueID("Camera", "", -1);
            }

            obj.ProcessParameters(parameters);
            obj.Parent = parent;

            InstanceCount++;
            return(obj);
        }
Ejemplo n.º 8
0
        public override BaseEditor CreateObject(ref BaseEditor parent, Mogre.NameValuePairList parameters)
        {
            MaterialEditor obj = new MaterialEditor();

            Mogre.NameValuePairList.Iterator ni;
            if ((ni = parameters.Find("Init")) != parameters.End())
            {
                parameters["Name"] = "Material" + MogitorsRoot.Instance.CreateUniqueID("Material", "", 1);
            }

            obj.ProcessParameters(parameters);
            parent     = MogitorsRoot.Instance.SceneManagerEditor;
            obj.Parent = parent;

            InstanceCount++;
            return(obj);
        }
Ejemplo n.º 9
0
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("Name")) != parameters.End())
            {
                this.name = ni.Value;
            }

            if ((ni = parameters.Find("SkyBoxMaterial")) != parameters.End())
            {
                this.skyBoxMaterial = ni.Value;
            }

            if ((ni = parameters.Find("Ambient")) != parameters.End())
            {
                this.ambient = Mogre.StringConverter.ParseColourValue(ni.Value);
            }

            if ((ni = parameters.Find("FogColour")) != parameters.End())
            {
                this.fogColour = Mogre.StringConverter.ParseColourValue(ni.Value);
            }

            if ((ni = parameters.Find("SkyBoxActive")) != parameters.End())
            {
                this.skyBoxActive = Mogre.StringConverter.ParseBool(ni.Value);
            }

            if ((ni = parameters.Find("SkyBoxDistance")) != parameters.End())
            {
                this.skyBoxDistance = Mogre.StringConverter.ParseReal(ni.Value);
            }

            if ((ni = parameters.Find("FogStart")) != parameters.End())
            {
                this.fogStart = Mogre.StringConverter.ParseReal(ni.Value);
            }

            if ((ni = parameters.Find("FogEnd")) != parameters.End())
            {
                this.fogEnd = Mogre.StringConverter.ParseReal(ni.Value);
            }

            if ((ni = parameters.Find("FogDensity")) != parameters.End())
            {
                this.fogDensity = Mogre.StringConverter.ParseReal(ni.Value);
            }

            if ((ni = parameters.Find("FogMode")) != parameters.End())
            {
                string val = ni.Value.ToLower();
                if (val == "none")
                {
                    this.fogMode = Mogre.FogMode.FOG_NONE;
                }
                else if (val == "linear")
                {
                    this.fogMode = Mogre.FogMode.FOG_LINEAR;
                }
                else if (val == "exp")
                {
                    this.fogMode = Mogre.FogMode.FOG_EXP;
                }
                else if (val == "exp2")
                {
                    this.fogMode = Mogre.FogMode.FOG_EXP2;
                }
            }
        }