Changeset 4576 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 10, 2005, 2:18:01 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb.cc
r4557 r4576 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 26 26 \brief standard constructor 27 27 */ 28 OBB::OBB () 28 OBB::OBB () 29 29 { 30 this->setClassID(CL_OBB, "OBB"); 31 this->axis = new Vector [3];30 this->setClassID(CL_OBB, "OBB"); 31 this->axis = new Vector*[3]; 32 32 this->halfLength = new float[3]; 33 33 } … … 38 38 39 39 */ 40 OBB::~OBB () 40 OBB::~OBB () 41 41 { 42 42 // delete what has to be deleted here -
orxonox/trunk/src/lib/collision_detection/obb.h
r4560 r4576 1 /*! 1 /*! 2 2 \file obb.h 3 3 \brief Definition of an OBB (object Oriented Bounding Box) … … 21 21 22 22 23 inline const Vector* getAxis () const { return this->axis; }24 inline const float* getHalfLength() const { return this->halfLength; } 23 inline Vector** getAxis () const { return this->axis; } 24 inline const float* getHalfLength() const { return this->halfLength; } 25 25 26 26 virtual sVect3D* getVertices() const { return this->vertices; } … … 33 33 34 34 public: 35 Vector* 35 Vector** axis; //!< Axes of oriented box [x,y,z] 36 36 float* halfLength; //!< Half lengths of the box along the axis 37 37 float covarianceMatrix[3][3]; //!< the covariance matrix -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4573 r4576 166 166 vectors 167 167 */ 168 169 168 Matrix V(3,3); //!< for eigenvectors 170 169 DiagonalMatrix D(3); //!< for eigenvalues 171 170 SymmetricMatrix C(3); //!< for the covariance symmetrical matrix 172 Vector** axis ;//!< the references to the obb axis171 Vector** axis = new Vector*[3]; //!< the references to the obb axis 173 172 174 173 C(1,1) = covariance[0][0]; … … 196 195 } 197 196 198 //axis1 = 199 197 axis[0] = new Vector(V(1, 1), V(2, 1), V(3, 1)); 198 axis[1] = new Vector(V(1, 2), V(2, 2), V(3, 2)); 199 axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3)); 200 box->axis = axis; 201 202 printf("eigenvector: %f, %f, %f\n", V(1, 1), V(2, 1), V(3, 1)); 203 printf("eigenvector: %f, %f, %f\n", V(1, 2), V(2, 2), V(3, 2)); 204 printf("eigenvector: %f, %f, %f\n", V(1, 3), V(2, 3), V(3, 3)); 205 206 207 /* now get the axis length */ 208 Line ax1(*box->center, *box->axis[0]); //!< the the axis representation 209 Line ax2(*box->center, *box->axis[1]); //!< the the axis representation 210 Line ax3(*box->center, *box->axis[2]); //!< the the axis representation 211 212 213 200 214 } 201 215 … … 208 222 for(int i = 0; i < 3; ++i) 209 223 { 210 if( aLength < box->axis[i] .len())224 if( aLength < box->axis[i]->len()) 211 225 { 212 aLength = box->axis[i] .len();226 aLength = box->axis[i]->len(); 213 227 axisNr = i; 214 228 }
Note: See TracChangeset
for help on using the changeset viewer.