Exemple #1
0
        protected override void fireDown()
        {
            MetaModel curModel = new MetaModel(Scene);

            curModel.Materials = template.materials;
            curModel.Meshes = template.meshes;
            curModel.PhysBoxes = template.pmeshes;
            curModel.volume.AffectionRadius = template.volumeRadius;

            curModel.Position = ghost.Position;

            curModel.setName(Scene.getUniqueName());
        }
Exemple #2
0
        protected void genericLoad(ref XmlTextReader reader, string type)
        {
            if (reader.Name == PhysModel.nodename)
            {
                string childname = scene.getUniqueName();

                while (reader.MoveToNextAttribute())
                {
                    if (reader.Name == "name")
                        childname = reader.Value;
                }

                GameObject child = new PhysModel(this);
                child.Name = childname;
                child.load(ref reader, "pmodel");
            }

            if (reader.Name == AnimatedModel.nodename)
            {
                string childname = scene.getUniqueName();

                while (reader.MoveToNextAttribute())
                {
                    if (reader.Name == "name")
                        childname = reader.Value;
                }

                GameObject child = new AnimatedModel(this);
                child.Name = childname;
                child.load(ref reader, "animodel");
            }

            if (reader.Name == MetaModel.nodename)
            {
                string childname = scene.getUniqueName();

                while (reader.MoveToNextAttribute())
                {
                    if (reader.Name == "name")
                        childname = reader.Value;
                }

                GameObject child = new MetaModel(this);
                child.Name = childname;
                child.load(ref reader, "metamodel");
            }

            if (reader.Name == LightSpot.nodename)
            {
                string childname = scene.getUniqueName();

                while (reader.MoveToNextAttribute())
                {
                    if (reader.Name == "name")
                        childname = reader.Value;
                }

                GameObject child = new LightSpot(this);
                child.Name = childname;
                child.load(ref reader, "lamp");
            }

            if (reader.Name == "position" && reader.NodeType != XmlNodeType.EndElement)
            {
                reader.Read();
                Position = GenericMethods.VectorFromString(reader.Value);
            }

            if (reader.Name == "direction" && reader.NodeType != XmlNodeType.EndElement)
            {
                reader.Read();
                PointingDirection = GenericMethods.VectorFromString(reader.Value);
            }

            if (reader.Name == "color" && reader.NodeType != XmlNodeType.EndElement)
            {
                reader.Read();
                Color = new Vector4(GenericMethods.VectorFromString(reader.Value),1);
            }

            if (reader.Name == "rotation" && reader.NodeType != XmlNodeType.EndElement)
            {
                reader.Read();
                Orientation = GenericMethods.ToOpenTKMatrix(GenericMethods.JMatrixFromString(reader.Value));
            }
        }