Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 9, 2005, 12:37:13 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: collision detection framework now works again

Location:
orxonox/trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/bounding_volume.cc

    r4560 r4562  
    2929   this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume");
    3030   this->center = new Vector();
    31 
    3231}
    3332
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4560 r4562  
    7575  Vector    p, q, r;                                 //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d
    7676  Vector    t1, t2;                                  //!< temporary values
    77   float**   covariance;                               //!< the covariance matrix
     77  float     covariance[3][3];                        //!< the covariance matrix
    7878   
    7979  this->numOfVertices = length;
    8080  this->vertices = verticesList;
     81
    8182
    8283  /* fist compute all the convex hull face/facelets and centroids */
     
    9495      face += facelet[i];
    9596
    96 
    9797      /* calculate the cetroid of the hull triangles */
    9898      centroid[i] = (p + q + r) * 1/3;
     
    102102  /* take the average of the centroid sum */
    103103  center /= face;
     104
     105
    104106 
    105107  /* now calculate the covariance matrix - if not written in three for-loops, it would compute faster: minor */
     
    119121        }
    120122    }
     123
    121124 
    122125  printf("Covariance Matrix:\n");
  • orxonox/trunk/src/lib/math/vector.h

    r4545 r4562  
    2828
    2929  /** \param index The index of the "array" \returns the x/y/z coordinate */
    30   inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z;}
     30  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
    3131  /**  \param v The vector to add \returns the addition between two vectors (this + v) */
    3232  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
Note: See TracChangeset for help on using the changeset viewer.