Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 12, 2005, 11:48:39 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: added the rectangle to the vector file, since it is a geometrical body like a plane (the plane without arrows…), moved getDimension function to the QuadtreeNode

File:
1 edited

Legend:

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

    r4836 r4845  
    238238};
    239239
     240
     241
     242//! A class that represents a rectangle, this is needed for SpatialSeparation
     243class Rectangle
     244{
     245
     246  public:
     247    Rectangle() {}
     248    virtual ~Rectangle() {}
     249
     250    /** \brief sets the center of the rectangle to a defined vector @param center the new center */
     251   inline void setCenter(const Vector &center) { this->center = center;}
     252    /** \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 */
     253   inline void setCenter(float x, float y, float z) { this->center.x = x; this->center.y = y; this->center.z = z; }
     254   /** \brief returns the center of the rectangle to a defined vector @returns center the new center */
     255   inline const Vector* getCenter() const { return &this->center; }
     256
     257   /** \brief sets both axis of the rectangle to a defined vector @param unityLength the new center */
     258   inline void setAxis(float unityLength) { this->axis[0] = unityLength; this->axis[1] = unityLength; }
     259   /** \brief sets both axis of the rectangle to a defined vector @param v1 the length of the x axis @param v2 the length of the z axis*/
     260   inline void setAxis(float v1, float v2) { this->axis[0] = v1; this->axis[1] = v2; }
     261
     262  private:
     263    Vector center;
     264    float axis[2];
     265};
    240266#endif /* _VECTOR_H */
Note: See TracChangeset for help on using the changeset viewer.