Changeset 580 for code/branches
- Timestamp:
- Dec 17, 2007, 4:27:41 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/bin/levels/sample.oxw
r579 r580 26 26 <Skybox src="Orxonox/StarfieldSkyBox" /> 27 27 28 <BaseEntity name="ASSF" src="assf2.mesh" node="OgreHeadNode" />29 28 <SceneNode name="ShipNode" pos="0,0,0" node="OgreHeadNode" scale="10,10,10" yaw="-90" pitch="-90" /> 29 <BaseEntity name="TheShip" src="assf2.mesh" node="ShipNode" /> 30 30 31 31 <SceneNode name="node1" pos="0,200,0" /> -
code/branches/FICN/src/orxonox/objects/BaseEntity.cc
r567 r580 31 31 mesh_ = xmlElem->Attribute("src"); 32 32 std::string node = xmlElem->Attribute("node"); 33 34 // get the node 35 this->setNode(Orxonox::getSingleton()->getSceneManager()->getSceneNode(node)); 36 33 37 34 38 // register variables to be synchronised … … 54 58 Ogre::Entity* entity = mgr->createEntity(name_, mesh_); 55 59 56 Ogre::MovableObject *ent = (Ogre::MovableObject *)entity;57 getNode()->attachObject(ent ); // big problem here: sigsegv60 //Ogre::MovableObject *ent = (Ogre::MovableObject *)entity; 61 getNode()->attachObject(entity); // big problem here: sigsegv 58 62 return true; 59 63 } -
code/branches/FICN/src/orxonox/objects/SceneNode.cc
r560 r580 37 37 String2Number<float>(z, pos[2]); 38 38 39 float sx = 1, sy = 1, sz = 1; 40 if (xmlElem->Attribute("scale")) 41 { 42 pos = tokenize(xmlElem->Attribute("scale"),","); 43 String2Number<float>(sx, pos[0]); 44 String2Number<float>(sy, pos[1]); 45 String2Number<float>(sz, pos[2]); 46 } 39 47 40 mgr->getRootSceneNode()->createChildSceneNode(name, Vector3(x,y,z)); 48 float yaw = 0.0; 49 if (xmlElem->Attribute("yaw")) 50 { 51 String2Number<float>(yaw,xmlElem->Attribute("yaw")); 52 } 53 float pitch = 0.0; 54 if (xmlElem->Attribute("pitch")) 55 { 56 String2Number<float>(pitch,xmlElem->Attribute("pitch")); 57 } 58 float roll = 0.0; 59 if (xmlElem->Attribute("roll")) 60 { 61 String2Number<float>(roll,xmlElem->Attribute("roll")); 62 } 63 64 Ogre::SceneNode *parentNode; 65 if (xmlElem->Attribute("node")) 66 parentNode = mgr->getSceneNode(xmlElem->Attribute("node")); 67 else 68 parentNode = mgr->getRootSceneNode(); 69 70 Ogre::SceneNode* node = parentNode->createChildSceneNode(name, Vector3(x,y,z)); 71 node->scale(sx,sy,sz); 72 node->yaw(Ogre::Degree(yaw)); 73 node->pitch(Ogre::Degree(pitch)); 74 node->roll(Ogre::Degree(roll)); 41 75 42 76 COUT(4) << "Loader: Created node "<< name <<" : "<<x<<" " << y << " " << z << std::endl << std::endl; -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r576 r580 50 50 name << (WorldEntity::worldEntityCounter_s++); 51 51 this->setName("WorldEntity" + name.str()); 52 node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 52 // don't set the node yet! 53 //node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 53 54 std::cout << "blubbbi: " << this->getName() << " .. " << this->node_ << std::endl; 54 55 } -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r576 r580 22 22 inline Ogre::SceneNode* getNode() 23 23 { return this->node_; } 24 25 inline void setNode(Ogre::SceneNode* node) 26 { this->node_ = node; } 24 27 25 28 inline void setPosition(const Vector3& pos)
Note: See TracChangeset
for help on using the changeset viewer.