Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5927 in orxonox.OLD


Ignore:
Timestamp:
Dec 4, 2005, 11:52:11 PM (18 years ago)
Author:
patrick
Message:

collision_deteciton: works again! but much more massivesvn diff now realy looks good

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc

    r5925 r5927  
    483483  std::list<int>           partition1;                           //!< the vertex partition 1
    484484  std::list<int>           partition2;                           //!< the vertex partition 2
    485   float*                   triangleCenter;                       //!< the center of the triangle
     485  float*                   triangleCenter = new float[3];        //!< the center of the triangle
    486486  const float*             a;                                    //!< triangle  edge a
    487487  const float*             b;                                    //!< triangle  edge b
     
    504504    c = &box.modelInf->pVertices[box.modelInf->pTriangles[box.triangleIndexes[i]].indexToVertices[2]];
    505505
    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;
    510509    tmpDist = this->separationPlane.distancePoint(*((sVec3D*)triangleCenter));
     510
    511511    if( tmpDist > 0.0f)
    512       partition1.push_back(i); /* positive numbers plus zero */
     512      partition1.push_back(box.triangleIndexes[i]); /* positive numbers plus zero */
    513513    else
    514       partition2.push_back(i); /* negatice numbers */
     514      partition2.push_back(box.triangleIndexes[i]); /* negatice numbers */
    515515  }
    516516  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.