Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4853 in orxonox.OLD


Ignore:
Timestamp:
Jul 13, 2005, 10:26:06 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: progressing in quadtree separation process: list is done now the elements need to be filled into an array

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r4843 r4853  
    1717                       lib/particles/libORXparticles.a \
    1818                       lib/collision_detection/libORXcd.a \
     19                       lib/graphics/spatial_separation/libORXquadtree.a \
    1920                       lib/tinyxml/libtinyxml.a
    2021
  • orxonox/trunk/src/Makefile.in

    r4843 r4853  
    269269                       lib/particles/libORXparticles.a \
    270270                       lib/collision_detection/libORXcd.a \
     271                       lib/graphics/spatial_separation/libORXquadtree.a \
    271272                       lib/tinyxml/libtinyxml.a
    272273
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r4852 r4853  
    3838{
    3939  this->pModelInfo = pModelInfo;
    40   this->pDimension = this->getDimension(this->pModelInfo);
    4140 
    4241  /* create an array of triangle references */
     
    9897{
    9998  PRINTF(0)("got command to separate node\n");
     99
     100  this->pDimension = this->getDimension(this->pModelInfo);
     101
    100102  tList<sTriangleExt*>*           listA = new tList<sTriangleExt*>();    //!< triangle list of nodeA
    101103  tList<sTriangleExt*>*           listB = new tList<sTriangleExt*>();    //!< triangle list of nodeB
     
    111113        {
    112114          pVert = &this->pVertices[this->pTriangles[i]->indexToVertices[j]];
    113           if(  pVert[0] > rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset)
    114             printf("nA");
     115          if( pVert[0] > rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset)
     116            listA->add(&this->pTriangles[i]);
    115117          if( pVert[0] > rectCenter->x + this->offset && pVert[2]< rectCenter->z + this->offset)
    116             printf("nB");
     118            listB->add(&this->pTriangles[i]);
    117119          if( pVert[0] < rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset)
    118             printf("nC");
     120            listC->add(&this->pTriangles[i]);
    119121          if( pVert[0] < rectCenter->x + this->offset && pVert[2] < rectCenter->z + this->offset)
    120             printf("nD");
     122            listD->add(&this->pTriangles[i]);
    121123        }
    122124    }
    123   PRINTF(0)("\nseparation complete\n");
    124 }
     125  printf("Temp. list Num. o El: A: %i, B: %i, C: %i, D: %i\n", listA->getSize(), listB->getSize(), listC->getSize(), listD->getSize());
     126
     127
     128 
     129  /* Separating into to the triangle lists  */
     130  sTriangleExt**                 pTriA;                                 //!< Triangle array A
     131  sTriangleExt**                 pTriB;                                 //!< Triangle array B
     132  sTriangleExt**                 pTriC;                                 //!< Triangle array C
     133  sTriangleExt**                 pTriD;                                 //!< Triangle array D
     134  float                          lenA;                                  //!< length array A
     135  float                          lenB;                                  //!< length array B
     136  float                          lenC;                                  //!< length array C
     137  float                          lenD;                                  //!< length array D
     138  tIterator<sTriangleExt*>*      iterator;                              //!< iterator for the list iterations
     139  sTriangleExt*                  tempTri;                               //!< temp save place for triangle pointer
     140
     141  lenA = listA->getSize();
     142  lenB = listB->getSize();
     143  lenC = listC->getSize();
     144  lenD = listD->getSize();
     145 
     146  pTriA = new sTriangleExt*[listA->getSize()];
     147  pTriB = new sTriangleExt*[listB->getSize()];
     148  pTriC = new sTriangleExt*[listC->getSize()]; 
     149  pTriD = new sTriangleExt*[listD->getSize()];
     150
     151
     152  iterator = listA->getIterator();
     153
     154
     155
     156  PRINTF(0)("separation complete\n");
     157}
     158
    125159
    126160
     
    170204
    171205  PRINTF(0)("Dimension Informationation: X: min/max %f/%f Y: min/max %f/%f\n", minX, maxX, minY, maxY);
     206  PRINTF(0)("Center: %f,%f   Axis: %f\n", rect->getCenter()->x, rect->getCenter()->y, rect->getCenter()->z, rect->getAxis());
    172207  return rect;
    173208}
  • orxonox/trunk/src/lib/math/vector.h

    r4851 r4853  
    259259   /** \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*/
    260260   inline void setAxis(float v1, float v2) { this->axis[0] = v1; this->axis[1] = v2; }
     261   /** \brief gets one axis length of the rectangle  @returns the length of the axis 0 */
     262   inline float getAxis() { return this-> axis[0]; }
    261263
    262264  private:
Note: See TracChangeset for help on using the changeset viewer.