Changeset 10368 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jan 25, 2007, 2:18:07 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 10 10 autom4te.cache 11 11 aclocal.m4 12 tags 13 test.bmp 14 config.sub 15 config.guess 16 OrxonoxPlayability.kdevses 17 OrxonoxPlayability.kdevelop.pcs
-
- Property svn:ignore
-
trunk/src/lib/coord/p_node.h
r9869 r10368 98 98 inline const Vector& getRelCoor () const { return this->prevRelCoordinate; }; 99 99 /** @returns the Relative Coordinate Destination */ 100 inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };100 inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; }; 101 101 void setAbsCoor (const Vector& absCoord); 102 102 void setAbsCoor (float x, float y, float z); … … 133 133 inline const Quaternion& getRelDir () const { return this->prevRelDirection; }; 134 134 /** @returns the Relative Directional Destination */ 135 inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };135 inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; }; 136 136 /** @returns a Vector pointing into the relative Direction */ 137 137 inline Vector getRelDirV() const { return this->prevRelDirection.apply(Vector(0,1,0)); }; -
trunk/src/lib/graphics/importer/vertex_array_model.cc
r9869 r10368 260 260 ((float)j - (float)resolutionY/2.0)/(float)resolutionY * sizeY); 261 261 this->addNormal(0.0, 1, 0.0); 262 this->addTexCoor((float)i/(float) resolutionX, (float)j/(float)resolutionY);262 this->addTexCoor((float)i/(float)(resolutionY-1), (float)j/(float)(resolutionX-1)); 263 263 this->addColor(1.0, 1.0, 1.0); 264 264 } -
trunk/src/lib/gui/gl/glgui_bar.cc
r9869 r10368 71 71 72 72 this->_value = value; 73 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum)/ (_minimum + _maximum)73 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum) 74 74 ,this->getSizeY2D() - borderTop() - borderBottom()); 75 75 } … … 99 99 100 100 this->_frontRect.setTopLeft(borderLeft(), borderTop()); 101 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum)/ (_minimum + _maximum)102 101 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum) 102 ,this->getSizeY2D() - borderTop() - borderBottom()); 103 103 104 104 } -
trunk/src/lib/gui/gl/glgui_box.cc
r9869 r10368 18 18 #include "glgui_box.h" 19 19 #include <cassert> 20 #include <iostream> 20 21 #include "debug.h" 22 #include "network_log.h" 23 21 24 22 25 namespace OrxGui … … 177 180 void GLGuiBox::resize() 178 181 { 179 if ( orientation() == OrxGui::Vertical)182 if (this->orientation() == OrxGui::Vertical) 180 183 { 181 184 float height = borderTop(); … … 186 189 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 187 190 { 188 (*widget)->setRelCoor2D(borderLeft(), height); 189 height += (*widget)->getSizeY2D(); 190 width = fmax(width, (*widget)->getSizeX2D()); 191 //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 192 //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 193 //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 194 float realSizeX, realSizeY; 195 int angleAbs = (int)(*widget)->getAbsDir2D(); 196 int angleRel = (int)(*widget)->getRelDir2D(); 197 //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n'; 198 if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180) 199 { 200 realSizeX = (*widget)->getSizeX2D(); 201 realSizeY = (*widget)->getSizeY2D(); 202 //std::cout<<"box vertical, widget 0or180"; 203 } 204 else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270) 205 { 206 realSizeX = (*widget)->getSizeY2D(); 207 realSizeY = (*widget)->getSizeX2D(); 208 //std::cout<<"box vertical, widget 90or270"; 209 } 210 211 (*widget)->setRelCoor2D(borderLeft(), height + borderTop()); 212 height += realSizeY; 213 width = fmax(width, realSizeX); 191 214 } 192 215 … … 205 228 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 206 229 { 230 //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 231 //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n'; 232 //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 233 //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 234 float realSizeX, realSizeY; 235 int angleAbs = (int)(*widget)->getAbsDir2D(); 236 int angleRel = (int)(*widget)->getRelDir2D(); 237 //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n'; 238 if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180) 239 { 240 realSizeX = (*widget)->getSizeX2D(); 241 realSizeY = (*widget)->getSizeY2D(); 242 //std::cout<<"box horicontal, widget 0or180"; 243 } 244 else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270) 245 { 246 realSizeX = (*widget)->getSizeY2D(); 247 realSizeY = (*widget)->getSizeX2D(); 248 //std::cout<<"box horicontal, widget 90or270"; 249 } 250 207 251 (*widget)->setRelCoor2D(width, borderTop()); 208 height = fmax(height, (*widget)->getSizeY2D());209 width += (*widget)->getSizeX2D();252 height = fmax(height, realSizeY); 253 width += realSizeX; 210 254 } 211 255 -
trunk/src/lib/gui/gl/glgui_widget.cc
r10317 r10368 915 915 } 916 916 917 void GLGuiWidget::beginDraw() const 918 { 919 glPushMatrix(); 920 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); 921 glRotatef(this->getAbsDir2D(), 0, 0, 1); 922 } 923 917 924 918 925 } -
trunk/src/lib/gui/gl/glgui_widget.h
r9869 r10368 244 244 245 245 /// RENDERING 246 inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };246 void beginDraw() const; 247 247 inline void endDraw() const { glPopMatrix(); }; 248 248 -
trunk/src/lib/math/curve.cc
r9110 r10368 142 142 tmpNode = tmpNode->next; 143 143 return tmpNode->position; 144 } 145 146 /** 147 * This function returns an approximation of the length of the curve 148 * 149 */ 150 float Curve::getLength() 151 { 152 float length = 0; 153 PathNode* tmpNode = this->firstNode; 154 for(int i = 1; i < this->nodeCount; i++) 155 { 156 length += Vector(tmpNode->next->position - tmpNode->position).len(); 157 } 158 return length; 144 159 } 145 160 … … 273 288 Vector BezierCurve::calcDir (float t) 274 289 { 275 return this->dirCurve->calcPos(t); 290 return this->calcPos(t + 0.01) - this->calcPos(t); 291 //return this->dirCurve->calcPos(t); 276 292 } 277 293 -
trunk/src/lib/math/curve.h
r6616 r10368 47 47 /** @returns the directional Curve */ 48 48 Curve* getDirCurve() const { return this->dirCurve; }; 49 float getLength(); 49 50 50 51 /** @param t the value on the curve [0-1] @returns Vector to the position */ -
trunk/src/lib/util/loading/fast_factory.cc
r9869 r10368 157 157 void FastFactory::flush(bool hardFLUSH) 158 158 { 159 hardFLUSH = false; // HACK 159 160 FastObjectMember* tmpMember = this->deadList, *delMember = NULL; 160 161 while (tmpMember != NULL)
Note: See TracChangeset
for help on using the changeset viewer.