Changeset 5688 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Nov 21, 2005, 11:27:39 PM (19 years ago)
- Location:
- trunk/src/lib/collision_detection
- Files:
-
- 4 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
Note: See TracChangeset
for help on using the changeset viewer.