Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4573 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jun 10, 2005, 1:41:48 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now working on the obb axis alignement

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4553 r4573  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2828   \brief standard constructor
    2929*/
    30 OBBTree::OBBTree () 
     30OBBTree::OBBTree ()
    3131{
    32    this->setClassID(CL_OBB_TREE, "OBBTree"); 
     32   this->setClassID(CL_OBB_TREE, "OBBTree");
    3333
    3434}
     
    3939
    4040*/
    41 OBBTree::~OBBTree () 
     41OBBTree::~OBBTree ()
    4242{
    4343  // delete what has to be deleted here
     
    9191  PRINT(0)("\n==============================| OBBTree::debug() |===\n");
    9292  PRINT(0)("=  Spawning Tree: Start\n");
    93  
     93
    9494  /* generate some test vertices */
    9595  sVec3D* vertList = new sVec3D[3];
     
    106106
    107107  PRINT(0)("=  Spawning Tree: Finished\n");
    108   PRINT(0)("=======================================================\n");     
     108  PRINT(0)("=======================================================\n");
    109109
    110110}
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4572 r4573  
    166166     vectors
    167167  */
    168    
    169   SymmetricMatrix C(3);
    170  
    171   C(1,1) = 1;
    172   C(1,2) = 4;
    173   C(1,3) = 4;
    174   C(2,1) = 4; 
    175   C(2,2) = 2;
    176   C(2,3) = 4;
    177   C(3,1) = 4;
    178   C(3,2) = 4;
    179   C(3,3) = 3;
    180  
    181   // cout << "The symmetrix matrix C" << endl;
    182   //cout << setw(5) << setprecision(0) << C << endl;
    183 
    184   Matrix                V(3,3); // for eigenvectors
    185   DiagonalMatrix        D(3);   // for eigenvalues
    186  
    187   // the decomposition
    188   Jacobi(C, D, V);
    189 
    190 
    191   // Print the result
    192  /* cout << "The eigenvalues matrix:" << endl;
    193   cout << setw(10) << setprecision(5) << D << endl;
    194   cout << "The eigenvectors matrix:" << endl;*/
    195  
     168
     169  Matrix                V(3,3);                               //!< for eigenvectors
     170  DiagonalMatrix        D(3);                                 //!< for eigenvalues   
     171  SymmetricMatrix       C(3);                                 //!< for the covariance symmetrical matrix
     172  Vector**              axis;                                 //!< the references to the obb axis
     173 
     174  C(1,1) = covariance[0][0];
     175  C(1,2) = covariance[0][1];
     176  C(1,3) = covariance[0][2];
     177  C(2,1) = covariance[1][0];   
     178  C(2,2) = covariance[1][1];
     179  C(2,3) = covariance[1][2];
     180  C(3,1) = covariance[2][0];
     181  C(3,2) = covariance[2][1];
     182  C(3,3) = covariance[2][2];
     183
     184  Jacobi(C, D, V);                                            /* do the jacobi decomposition */
     185
     186  printf("we got a result! YES: \n");
     187
     188  for(int j = 1; j < 4; ++j)
     189  {
     190    printf(" |");
     191    for(int k = 1; k < 4; ++k)
     192    {
     193      printf(" \b%f ", V(j, k));
     194    }
     195    printf(" |\n");
     196  }
     197
     198   //axis1 =
    196199
    197200}
Note: See TracChangeset for help on using the changeset viewer.