*   >> läser Utbildning artiklar >> science >> programming

Att göra en 3D-spel med Ogre - Laddar ett Scene

NextSiblingElement ("billboardSet"); }

//Process plan (*) pElement = XMLNode-> FirstChildElement ("plan"); while (pElement) {processPlane (pElement, pNode); pElement = pElement-> NextSiblingElement ("plan"); }

//Process userDataReference pElement = XMLNode-> FirstChildElement ("userDataReference") (?); if (pElement) processUserDataReference (pElement, pNode);} Omdömen annullera DotSceneLoader :: processLookTarget (TiXmlElement * XMLNode, SceneNode * pParent) {//! todo Är detta korrekt? För jag inte har en aning faktiskt Omdömen //Process attribut String nodename = getAttrib (XMLNode "nodename"),

Node :: TransformSpace relativeTo = Node :: TS_PARENT; String sValue = getAttrib (XMLNode, "relativeTo"); if (sValue == "lokal") relativeTo = Node :: TS_LOCAL; else if (sValue == "förälder") relativeTo = Node :: TS_PARENT; else if (sValue == "världen") relativeTo = Node :: TS_WORLD,

TiXmlElement * pElement,

//Process läge Vector3 läge (?); pElement = XMLNode-> FirstChildElement ("position"); if (pElement) läge = parseVector3 (pElement);

//Process localDirection Vector3 localDirection = Vector3 :: NEGATIVE_UNIT_Z (?); pElement = XMLNode-> FirstChildElement ("localDirection"); if (pElement) localDirection = parseVector3 (pElement);

//Setup utseendet målet try {if (nodeName.

empty ()!) {SceneNode * pLookNode = mSceneMgr-> getSceneNode (nodename); läge = pLookNode -> _ getDerivedPosition (); }

pParent-> lookAt (position, relativeTo, localDirection); } Catch (Ogre :: Undantag & /* e * /) {LogManager :: getSingleton () logMessage ("[DotSceneLoader] Fel bearbeta en titt mål!").

}}

annullera DotSceneLoader :: processTrackTarget (TiXmlElement * XMLNode, SceneNode * pParent) {//Process attribut String nodename = getAttrib (XMLNode "nodename");

TiXmlElement * pElement,

//Process localDirection Vector3 localDirection = Vector3 :: NEGATIVE_UNIT_Z (?); pElement = XMLNode-> FirstChildElement ("localDirection"); if (pElement) localDirection = parseVector3 (pElement);

//Process offset Vector3 offset = Vector3 :: ZERO (?); pElement = XMLNode-> FirstChildElement ("offset"); if (pElement) offset = parseVector3 (pElement);

//Setup spårmålet try {SceneNode * pTrackNode = mSceneMgr-> getSceneNode (nodename); pParent-> setAutoTracking (sant, pTrackNode, localDirection, offset); } Catc

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... >>  >> 
Copyright © 2008 - 2016 läser Utbildning artiklar,https://utbildning.nmjjxx.com All rights reserved.