Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2005, 4:51:07 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: collision-detection with new Matrix-class

File:
1 edited

Legend:

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

    r5511 r5674  
    2020#include "obb.h"
    2121#include "obb_tree.h"
    22 #include "vector.h"
     22#include "matrix.h"
    2323#include "abstract_model.h"
    2424#include "world_entity.h"
    2525
    26 #include <math.h>
    2726#include "color.h"
    2827
    2928#include "debug.h"
    30 #include "stdincl.h"
    3129#include "lin_alg.h"
    3230#include "glincl.h"
     
    361359  Vector*              axis = new Vector[3];                //!< the references to the obb axis
    362360
    363   OBBTreeNode::coMat[0][0] = box->covarianceMatrix[0][0];
    364   OBBTreeNode::coMat[0][1] = box->covarianceMatrix[0][1];
    365   OBBTreeNode::coMat[0][2] = box->covarianceMatrix[0][2];
    366 
    367   OBBTreeNode::coMat[1][0] = box->covarianceMatrix[1][0];
    368   OBBTreeNode::coMat[1][1] = box->covarianceMatrix[1][1];
    369   OBBTreeNode::coMat[1][2] = box->covarianceMatrix[1][2];
    370 
    371   OBBTreeNode::coMat[2][0] = box->covarianceMatrix[2][0];
    372   OBBTreeNode::coMat[2][1] = box->covarianceMatrix[2][1];
    373   OBBTreeNode::coMat[2][2] = box->covarianceMatrix[2][2];
    374 
    375 
    376 //   OBBTreeNode::coMat[0][0] = 1;
    377 //   OBBTreeNode::coMat[0][1] = 2;
    378 //   OBBTreeNode::coMat[0][2] = 7;
    379 //
    380 //   OBBTreeNode::coMat[1][0] = 2;
    381 //   OBBTreeNode::coMat[1][1] = 5;
    382 //   OBBTreeNode::coMat[1][2] = 5;
    383 //
    384 //   OBBTreeNode::coMat[2][0] = 7;
    385 //   OBBTreeNode::coMat[2][1] = 5;
    386 //   OBBTreeNode::coMat[2][2] = 8;
    387 
    388 //   OBBTreeNode::coMat[1][1] = box->covarianceMatrix[0][0];
    389 //   OBBTreeNode::coMat[1][2] = box->covarianceMatrix[0][1];
    390 //   OBBTreeNode::coMat[1][3] = box->covarianceMatrix[0][2];
    391 //
    392 //   OBBTreeNode::coMat[2][1] = box->covarianceMatrix[1][0];
    393 //   OBBTreeNode::coMat[2][2] = box->covarianceMatrix[1][1];
    394 //   OBBTreeNode::coMat[2][3] = box->covarianceMatrix[1][2];
    395 //
    396 //   OBBTreeNode::coMat[3][1] = box->covarianceMatrix[2][0];
    397 //   OBBTreeNode::coMat[3][2] = box->covarianceMatrix[2][1];
    398 //   OBBTreeNode::coMat[3][3] = box->covarianceMatrix[2][2];
     361  Matrix covMat(  box->covarianceMatrix[0][0], box->covarianceMatrix[0][1], box->covarianceMatrix[0][2],
     362                  box->covarianceMatrix[1][0], box->covarianceMatrix[1][1], box->covarianceMatrix[1][2],
     363                  box->covarianceMatrix[2][0], box->covarianceMatrix[2][1], box->covarianceMatrix[2][2] );
     364  covMat.getEigenVectors(axis[0], axis[1], axis[2] );
    399365
    400366
    401367  /* new jacobi tests */
    402   JacobI(OBBTreeNode::coMat, OBBTreeNode::eigvlMat, OBBTreeNode::eigvMat, OBBTreeNode::rotCount);
    403   PRINTF(3)("-- Done Jacobi Decomposition\n");
     368//  JacobI(OBBTreeNode::coMat, OBBTreeNode::eigvlMat, OBBTreeNode::eigvMat, OBBTreeNode::rotCount);
     369//  PRINTF(3)("-- Done Jacobi Decomposition\n");
    404370
    405371
     
    415381//   }
    416382
    417   axis[0].x = OBBTreeNode::eigvMat[0][0]; axis[0].y = OBBTreeNode::eigvMat[1][0]; axis[0].z = OBBTreeNode::eigvMat[2][0];
     383/*  axis[0].x = OBBTreeNode::eigvMat[0][0]; axis[0].y = OBBTreeNode::eigvMat[1][0]; axis[0].z = OBBTreeNode::eigvMat[2][0];
    418384  axis[1].x = OBBTreeNode::eigvMat[0][1]; axis[1].y = OBBTreeNode::eigvMat[1][1]; axis[1].z = OBBTreeNode::eigvMat[2][1];
    419385  axis[2].x = OBBTreeNode::eigvMat[0][2]; axis[2].y = OBBTreeNode::eigvMat[1][2]; axis[2].z = OBBTreeNode::eigvMat[2][2];
    420386  axis[0].normalize();
    421387  axis[1].normalize();
    422   axis[2].normalize();
     388  axis[2].normalize();*/
    423389  box->axis = axis;
    424390
Note: See TracChangeset for help on using the changeset viewer.