Exemplo n.º 1
0
        private void LoadRoomModels(string filePath)
        {
            // Search the bmd and bdl folders for valid model names. Then search for a matching brk and btk for those models.
            string[] modelNames  = new[] { "model", "model1", "model2", "model3" };
            string[] folderNames = new[] { "bmd", "bdl" };
            bool[]   validModels = new bool[modelNames.Length];

            CategoryDOMNode col_category = new CategoryDOMNode("Models", m_world);

            col_category.SetParent(this);

            foreach (var subFolder in folderNames)
            {
                string folderPath = Path.Combine(filePath, subFolder);
                foreach (var modelName in modelNames)
                {
                    J3D mesh = LoadModel(folderPath, modelName);
                    if (mesh != null)
                    {
                        J3DNode j3d_node = new J3DNode(mesh, m_world);
                        j3d_node.SetParent(col_category);
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected virtual void LoadLevelCollisionFromFile(string filePath)
        {
            if (!File.Exists(filePath))
            {
                return;
            }

            CategoryDOMNode col_category = new CategoryDOMNode("Collision", m_world);

            col_category.SetParent(this);

            WCollisionMesh collision = new WCollisionMesh(m_world, filePath);

            collision.SetParent(col_category);
        }
Exemplo n.º 3
0
        public override void Load(string filePath)
        {
            base.Load(filePath);

            foreach (var folder in Directory.GetDirectories(filePath))
            {
                string folderName = Path.GetFileNameWithoutExtension(folder);
                switch (folderName.ToLower())
                {
                case "dzs":
                {
                    string fileName = Path.Combine(folder, "stage.dzs");
                    if (File.Exists(fileName))
                    {
                        LoadLevelEntitiesFromFile(fileName);
                    }
                }
                break;

                //case "bmd":
                case "bdl":
                {
                    LoadStageModels(folder);
                }
                break;

                case "dat":
                {
                    string fileName = Path.Combine(folder, "event_list.dat");
                    if (File.Exists(fileName))
                    {
                        WEventList evlist = new WEventList(m_world, fileName);

                        CategoryDOMNode evCategory = new CategoryDOMNode("Event List", m_world);
                        evCategory.SetParent(this);

                        evlist.SetParent(evCategory);
                    }
                }
                break;
                }
            }
        }
Exemplo n.º 4
0
        private void LoadStageModels(string filepath)
        {
            m_skybox = new WSkyboxNode(m_world);
            m_skybox.LoadSkyboxModelsFromFixedModelList(filepath);
            m_skybox.SetParent(this);

            CategoryDOMNode meshCategory = new CategoryDOMNode("Models", m_world);

            meshCategory.SetParent(this);

            string[] files = Directory.GetFiles(filepath, "*.bdl");

            foreach (string str in files)
            {
                J3D mesh = LoadModel(filepath, Path.GetFileNameWithoutExtension(str));
                if (mesh != null)
                {
                    J3DNode j3d_node = new J3DNode(mesh, m_world, str);
                    j3d_node.IsRendered = false;
                    j3d_node.SetParent(meshCategory);
                }
            }
        }