Changeset 4611 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 12, 2005, 11:52:45 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4609 r4611 98 98 int const length = 3; 99 99 sVec3D* vertList = new sVec3D[length]; 100 sVec3D data[length] = {{5.0, 0.0, 0.0},{2.0, 0.0, 0.5},{14.0, 0.0, 0.0}};//, {5.0, 0.0, 1.0}, {12.0, 0.0, 8.0}, {3.0, 5.0, 4.9}};100 sVec3D data[length] = {{5.0, 0.0, 0.0},{2.0, 0.0, 5.0},{14.0, 0.0, 0.0}};//, {5.0, 0.0, 1.0}, {12.0, 0.0, 8.0}, {3.0, 5.0, 4.9}}; 101 101 102 102 for(int i = 0; i < length; ++i) -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4609 r4611 279 279 280 280 /* get the closest vertex near the center */ 281 float dist = 0.0f;//!< the smallest distance to each vertex281 float dist = 999999.0f; //!< the smallest distance to each vertex 282 282 float tmpDist; //!< temporary distance 283 283 int vertexIndex; 284 Plane separationPlane(*box->axis[axisIndex], *box->center); //!< the separation plane definition284 Plane middlePlane(*box->axis[axisIndex], *box->center); //!< the middle plane 285 285 286 286 for(int i = 0; i < box->numOfVertices; ++i) 287 287 { 288 tmpDist = fabs(separationPlane.distancePoint(vertices[i])); 289 if( tmpDist > dist) 288 tmpDist = fabs(middlePlane.distancePoint(box->vertices[i])); 289 if( tmpDist < dist) 290 { 290 291 dist = tmpDist; 291 } 292 292 vertexIndex = i; 293 } 294 } 293 295 294 296 printf("\nthe clostest vertex is nr: %i, with a dist of: %f\n", vertexIndex ,dist); 297 298 299 /* now definin the separation plane through this specified nearest point and partition 300 the points depending on which side they are located 301 */ 302 Plane separationPlane(*box->axis[axisIndex], box->vertices[vertexIndex]); //!< separation plane 303 tList<sVec3D> partition1; //!< the vertex partition 1 304 tList<sVec3D> partition2; //!< the vertex partition 2 295 305 296 306
Note: See TracChangeset
for help on using the changeset viewer.