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

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

FirstChildElement ("lightRange"); if (pElement) processLightRange (pElement, belägenhet);

//Process lightAttenuation pElement = XMLNode-> FirstChildElement ("lightAttenuation") (?); if (pElement) processLightAttenuation (pElement, belägenhet);

//Process userDataReference pElement = XMLNode-> FirstChildElement ("userDataReference") (?); if (pElement); //processUserDataReference (pElement, belägenhet);} Omdömen annullera DotSceneLoader :: processCamera (TiXmlElement * XMLNode, SceneNode * pParent) {//Process attribut String name = getAttrib (XMLNode, "namn"); String id = getAttrib (XMLNode, "id"); Real fov = getAttribReal (XMLNode "FOV", 45); Verklig aspectRatio = getAttribReal (XMLNode, "aspectRatio", 1,3333); String projectionType = getAttrib (XMLNode "projectionType", "perspektiv");

//Hitta en befintlig cmaera Kamera * pCamera = mSceneMgr-> getCamera (namn); if (pCamera == NULL) {//Skapa Kamera * pCamera = mSceneMgr-> createCamera (namn); if (pParent) pParent-> attachObject (pCamera); }

//Ställ in field-of-view //! todo Är det alltid i grader? pCamera-> setFOVy (Ogre :: Degree (FOV));

//Ställ in bildförhållande pCamera-> setAspectRatio (aspectRatio);

//Ställ typ projektion om (projectionType == "perspektiv") pCamera -> setProjectionType (PT_PERSPECTIVE); else if (projectionType == "ortografiska") pCamera-> setProjectionType (PT_ORTHOGRAPHIC);

TiXmlElement * pElement,

//Process klippning pElement = XMLNode-> FirstChildElement ("klippning") (?); if (pElement) {Real nearDist = getAttribReal (pElement, "nära"); pCamera-> setNearClipDistance (nearDist),

Real farDist = getAttribReal (pElement "långt"); pCamera-> setFarClipDistance (farDist); }

//Process ställning pElement = XMLNode-> FirstChildElement ("position") (?); if (pElement) pCamera-> setPosition (parseVector3 (pElement)), (?) Review //Process rotation pElement = XMLNode-> FirstChildElement ("rotation"); if (pElement) pCamera-> setOrientation (parseQuaternion (pElement));

pElement = XMLNode-> FirstChildElement ("lookAt"); if (pElement) pCamera-> lookAt (parseVector3 (pElement));

//Process normal pElement = XMLNode-> FirstChildElement ("normal") (?); if (pElement); //! //Process lookTarget pElement = XMLNode-> FirstChildElement ("lookTarget") (?); if (pElement); //! //Process trackTarget pElement = XMLNode-> FirstChildElement ("trackTarget") (?); if (pElement); //! //Process userDataReference pElement = XMLNode->

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.