*   >> Lectura Educación Artículos >> science >> programación

Hacer un juego en 3D con Ogre - Carga de un Scene

getRootSceneNode ();

//Procesar la escena processScene (XmlRoot);

//Cerrar el archivo XML borrar XMLDoc;}

anular DotSceneLoader :: processScene (TiXmlElement * XmlRoot) {//Proceso de la escena parámetros de cadena version = getAttrib (XmlRoot "formatVersion", "desconocido");

mensaje String = "[DotSceneLoader] analizar el archivo dotScene con la versión" + versión; (XMLRoot-> () atributo "id") mensaje si + = "id" + String (XMLRoot-> Atributo ("ID")); mensaje si (XMLRoot-> Atributo ("SceneManager")) + = ", gerente de escena" + String (XMLRoot-> Atributo ("SceneManager")); si (XMLRoot-> Atributo ("minOgreVersion")) + message = ", mín versión Ogre.

" + String (XMLRoot-> Atributo ("minOgreVersion")); si (XMLRoot-> Atributo ("autor")) + message = ", autor" + String (XMLRoot-> Atributo ("autor"));

LogManager :: getSingleton () logMessage (mensaje);.
TiXmlElement * pElement; nodos

//Proceso pElement = XMLRoot-> FirstChildElement ("nodos") (?); if (pElement) processNodes (pElement); (?) externals

//Proceso pElement = XMLRoot-> FirstChildElement ("externos"); if (pElement) processExternals (pElement); (?)

//ambiente Proceso pElement = XMLRoot-> FirstChildElement ("medio ambiente"); si (pElement) processEnvironment (pElement); (?)

//terreno Proceso pElement = XMLRoot-> FirstChildElement ("terreno"); si (pElement) processTerrain (pElement);

//userDataReference Proceso pElement = XMLRoot-> FirstChildElement ("userDataReference") (?); si (pElement) processUserDataReference (pElement); (?)

//octree Proceso pElement = XMLRoot-> FirstChildElement ("octree"); si (pElement) processOctree (pElement);

//luz Proceso pElement = XMLRoot-> FirstChildElement ("luz") (?); si (pElement) processLight (pElement); (?)

//cámara Proceso pElement = XMLRoot-> FirstChildElement ("cámara"); si (pElement) processCamera (pElement);}

anular DotSceneLoader :: processNodes (TiXmlElement * XMLNode) {TiXmlElement * pElement;

//nodo Proceso (*) pElement = XMLNode-> FirstChildElement ("nodo"); while (pElement) {processNode (pElement); pElement = pElement-> NextSiblingElement ("nodo"); } //

posición Proceso pElement = XMLNode-> FirstChildElement ("posición") (?); si (pElement) {mAttachNode-> setPosition (parseVector3 (pElement)); mAttachNode-> setInitialState (); } //

rotación Proceso pElement = XMLNode-> FirstChildElement ("rotación") (?); si (pElement) {mAttachNode-> setOrientation (parseQuaternion (pElement)); mAttachNode->

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... >>  >> 
Copyright © 2008 - 2016 Lectura Educación Artículos,https://lectura.nmjjxx.com All rights reserved.