Changeset 5688 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Nov 21, 2005, 11:27:39 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/bounding_volume.h
r5279 r5688 24 24 inline const Vector* getCenter() const { return this->center; } 25 25 26 sVec3D* getVertices() const { return this->vertices; }26 const sVec3D* getVertices() const { return this->vertices; } 27 27 virtual void mergeWith(const BoundingVolume &bv) = 0; 28 28 … … 34 34 Vector* center; //!< Center point of box 35 35 36 sVec3D*vertices; //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred36 const sVec3D* vertices; //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred 37 37 int numOfVertices; //!< number of vertices in the vertices buffer 38 38 bool bOrigVertices; //!< is true if the vertices pointer points to the original model data - only important for deleting -
trunk/src/lib/collision_detection/bv_tree_node.h
r5684 r5688 26 26 virtual ~BVTreeNode(); 27 27 28 virtual void spawnBVTree(const int depth, sVec3D *verticesList, constint length ) = 0;28 virtual void spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length ) = 0; 29 29 virtual void spawnBVTree(const int depth, const modelInfo& modInfo) = 0; 30 30 -
trunk/src/lib/collision_detection/obb_tree_node.cc
r5686 r5688 168 168 * this function creates an Bounding Volume tree from a vertices soup (no triangle data) 169 169 */ 170 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, constint length)170 void OBBTreeNode::spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length) 171 171 { 172 172 PRINT(3)("\n"); … … 225 225 226 226 227 void OBBTreeNode::calculateBoxCovariance(OBB* box, sVec3D* verticesList,int length)227 void OBBTreeNode::calculateBoxCovariance(OBB* box, const sVec3D* verticesList, unsigned int length) 228 228 { 229 229 float facelet[length]; //!< surface area of the i'th triangle of the convex hull … … 417 417 {} 418 418 419 void OBBTreeNode::calculateBoxEigenvectors(OBB* box, sVec3D* verticesList,int length)419 void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const sVec3D* verticesList, unsigned int length) 420 420 { 421 421 … … 468 468 void OBBTreeNode::calculateBoxAxis(OBB* box, const modelInfo& modInfo) 469 469 { 470 this->calculateBoxAxis( box, &modInfo.pVertices, modInfo.numVertices);471 } 472 473 474 475 void OBBTreeNode::calculateBoxAxis(OBB* box, sVec3D* verticesList,int length)470 //this->calculateBoxAxis( box, modInfo.pVertices, modInfo.numVertices); 471 } 472 473 474 475 void OBBTreeNode::calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length) 476 476 { 477 477 … … 617 617 the points depending on which side they are located 618 618 */ 619 tList< sVec3D> partition1; //!< the vertex partition 1620 tList< sVec3D> partition2; //!< the vertex partition 2619 tList<const sVec3D> partition1; //!< the vertex partition 1 620 tList<const sVec3D> partition2; //!< the vertex partition 2 621 621 622 622 … … 642 642 643 643 /* now comes the separation into two different sVec3D arrays */ 644 tIterator< sVec3D>* iterator;//!< the iterator to go through the lists645 sVec3D*element; //!< the elements644 tIterator<const sVec3D>* iterator; //!< the iterator to go through the lists 645 const sVec3D* element; //!< the elements 646 646 int index; //!< index storage place 647 647 sVec3D* vertList1; //!< the vertex list 1 -
trunk/src/lib/collision_detection/obb_tree_node.h
r5684 r5688 28 28 virtual ~OBBTreeNode(); 29 29 30 virtual void spawnBVTree(const int depth, sVec3D *verticesList, constint length);30 virtual void spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length); 31 31 virtual void spawnBVTree(const int depth, const modelInfo& modInfo); 32 32 … … 42 42 43 43 private: 44 void calculateBoxCovariance(OBB* box, sVec3D* verticesList,int length);45 void calculateBoxEigenvectors(OBB* box, sVec3D* verticesList,int length);46 void calculateBoxAxis(OBB* box, sVec3D* verticesList,int length);44 void calculateBoxCovariance(OBB* box, const sVec3D* verticesList, unsigned int length); 45 void calculateBoxEigenvectors(OBB* box, const sVec3D* verticesList, unsigned int length); 46 void calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length); 47 47 48 48 void calculateBoxCovariance(OBB* box, const modelInfo& modInfo); … … 62 62 private: 63 63 unsigned int treeIndex; //!< Index number of the BV in the tree 64 sVec3D*vertices; //!< pointer to the vertices data64 const sVec3D* vertices; //!< pointer to the vertices data 65 65 int numOfVertices; //!< number of vertices in vertices data 66 66 int depth; //!< the depth of the node in the tree 67 67 static OBBTree* obbTree; //!< reference to the obb tree 68 68 Plane* separationPlane; //!< the separation plane of the obb 69 sVec3D*sepPlaneCenter; //!< only needed to draw plane @todo: separationPlane drawing69 const sVec3D* sepPlaneCenter; //!< only needed to draw plane @todo: separationPlane drawing 70 70 int longestAxisIndex; //!< only needed to draw plane 71 71 -
trunk/src/lib/math/vector.cc
r5672 r5688 513 513 * @param c: third point 514 514 */ 515 Plane::Plane ( Vector a, Vector b, Vectorc)515 Plane::Plane (const Vector& a, const Vector& b, const Vector& c) 516 516 { 517 517 n = (a-b).cross(c-b); … … 524 524 * @param p: anchor point 525 525 */ 526 Plane::Plane ( Vector norm, Vectorp)526 Plane::Plane (const Vector& norm, const Vector& p) 527 527 { 528 528 n = norm; … … 536 536 * @param p: anchor point 537 537 */ 538 Plane::Plane ( Vector norm, sVec3Dg)538 Plane::Plane (const Vector& norm, const sVec3D& g) 539 539 { 540 540 Vector p(g[0], g[1], g[2]); -
trunk/src/lib/math/vector.h
r5672 r5688 276 276 float k; //!< Offset constant 277 277 278 Plane ( Vector a, Vector b, Vectorc);279 Plane ( Vector norm, Vectorp);280 Plane ( Vector norm, sVec3Dp);281 Plane ( Vectorn, float k) : n(n), k(k) {} //!< assignment constructor278 Plane (const Vector& a, const Vector& b, const Vector& c); 279 Plane (const Vector& norm, const Vector& p); 280 Plane (const Vector& norm, const sVec3D& p); 281 Plane (const Vector& n, float k) : n(n), k(k) {} //!< assignment constructor 282 282 Plane () : n(Vector(1,1,1)), k(0) {} 283 283 ~Plane () {}
Note: See TracChangeset
for help on using the changeset viewer.