Exemple #1
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;
                }
            }
        }
Exemple #2
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;
        }
Exemple #3
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;
        }
Exemple #4
0
        public override BaseEditor CreateObject(ref BaseEditor parent, Mogre.NameValuePairList parameters)
        {
            LightEditor obj = new LightEditor();

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

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

            InstanceCount++;
            return obj;
        }
        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("Name")) != parameters.End())
                this.name = ni.Value;
        }
        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;
        }
        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;
            }
        }
        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("Dimensions")) != parameters.End())
                this.dimensions = MogreX.StringConverter.ParseVector4(ni.Value);

            if ((ni = parameters.Find("Skies")) != parameters.End())
                this.skies = Mogre.StringConverter.ParseBool(ni.Value);

            if ((ni = parameters.Find("Shadows")) != parameters.End())
                this.shadows = Mogre.StringConverter.ParseBool(ni.Value);

            if ((ni = parameters.Find("Overlays")) != parameters.End())
                this.overlays = Mogre.StringConverter.ParseBool(ni.Value);

            if ((ni = parameters.Find("CamPosition")) != parameters.End())
                this.camPosition = Mogre.StringConverter.ParseVector3(ni.Value);

            if ((ni = parameters.Find("CamOrientation")) != parameters.End())
                this.camOrientation = Mogre.StringConverter.ParseQuaternion(ni.Value);

            if ((ni = parameters.Find("CamClipDistance")) != parameters.End())
                this.camClipDistance = MogreX.StringConverter.ParseVector2(ni.Value);

            if ((ni = parameters.Find("CamPolyMode")) != parameters.End())
            {
                this.camPolyMode = (Mogre.PolygonMode)Mogre.StringConverter.ParseInt(ni.Value);
                OnPropertyChanged("CamPolyMode");
            }

            if ((ni = parameters.Find("CamFOV")) != parameters.End())
                this.camFOV = Mogre.StringConverter.ParseReal(ni.Value);

            if ((ni = parameters.Find("Colour")) != parameters.End())
                this.colour = Mogre.StringConverter.ParseColourValue(ni.Value);

            this.compositorStorage.Clear();
            for (int cx = 0; cx < 100; ++cx)
            {
                string searchstr = "Compositor" + Mogre.StringConverter.ToString(cx);
                if ((ni = parameters.Find(searchstr + "Name")) != parameters.End())
                {
                    CompositorPush compData = new CompositorPush();
                    compData.Name = ni.Value;
                    ni = parameters.Find(searchstr + "Enabled");
                    compData.Enabled = Mogre.StringConverter.ParseBool(ni.Value);
                    this.compositorStorage.Add(compData);
                }
                else
                    break;
            }
        }
Exemple #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("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);
        }