Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 3:45:43 PM (18 years ago)
Author:
ponder
Message:

To rid of the triple and plane struct in types.h. now using the generic ones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/graphics/importer/terrain/types.h

    r9140 r9147  
    2626#define SAVE_DELETE( _a ) if ( _a ) { delete _a; _a = NULL; }
    2727
    28 struct Triple
    29 {
    30   Triple( float _x, float _y, float _z )
    31   {
    32     x = _x; y = _y; z = _z;
    33   }
    34   Triple() { x = y = z = 0.0f; }
    35   inline float length() const
    36     { return sqrt( x*x+y*y+z*z ); }
    37   float x, y, z;
    38 };
    39 
    4028struct TexCoord
    4129{
     
    5442{
    5543
    56   ABox( Triple _min, Triple _max)
     44  ABox( Vector _min, Vector _max)
    5745  {
    5846    corner = _min;
     
    6452  ABox()
    6553  {
    66     corner = Triple( 0.0f, 0.0f, 0.0f );
     54    corner = Vector( 0.0f, 0.0f, 0.0f );
    6755    x = y = z = 0.0f;
    6856  }
    69   inline void set( const Triple& _min, const Triple& _max )
     57  inline void set( const Vector& _min, const Vector& _max )
    7058  {
    7159    setMin( _min ); setMax( _max );
    7260  }
    73   inline void setMax( const Triple& _max )
     61  inline void setMax( const Vector& _max )
    7462  {
    7563    x = _max.x-corner.x;
     
    7765    z = _max.z-corner.z;
    7866  }
    79   inline void setMin( const Triple& _min )
     67  inline void setMin( const Vector& _min )
    8068  {
    8169    corner = _min;
    8270  }
    83   inline Triple vertexP( const Triple& _normal ) const
     71  inline Vector vertexP( const Vector& _normal ) const
    8472  {
    85     Triple res = corner;
     73    Vector res = corner;
    8674    if ( _normal.x > 0 )
    8775      res.x+= x;
     
    9381    return res;
    9482  }
    95   inline Triple vertexN( const Triple& _normal ) const
     83  inline Vector vertexN( const Vector& _normal ) const
    9684  {
    97     Triple res = corner;
     85    Vector res = corner;
    9886    if ( _normal.x < 0 )
    9987      res.x+= x;
     
    10694
    10795  }
    108 inline Triple min() const { return Triple(corner); }
    109   inline Triple max() const { return Triple( corner.x+x, corner.y+y, corner.z+z ); }
    110   Triple corner;
     96inline Vector min() const { return Vector(corner); }
     97  inline Vector max() const { return Vector( corner.x+x, corner.y+y, corner.z+z ); }
     98  Vector corner;
    11199  float x, y, z;
    112100
     
    115103// struct Plane
    116104// {
    117 //   Plane() { n = Triple( 0.0f, 1.0f, 0.0f ); d = 0.0f; }
     105//   Plane() { n = Vector( 0.0f, 1.0f, 0.0f ); d = 0.0f; }
    118106//   inline void setCoefficients( float _nx, float _ny, float _nz, float _d )
    119107//   {
    120 //     n = Triple( _nx, _ny, _nz );
     108//     n = Vector( _nx, _ny, _nz );
    121109//     float l = n.length();
    122110//     n.x /= l; n.y/=l; n.z/=l;
    123111//     d = _d/l;
    124112//   }
    125 //   inline float distance( const Triple& _point ) const
     113//   inline float distance( const Vector& _point ) const
    126114//   {
    127115//     return _point.x*n.x+_point.y*n.y+_point.z*n.z+d;
    128116//   }
    129 //   Triple n;
     117//   Vector n;
    130118//   float d;
    131119// };
Note: See TracChangeset for help on using the changeset viewer.