Changeset 4562 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 9, 2005, 12:37:13 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bounding_volume.cc
r4560 r4562 29 29 this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume"); 30 30 this->center = new Vector(); 31 32 31 } 33 32 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4560 r4562 75 75 Vector p, q, r; //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d 76 76 Vector t1, t2; //!< temporary values 77 float ** covariance;//!< the covariance matrix77 float covariance[3][3]; //!< the covariance matrix 78 78 79 79 this->numOfVertices = length; 80 80 this->vertices = verticesList; 81 81 82 82 83 /* fist compute all the convex hull face/facelets and centroids */ … … 94 95 face += facelet[i]; 95 96 96 97 97 /* calculate the cetroid of the hull triangles */ 98 98 centroid[i] = (p + q + r) * 1/3; … … 102 102 /* take the average of the centroid sum */ 103 103 center /= face; 104 105 104 106 105 107 /* now calculate the covariance matrix - if not written in three for-loops, it would compute faster: minor */ … … 119 121 } 120 122 } 123 121 124 122 125 printf("Covariance Matrix:\n"); -
orxonox/trunk/src/lib/math/vector.h
r4545 r4562 28 28 29 29 /** \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; } 31 31 /** \param v The vector to add \returns the addition between two vectors (this + v) */ 32 32 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.