Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7316 in orxonox.OLD for trunk/src/lib/graphics/render2D/element_2d.h


Ignore:
Timestamp:
Apr 17, 2006, 1:49:05 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Element2D uses Vector2D instead of Vector whenever possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.h

    r7221 r7316  
    139139    // LIKE PNODE
    140140  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);
    143143    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, float bias = 1.0);
     144    void setRelCoorSoft2D (const Vector2D& relCoordSoft, float bias = 1.0);
     145    void setRelCoorSoft2D (float x, float y, float bias = 1.0);
    146146    void setRelCoorSoft2Dpx (int x, int y, float bias = 1.0);
    147147    /** @returns the relative position */
    148     inline const Vector& getRelCoor2D () const { return this->prevRelCoordinate; };
     148    inline const Vector2D& getRelCoor2D () const { return this->prevRelCoordinate; };
    149149    /** @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);
    154154    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, float bias = 1.0);
     155    void setAbsCoorSoft2D (const Vector2D& absCoordSoft, float bias = 1.0);
     156    void setAbsCoorSoft2D (float x, float y, float bias = 1.0);
    157157    /** @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);
    162162    void shiftCoor2Dpx (int x, int y);
    163163
     
    177177    inline float getSpeed() const { return 0; };
    178178    /** @returns the Velocity of the Node */
    179     inline const Vector& getVelocity() const { return this->velocity; };
     179    inline const Vector2D& getVelocity() const { return this->velocity; };
    180180
    181181
     
    225225    inline void parentDirChanged2D () { this->bRelDirChanged = true; }
    226226    /** @returns the last calculated coordinate */
    227     inline Vector getLastAbsCoor2D() { return this->lastAbsCoordinate; }
     227    inline Vector2D getLastAbsCoor2D() { return this->lastAbsCoordinate; }
    228228
    229229    void reparent2D();
     
    247247    bool                    bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
    248248
    249     Vector                  relCoordinate;      //!< coordinates relative to the parent
    250     Vector                  absCoordinate;      //!< absolute coordinates in the world ( from (0,0,0) )
     249    Vector2D                relCoordinate;      //!< coordinates relative to the parent
     250    Vector2D                absCoordinate;      //!< absolute coordinates in the world ( from (0,0,0) )
    251251    float                   relDirection;       //!< direction relative to the parent
    252252    float                   absDirection;       //!< absolute diretion in the world ( from (0,0,1) )
    253253
    254     Vector                  prevRelCoordinate;  //!< The last Relative Coordinate from the last update-Cycle.
    255     Vector                  lastAbsCoordinate;  //!< this is used for speedcalculation, it stores the last coordinate
     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
    256256    float                   prevRelDirection;   //!< The last Relative Direciton from the last update-Cycle.
    257257
    258     Vector                  velocity;           //!< Saves the velocity.
    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)
    261261    float*                  toDirection;        //!< a direction to which to iterate. (This is used in conjunction with setParentSoft and set*DirSoft)
    262262    float                   bias;               //!< how fast to iterate to the given position (default is 1)
Note: See TracChangeset for help on using the changeset viewer.