Changeset 4553 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jun 8, 2005, 11:59:09 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4551 r4553 64 64 float covariance[3][3]; //!< the covariance matrix 65 65 66 this->numOfVertices = length; 67 this->vertices = verticesList; 68 66 69 /* fist compute all the convex hull face/facelets and centroids */ 67 70 for(int i = 0; i < length; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/ 68 71 { 69 p = *(verticesList + i);70 q = *(verticesList + i + 1);71 r = *(verticesList + i + 2);72 p = verticesList[i]; 73 q = verticesList[i +1]; 74 r = verticesList[i + 2]; 72 75 73 76 t1 = p - q; t2 = p - r; … … 94 97 for(int i = 0; i < length; i+=3) 95 98 { 96 p = *(verticesList + i);97 q = *(verticesList + i + 1);98 r = *(verticesList + i + 2);99 p = verticesList[i]; 100 q = verticesList[i +1]; 101 r = verticesList[i + 2]; 99 102 100 103 covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j]* p[k] + … … 105 108 106 109 printf("Covariance Matrix:\n"); 107 110 for(int j = 0; j < 3; ++j) 108 111 { 109 112 printf(" |"); … … 114 117 printf(" |\n"); 115 118 } 119 printf("center: %f, %f, %f\n\n", centre.x, centre.y, centre.z); 120 121 for(int i = 0; i < length; i++) 122 { 123 printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]); 124 } 125 116 126 } 117 127 … … 122 132 123 133 void OBBTreeNode::drawBV(int currentDepth, const int depth) const 124 {} 134 { 135 glColor3f(1.0, 1.0, 1.0); 136 glBegin(GL_TRIANGLES); 137 for(int i = 0; i < this->numOfVertices; ++i) 138 { 139 glVertex3f(this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]); 140 //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]); 141 } 142 glEnd(); 143 } 125 144 126 145
Note: See TracChangeset
for help on using the changeset viewer.