Changeset 7316 in orxonox.OLD for trunk/src/lib/graphics/render2D/element_2d.h
- Timestamp:
- Apr 17, 2006, 1:49:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.h
r7221 r7316 139 139 // LIKE PNODE 140 140 public: 141 void setRelCoor2D (const Vector & relCoord);142 void setRelCoor2D (float x, float y , float dontCare = 1.0);141 void setRelCoor2D (const Vector2D& relCoord); 142 void setRelCoor2D (float x, float y); 143 143 void setRelCoor2Dpx (int x, int y); 144 void setRelCoorSoft2D (const Vector & relCoordSoft, float bias = 1.0);145 void setRelCoorSoft2D (float x, float y, float dontCare = 1.0, floatbias = 1.0);144 void setRelCoorSoft2D (const Vector2D& relCoordSoft, float bias = 1.0); 145 void setRelCoorSoft2D (float x, float y, float bias = 1.0); 146 146 void setRelCoorSoft2Dpx (int x, int y, float bias = 1.0); 147 147 /** @returns the relative position */ 148 inline const Vector & getRelCoor2D () const { return this->prevRelCoordinate; };148 inline const Vector2D& getRelCoor2D () const { return this->prevRelCoordinate; }; 149 149 /** @returns the Relative Coordinate Destination */ 150 inline const Vector & getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; };151 const Vector & getRelCoor2Dpx() const;152 void setAbsCoor2D (const Vector & absCoord);153 void setAbsCoor2D (float x, float y , float depth = 1.0);150 inline const Vector2D& getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; }; 151 const Vector2D& getRelCoor2Dpx() const; 152 void setAbsCoor2D (const Vector2D& absCoord); 153 void setAbsCoor2D (float x, float y); 154 154 void setAbsCoor2Dpx (int x, int y); 155 void setAbsCoorSoft2D (const Vector & absCoordSoft, float bias = 1.0);156 void setAbsCoorSoft2D (float x, float y, float depth = 1.0, floatbias = 1.0);155 void setAbsCoorSoft2D (const Vector2D& absCoordSoft, float bias = 1.0); 156 void setAbsCoorSoft2D (float x, float y, float bias = 1.0); 157 157 /** @returns the absolute position */ 158 inline const Vector & getAbsCoor2D () const { return this->absCoordinate; };159 const Vector & getAbsCoor2Dpx () const;160 161 void shiftCoor2D (const Vector & shift);158 inline const Vector2D& getAbsCoor2D () const { return this->absCoordinate; }; 159 const Vector2D& getAbsCoor2Dpx () const; 160 161 void shiftCoor2D (const Vector2D& shift); 162 162 void shiftCoor2Dpx (int x, int y); 163 163 … … 177 177 inline float getSpeed() const { return 0; }; 178 178 /** @returns the Velocity of the Node */ 179 inline const Vector & getVelocity() const { return this->velocity; };179 inline const Vector2D& getVelocity() const { return this->velocity; }; 180 180 181 181 … … 225 225 inline void parentDirChanged2D () { this->bRelDirChanged = true; } 226 226 /** @returns the last calculated coordinate */ 227 inline Vector getLastAbsCoor2D() { return this->lastAbsCoordinate; }227 inline Vector2D getLastAbsCoor2D() { return this->lastAbsCoordinate; } 228 228 229 229 void reparent2D(); … … 247 247 bool bRelDirChanged; //!< If Relative Direction has changed since last time we checked 248 248 249 Vector 250 Vector 249 Vector2D relCoordinate; //!< coordinates relative to the parent 250 Vector2D absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) ) 251 251 float relDirection; //!< direction relative to the parent 252 252 float absDirection; //!< absolute diretion in the world ( from (0,0,1) ) 253 253 254 Vector 255 Vector 254 Vector2D prevRelCoordinate; //!< The last Relative Coordinate from the last update-Cycle. 255 Vector2D lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate 256 256 float prevRelDirection; //!< The last Relative Direciton from the last update-Cycle. 257 257 258 Vector 259 260 Vector *toCoordinate; //!< a position to which to iterate. (This is used in conjunction with setParentSoft.and set*CoorSoft)258 Vector2D velocity; //!< Saves the velocity. 259 260 Vector2D* toCoordinate; //!< a position to which to iterate. (This is used in conjunction with setParentSoft.and set*CoorSoft) 261 261 float* toDirection; //!< a direction to which to iterate. (This is used in conjunction with setParentSoft and set*DirSoft) 262 262 float bias; //!< how fast to iterate to the given position (default is 1)
Note: See TracChangeset
for help on using the changeset viewer.