Changeset 5927 in orxonox.OLD for branches/collision_detection
- Timestamp:
- Dec 4, 2005, 11:52:11 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
r5925 r5927 483 483 std::list<int> partition1; //!< the vertex partition 1 484 484 std::list<int> partition2; //!< the vertex partition 2 485 float* triangleCenter ;//!< the center of the triangle485 float* triangleCenter = new float[3]; //!< the center of the triangle 486 486 const float* a; //!< triangle edge a 487 487 const float* b; //!< triangle edge b … … 504 504 c = &box.modelInf->pVertices[box.modelInf->pTriangles[box.triangleIndexes[i]].indexToVertices[2]]; 505 505 506 triangleCenter[0] = (a[0] + b[0] + c[0])/3.0f; 507 triangleCenter[1] = (a[1] + b[1] + c[1])/3.0f; 508 triangleCenter[2] = (a[2] + b[2] + c[2])/3.0f; 509 506 triangleCenter[0] = (a[0] + b[0] + c[0]) / 3.0f; 507 triangleCenter[1] = (a[1] + b[1] + c[1]) / 3.0f; 508 triangleCenter[2] = (a[2] + b[2] + c[2]) / 3.0f; 510 509 tmpDist = this->separationPlane.distancePoint(*((sVec3D*)triangleCenter)); 510 511 511 if( tmpDist > 0.0f) 512 partition1.push_back( i); /* positive numbers plus zero */512 partition1.push_back(box.triangleIndexes[i]); /* positive numbers plus zero */ 513 513 else 514 partition2.push_back( i); /* negatice numbers */514 partition2.push_back(box.triangleIndexes[i]); /* negatice numbers */ 515 515 } 516 516 PRINTF(3)("\nPartition1: got \t%i Vertices \nPartition2: got \t%i Vertices\n", partition1.size(), partition2.size());
Note: See TracChangeset
for help on using the changeset viewer.