Changeset 4560 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jun 9, 2005, 12:21:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4557 r4560 56 56 { 57 57 this->bvElement = this->createBox(); 58 this->calculateBoxAttributes( box);59 this->forkBox( box);58 this->calculateBoxAttributes(this->bvElement, verticesList, length); 59 this->forkBox(this->bvElement); 60 60 } 61 61 … … 67 67 68 68 69 void OBBTreeNode::calculateBoxAttributes(OBB* box )69 void OBBTreeNode::calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length) 70 70 { 71 71 float facelet[length]; //!< surface area of the i'th triangle of the convex hull … … 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[3][3];//!< the covariance matrix77 float** covariance; //!< the covariance matrix 78 78 79 79 this->numOfVertices = length; … … 130 130 printf(" |\n"); 131 131 } 132 printf("center: %f, %f, %f\n\n", cent re.x, centre.y, centre.z);132 printf("center: %f, %f, %f\n\n", center.x, center.y, center.z); 133 133 134 134 for(int i = 0; i < length; i++) … … 137 137 } 138 138 139 139 140 for(int i = 0; i < 3; ++i) 141 { 140 142 141 box->covarianceMatrix = covariance; 142 box->center = center; 143 box->covarianceMatrix[i][0] = covariance[i][0]; 144 box->covarianceMatrix[i][1] = covariance[i][1]; 145 box->covarianceMatrix[i][3] = covariance[i][2]; 146 } 147 *box->center = center; 143 148 144 149 … … 161 166 for(int i = 0; i < 3; ++i) 162 167 { 163 if( aLength < box->axis[i] )168 if( aLength < box->axis[i].len()) 164 169 { 165 aLength = box->axis[i] ;170 aLength = box->axis[i].len(); 166 171 axisNr = i; 167 172 } … … 194 199 this->bvElement->axis; 195 200 196 glBegin(GL_TRIANGLE);197 glVertex3f(this->bvElement->center );198 glEnd();201 //glBegin(GL_TRIANGLE); 202 //glVertex3f(this->bvElement->center ); 203 //glEnd(); 199 204 } 200 205
Note: See TracChangeset
for help on using the changeset viewer.