Changeset 1263 for code/branches/merge/src/orxonox/objects
- Timestamp:
- May 13, 2008, 3:45:19 PM (17 years ago)
- Location:
- code/branches/merge/src/orxonox/objects
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/merge/src/orxonox/objects/Explosion.cc
r1056 r1263 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 51 RegisterObject(Explosion); 50 51 this->particle_ = 0;52 this->lifetime_ = 0.4;53 52 54 53 if (owner) -
code/branches/merge/src/orxonox/objects/Model.cc
r1209 r1263 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/merge/src/orxonox/objects/Model.h
r1056 r1263 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/merge/src/orxonox/objects/NPC.cc
r1056 r1263 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/merge/src/orxonox/objects/Projectile.cc
r1056 r1263 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/merge/src/orxonox/objects/SpaceShip.cc
r1219 r1263 64 64 SpaceShip::SpaceShip() 65 65 { 66 RegisterObject(SpaceShip);67 this->registerAllVariables();68 69 66 SpaceShip::instance_s = this; 70 71 this->setConfigValues();72 67 73 68 this->setMouseEventCallback_ = false; … … 139 134 // this->create(); 140 135 136 RegisterObject(SpaceShip); 137 this->registerAllVariables(); 138 this->setConfigValues(); 141 139 142 140 COUT(3) << "Info: SpaceShip was loaded" << std::endl; … … 166 164 void SpaceShip::init() 167 165 { 166 if (!setMouseEventCallback_) 167 { 168 InputManager::addMouseHandler(this, "SpaceShip"); 169 setMouseEventCallback_ = true; 170 } 171 168 172 // START CREATING THRUSTER 169 173 this->tt_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); … … 428 432 void SpaceShip::tick(float dt) 429 433 { 430 if (!setMouseEventCallback_)431 {432 InputManager::addMouseHandler(this, "SpaceShip");433 setMouseEventCallback_ = true;434 }435 436 434 if (this->redNode_ && this->greenNode_) 437 435 { -
code/branches/merge/src/orxonox/objects/WorldEntity.cc
r1209 r1263 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 56 RegisterObject(WorldEntity); 50 51 //create();52 53 this->bStatic_ = true;54 this->velocity_ = Vector3(0, 0, 0);55 this->acceleration_ = Vector3(0, 0, 0);56 this->rotationAxis_ = Vector3(0, 1, 0);57 this->rotationRate_ = 0;58 this->momentum_ = 0;59 57 60 58 if (GraphicsEngine::getSingleton().getSceneManager()) … … 66 64 67 65 registerAllVariables(); 68 }69 else70 {71 this->node_ = 0;72 66 } 73 67 } … … 94 88 BaseObject::loadParams(xmlElem); 95 89 create(); 96 /*97 if (xmlElem->Attribute("position"))98 {99 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");100 float x, y, z;101 String2Number<float>(x, pos[0]);102 String2Number<float>(y, pos[1]);103 String2Number<float>(z, pos[2]);104 this->setPosition(x, y, z);105 }106 107 if (xmlElem->Attribute("direction"))108 {109 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");110 float x, y, z;111 String2Number<float>(x, pos[0]);112 String2Number<float>(y, pos[1]);113 String2Number<float>(z, pos[2]);114 this->setDirection(x, y, z);115 }116 117 if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll"))118 {119 float yaw = 0.0, pitch = 0.0, roll = 0.0;120 if (xmlElem->Attribute("yaw"))121 String2Number<float>(yaw,xmlElem->Attribute("yaw"));122 123 if (xmlElem->Attribute("pitch"))124 String2Number<float>(pitch,xmlElem->Attribute("pitch"));125 126 if (xmlElem->Attribute("roll"))127 String2Number<float>(roll,xmlElem->Attribute("roll"));128 129 this->yaw(Degree(yaw));130 this->pitch(Degree(pitch));131 this->roll(Degree(roll));132 }133 134 if (xmlElem->Attribute("scale"))135 {136 std::string scaleStr = xmlElem->Attribute("scale");137 float scale;138 String2Number<float>(scale, scaleStr);139 this->setScale(scale);140 }141 142 if (xmlElem->Attribute("rotationAxis"))143 {144 std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");145 float x, y, z;146 String2Number<float>(x, pos[0]);147 String2Number<float>(y, pos[1]);148 String2Number<float>(z, pos[2]);149 this->setRotationAxis(x, y, z);150 }151 152 if (xmlElem->Attribute("rotationRate"))153 {154 float rotationRate;155 String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate"));156 this->setRotationRate(Degree(rotationRate));157 if (rotationRate != 0)158 this->setStatic(false);159 }160 161 create();162 */163 90 } 164 91
Note: See TracChangeset
for help on using the changeset viewer.