Changeset 7919 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- May 28, 2006, 3:48:13 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/render2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r7871 r7919 62 62 this->toCoordinate = NULL; 63 63 this->toDirection = NULL; 64 65 this->size = Vector2D(0,0); 64 66 this->toSize = NULL; 65 this->setSize2D(1, 1);66 67 67 68 … … 448 449 this->relCoordinate += shift; 449 450 this->bRelCoorChanged = true; 450 451 451 } 452 452 … … 847 847 if (unlikely(this->toSize != NULL)) 848 848 { 849 Vector2D shiftSize = (*this->toSize - Vector2D(this->sizeX, this->sizeY)) *fabsf(dt)*bias;849 Vector2D shiftSize = (*this->toSize - this->size) *fabsf(dt)*bias; 850 850 if (likely((shiftSize).len() >= .001))//PNODE_ITERATION_DELTA)) 851 851 { 852 this->sizeX += shiftSize.x; 853 this->sizeY += shiftSize.y; 852 this->size += shiftSize; 854 853 } 855 854 else … … 1109 1108 if (level == 0) 1110 1109 glPopAttrib(); 1111 1112 1110 } 1113 1111 -
trunk/src/lib/graphics/render2D/element_2d.h
r7843 r7919 125 125 inline const PNode* getBindNode() const { return this->bindNode; }; 126 126 127 inline void setSize2D(float x, float y) { this->sizeX = x, this->sizeY = y; }; 127 inline void setSize2D(float x, float y) { this->size = Vector2D(x, y); }; 128 inline void setSize2D(const Vector2D& size) { this->size = size; }; 129 inline const Vector2D& getSize2D() const { return this->size; }; 128 130 void setSizeSoft2D(float x, float y, float bias = 1.0); 129 inline void setSizeX2D(float x) { this->size X= x; };130 inline void setSizeY2D(float y) { this->size Y= y; };131 inline float getSizeX2D() const { return this->size X; };132 inline float getSizeY2D() const { return this->size Y; };131 inline void setSizeX2D(float x) { this->size.x = x; }; 132 inline void setSizeY2D(float y) { this->size.y = y; }; 133 inline float getSizeX2D() const { return this->size.x; }; 134 inline float getSizeY2D() const { return this->size.y; }; 133 135 134 136 public: … … 238 240 private: 239 241 const PNode* bindNode; //!< a node over which to display this 2D-element 240 float sizeX; //!< The size of the rendered item in x-direction 241 float sizeY; //!< The size of the rendered Item in y-direction 242 Vector2D size; //!< The size of the rendered item 242 243 Vector2D* toSize; //!< The Size to iterate to. 243 244
Note: See TracChangeset
for help on using the changeset viewer.