Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5215 in orxonox.OLD for trunk/src/lib/math


Ignore:
Timestamp:
Sep 22, 2005, 4:02:08 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some more fixing of the Errors reported by valgrind
removed some stuff in patrick's collision-detection.
also changed Vector* to Vector in Rectangle (patrick tell me, if this is not ok - but i doubt it :))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/math/vector.h

    r5053 r5215  
    268268
    269269  public:
    270     Rectangle() { this->center = new Vector(); }
    271     Rectangle(const Vector &center, float len) { this->center = new Vector(center.x, center.y, center.z); this->axis[0] = len; this->axis[1] = len; }
     270    Rectangle() { this->center = Vector(); }
     271    Rectangle(const Vector &center, float len) { this->center = Vector(center.x, center.y, center.z); this->axis[0] = len; this->axis[1] = len; }
    272272    virtual ~Rectangle() {}
    273273
    274274    /** \brief sets the center of the rectangle to a defined vector @param center the new center */
    275    inline void setCenter(const Vector &center) { *this->center = center;}
     275   inline void setCenter(const Vector &center) { this->center = center;}
    276276    /** \brief sets the center of the rectangle to a defined vector @param x coord of the center @param y coord of the center @param z coord of the center */
    277    inline void setCenter(float x, float y, float z) { this->center->x = x; this->center->y = y; this->center->z = z; }
     277   inline void setCenter(float x, float y, float z) { this->center.x = x; this->center.y = y; this->center.z = z; }
    278278   /** \brief returns the center of the rectangle to a defined vector @returns center the new center */
    279    inline const Vector* getCenter() const { return this->center; }
     279   inline const Vector& getCenter() const { return this->center; }
    280280
    281281   /** \brief sets both axis of the rectangle to a defined vector @param unityLength the new center */
     
    287287
    288288  private:
    289     Vector*         center;
     289    Vector          center;
    290290    float           axis[2];
    291291};
Note: See TracChangeset for help on using the changeset viewer.