Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7584 in orxonox.OLD for branches/cd/src/lib


Ignore:
Timestamp:
May 11, 2006, 12:21:46 AM (19 years ago)
Author:
patrick
Message:

cd: changing to new coordinate format

Location:
branches/cd/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/lib/collision_detection/obb_tree_node.cc

    r7583 r7584  
    158158  Vector    t1, t2;                                  //!< temporary values
    159159  float     covariance[3][3] = {0,0,0, 0,0,0, 0,0,0};//!< the covariance matrix
    160   sVec3D*   tmpVec = NULL;                           //!< a temp saving place for sVec3Ds
     160  const float*   tmpVec = NULL;                           //!< a temp saving place for sVec3Ds
    161161
    162162  /* fist compute all the convex hull face/facelets and centroids */
    163163  for( int i = 0; i < length ; ++i)
    164164  {
    165     tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);
    166     p = *tmpVec;
    167     tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);
    168     q = *tmpVec;
    169     tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);
    170     r = *tmpVec;
     165    tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);
     166    p = tmpVec;
     167    tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);
     168    q = tmpVec;
     169    tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);
     170    r = tmpVec;
    171171
    172172    /* finding the facelet surface via cross-product */
     
    195195      for( int i = 0; i < length; ++i)
    196196      {
    197         tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);
    198         p = *tmpVec;
    199         tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);
    200         q = *tmpVec;
    201         tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);
    202         r = *tmpVec;
     197        tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);
     198        p = tmpVec;
     199        tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);
     200        q = tmpVec;
     201        tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);
     202        r = tmpVec;
    203203
    204204        covariance[j][k] = facelet[i] * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] +
     
    291291  PRINTF(3)("Calculate Box Axis\n");
    292292  /* now get the axis length */
    293   Line                ax[3];                                 //!< the axis
    294293  float               halfLength[3];                         //!< half length of the axis
    295294  float               tmpLength;                             //!< tmp save point for the length
     
    299298  float               maxLength[3];                          //!< maximal lenth of the axis
    300299  float               minLength[3];                          //!< minimal length of the axis
    301   const float*       tmpVec;                                //!< variable taking tmp vectors
     300  const float*        tmpVec;                                //!< variable taking tmp vectors
    302301
    303302
     
    313312      tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
    314313      tmpLength = p0.distancePoint(tmpVec);
    315       PRINTF(0)("point[%i][%i]: %f, %f, %f with distance to plane: %f\n", j, i, tmpVec[0], tmpVec[1], tmpVec[2], tmpLength);
    316314      if( tmpLength > maxLength[0])
    317315        maxLength[0] = tmpLength;
  • branches/cd/src/lib/math/vector.h

    r7191 r7584  
    8585  /** copy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */
    8686  inline const Vector& operator= (const sVec3D& v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; }
     87  inline const Vector& operator= (const float* v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; }
    8788  /** @param v: the other vector \return the dot product of the vectors */
    8889  float dot (const Vector& v) const { return x*v.x+y*v.y+z*v.z; };
Note: See TracChangeset for help on using the changeset viewer.