Changeset 622 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 18, 2007, 6:03:54 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/Main.cc
r618 r622 123 123 orx->start(); 124 124 #else 125 /* 126 for (int i = 0; i < 500; i++) 127 { 128 int x = rand() % 40000 - 20000; 129 int y = rand() % 40000 - 20000; 130 int z = rand() % 40000 - 20000; 131 132 int scale = rand() % 100 + 20; 133 134 int version = rand() % 6 + 1; 135 136 float rotx = float(rand()) / RAND_MAX; 137 float roty = float(rand()) / RAND_MAX; 138 float rotz = float(rand()) / RAND_MAX; 139 140 int axis = rand() % 3 + 1; 141 142 if (axis == 1) 143 rotx = 0; 144 if (axis == 2) 145 roty = 0; 146 if (axis == 3) 147 rotz = 0; 148 149 int rotation = rand() % 40 + 10; 150 151 // <Model position="1000,1500,0" scale="50" mesh="ast1.mesh" rotationAxis="0,1.25,0" rotationRate="70" /> 152 std::cout << " <Model position=\"" << x << "," << y << "," << z << "\" scale=\"" << scale << "\" mesh=\"ast" << version << ".mesh\" rotationAxis=\"" << rotx << "," << roty << "," << rotz << "\" rotationRate=\"" << rotation << "\" />" << std::endl; 153 154 155 } 156 */ 125 157 orx->init(argc, argv, ""); 126 158 orx->start(); -
code/branches/FICN/src/orxonox/objects/Model.cc
r614 r622 25 25 WorldEntity::loadParams(xmlElem); 26 26 27 28 29 30 31 27 if (xmlElem->Attribute("mesh")) 28 { 29 std::string src = xmlElem->Attribute("mesh"); 30 this->mesh_.setMesh(src); 31 this->attachObject(this->mesh_.getEntity()); 32 32 } 33 33 -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r614 r622 82 82 BaseObject::loadParams(xmlElem); 83 83 84 85 86 87 84 if (xmlElem->Attribute("name")) 85 { 86 this->setName(xmlElem->Attribute("mesh")); 87 } 88 88 89 90 91 92 93 94 95 96 97 89 if (xmlElem->Attribute("position")) 90 { 91 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),","); 92 float x, y, z; 93 String2Number<float>(x, pos[0]); 94 String2Number<float>(y, pos[1]); 95 String2Number<float>(z, pos[2]); 96 this->setPosition(x, y, z); 97 } 98 98 99 100 101 102 103 104 105 106 107 99 if (xmlElem->Attribute("direction")) 100 { 101 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),","); 102 float x, y, z; 103 String2Number<float>(x, pos[0]); 104 String2Number<float>(y, pos[1]); 105 String2Number<float>(z, pos[2]); 106 this->setDirection(x, y, z); 107 } 108 108 109 109 if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll")) … … 124 124 } 125 125 126 if (xmlElem->Attribute("scale")) 127 { 128 std::string scaleStr = xmlElem->Attribute("scale"); 129 float scale; 130 String2Number<float>(scale, scaleStr); 131 this->setScale(scale); 132 } 126 if (xmlElem->Attribute("scale")) 127 { 128 std::string scaleStr = xmlElem->Attribute("scale"); 129 float scale; 130 String2Number<float>(scale, scaleStr); 131 this->setScale(scale); 132 } 133 134 if (xmlElem->Attribute("rotationAxis")) 135 { 136 std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),","); 137 float x, y, z; 138 String2Number<float>(x, pos[0]); 139 String2Number<float>(y, pos[1]); 140 String2Number<float>(z, pos[2]); 141 this->setRotationAxis(x, y, z); 142 } 143 144 if (xmlElem->Attribute("rotationRate")) 145 { 146 float rotationRate; 147 String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate")); 148 this->setRotationRate(Degree(rotationRate)); 149 if (rotationRate != 0) 150 this->setStatic(false); 151 } 152 133 153 } 134 154 -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r589 r622 123 123 { return this->node_->getOrientation(); } 124 124 125 inline void setStatic(bool bStatic) 126 { this->bStatic_ = bStatic; } 127 inline bool isStatic() 128 { return this->bStatic_; } 129 125 130 protected: 126 131 void registerAllVariables();
Note: See TracChangeset
for help on using the changeset viewer.