Changeset 1260 for code/branches/ogre/src/orxonox/objects
- Timestamp:
- May 12, 2008, 7:08:58 PM (17 years ago)
- Location:
- code/branches/ogre/src/orxonox/objects
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ogre/src/orxonox/objects/Explosion.cc
r1243 r1260 45 45 CreateFactory(Explosion); 46 46 47 Explosion::Explosion(WorldEntity* owner) 47 Explosion::Explosion(WorldEntity* owner) : 48 particle_(0), 49 lifetime_(0.4) 48 50 { 49 this->particle_ = 0;50 this->lifetime_ = 0.4;51 52 51 RegisterObject(Explosion); 53 52 -
code/branches/ogre/src/orxonox/objects/Model.cc
r1209 r1260 49 49 } 50 50 51 void Model::loadParams(TiXmlElement* xmlElem)52 {53 WorldEntity::loadParams(xmlElem);54 55 if (xmlElem->Attribute("mesh"))56 {57 meshSrc_ = xmlElem->Attribute("mesh");58 }59 create();60 }61 62 51 /** 63 52 @brief XML loading and saving. -
code/branches/ogre/src/orxonox/objects/Model.h
r1056 r1260 43 43 Model(); 44 44 virtual ~Model(); 45 virtual void loadParams(TiXmlElement* xmlElem);46 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 47 46 void setMesh(const std::string& meshname); -
code/branches/ogre/src/orxonox/objects/NPC.cc
r1056 r1260 36 36 CreateFactory(NPC); 37 37 38 NPC::NPC() 38 NPC::NPC() : 39 movable_(true) 39 40 { 40 41 RegisterObject(NPC); 41 movable_ = true;42 42 } 43 43 -
code/branches/ogre/src/orxonox/objects/Projectile.cc
r1056 r1260 42 42 CreateFactory(Projectile); 43 43 44 Projectile::Projectile(SpaceShip* owner) 44 Projectile::Projectile(SpaceShip* owner) : 45 owner_(owner) 45 46 { 46 47 RegisterObject(Projectile); 47 48 48 49 this->setConfigValues(); 49 50 this->owner_ = owner;51 50 52 51 this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1); -
code/branches/ogre/src/orxonox/objects/WorldEntity.cc
r1243 r1260 45 45 unsigned int WorldEntity::worldEntityCounter_s = 0; 46 46 47 WorldEntity::WorldEntity() 47 WorldEntity::WorldEntity() : 48 velocity_ (0, 0, 0), 49 acceleration_(0, 0, 0), 50 rotationAxis_(0, 1, 0), 51 rotationRate_(0), 52 momentum_ (0), 53 node_ (0), 54 bStatic_ (true) 48 55 { 49 this->bStatic_ = true;50 this->velocity_ = Vector3(0, 0, 0);51 this->acceleration_ = Vector3(0, 0, 0);52 this->rotationAxis_ = Vector3(0, 1, 0);53 this->rotationRate_ = 0;54 this->momentum_ = 0;55 56 56 RegisterObject(WorldEntity); 57 57 … … 64 64 65 65 registerAllVariables(); 66 }67 else68 {69 this->node_ = 0;70 66 } 71 67 } … … 92 88 BaseObject::loadParams(xmlElem); 93 89 create(); 94 /*95 if (xmlElem->Attribute("position"))96 {97 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");98 float x, y, z;99 String2Number<float>(x, pos[0]);100 String2Number<float>(y, pos[1]);101 String2Number<float>(z, pos[2]);102 this->setPosition(x, y, z);103 }104 105 if (xmlElem->Attribute("direction"))106 {107 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");108 float x, y, z;109 String2Number<float>(x, pos[0]);110 String2Number<float>(y, pos[1]);111 String2Number<float>(z, pos[2]);112 this->setDirection(x, y, z);113 }114 115 if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll"))116 {117 float yaw = 0.0, pitch = 0.0, roll = 0.0;118 if (xmlElem->Attribute("yaw"))119 String2Number<float>(yaw,xmlElem->Attribute("yaw"));120 121 if (xmlElem->Attribute("pitch"))122 String2Number<float>(pitch,xmlElem->Attribute("pitch"));123 124 if (xmlElem->Attribute("roll"))125 String2Number<float>(roll,xmlElem->Attribute("roll"));126 127 this->yaw(Degree(yaw));128 this->pitch(Degree(pitch));129 this->roll(Degree(roll));130 }131 132 if (xmlElem->Attribute("scale"))133 {134 std::string scaleStr = xmlElem->Attribute("scale");135 float scale;136 String2Number<float>(scale, scaleStr);137 this->setScale(scale);138 }139 140 if (xmlElem->Attribute("rotationAxis"))141 {142 std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");143 float x, y, z;144 String2Number<float>(x, pos[0]);145 String2Number<float>(y, pos[1]);146 String2Number<float>(z, pos[2]);147 this->setRotationAxis(x, y, z);148 }149 150 if (xmlElem->Attribute("rotationRate"))151 {152 float rotationRate;153 String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate"));154 this->setRotationRate(Degree(rotationRate));155 if (rotationRate != 0)156 this->setStatic(false);157 }158 159 create();160 */161 90 } 162 91
Note: See TracChangeset
for help on using the changeset viewer.