예제 #1
0
 public SceneNode(SceneMesh pMesh, SceneProgram pProg, Vector3 nodePos, List<TextureBinding> texBindings)
 {
     m_pMesh = pMesh;
     m_pProg = pProg;
     m_texBindings = texBindings;
     m_nodeTm = new Transform();
     m_nodeTm.m_trans = nodePos;
 }
예제 #2
0
        private void ReadMesh(XmlElement meshNode)
        {
            string pNameNode = meshNode.GetAttribute("xml:id");
            string pFilenameNode = meshNode.GetAttribute("file");

            PARSE_THROW(pNameNode, "Mesh found with no `xml:id` name specified.");
            PARSE_THROW(pFilenameNode, "Mesh found with no `file` filename specified.");

            if (m_meshes.ContainsKey(pNameNode))
            {
                MessageBox.Show("The mesh named " + pNameNode + " already exists.");
            }

            string XmlFilesDirectory = GlsTutorialsClass.ProjectDirectory + @"/XmlFilesForMeshes";
            Stream fileStream = File.OpenRead(XmlFilesDirectory + @"/" + pFilenameNode);
            SceneMesh pMesh = new SceneMesh(fileStream);
            m_meshes.Add(pNameNode, pMesh);
        }