Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4841 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 12, 2005, 9:47:15 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: introduced new class Rectangle representing…

Location:
orxonox/trunk/src/lib/graphics/spatial_separation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r4836 r4841  
    104104  \brief gets the maximal dimension of a model
    105105* @param playerModel the model that this measurement is based on
    106   \return the maximal dimension of the model
     106  \return the dimension of the AbstractModel as a Rectangle
    107107 */
    108 float SpatialSeparation::getMaxDimension(AbstractModel* playerModel)
     108Rectangle* SpatialSeparation::getDimension(AbstractModel* playerModel)
    109109{
    110110
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h

    r4836 r4841  
    99
    1010#include "base_object.h"
     11#include "vector.h"
    1112
    1213
     
    1516
    1617
    17 #define SEC_OFFSET 1.0                       //!< the offset added to the overlapSize to ensure that there are no problems in cd
     18#define SEC_OFFSET 1.0                       //!< the offset added to the overlapSize to ensure that there are no problems in
     19
     20
     21//! A class that represents a rectangle, this is needed for SpatialSeparation
     22class Rectangle
     23{
     24
     25  public:
     26    Rectangle();
     27    virtual ~Rectangle();
     28
     29    /** \brief sets the center of the rectangle to a defined vector @param center the new center */
     30    inline void setCenter(const Vector &center) { this->center = center;}
     31    /** \brief returns the center of the rectangle to a defined vector @returns center the new center */
     32    inline const Vector* getCenter() const { return &this->center; }
     33
     34    /** \brief sets both axis of the rectangle to a defined vector @param unityLength the new center */
     35    inline void setAxis(float unityLength) { this->axis[0] = unityLength; this->axis[1] = unityLength; }
     36               /** \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*/
     37    inline void setAxis(float v1, float v2) { this->axis[0] = v1; this->axis[1] = v2; }
     38
     39  private:
     40    Vector center;
     41    float axis[2];
     42
     43};
    1844
    1945//! A class for spatial separation of vertices based arrays
     
    3561  private:
    3662    void separateZone();
    37     float getMaxDimension(AbstractModel* playerModel);
     63    Rectangle* getDimension(AbstractModel* playerModel);
    3864
    3965
Note: See TracChangeset for help on using the changeset viewer.