Changeset 4544 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 7, 2005, 10:40:18 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/Makefile.am
r4541 r4544 25 25 bv_tree_node.h \ 26 26 bounding_volume.h \ 27 bounding_sphere.h 27 bounding_sphere.h \ 28 fast_math.h 28 29 -
orxonox/trunk/src/lib/collision_detection/Makefile.in
r4541 r4544 208 208 bv_tree_node.h \ 209 209 bounding_volume.h \ 210 bounding_sphere.h 210 bounding_sphere.h \ 211 fast_math.h 211 212 212 213 all: all-am -
orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
r4543 r4544 9 9 10 10 #include "base_object.h" 11 #include "fast_math.h" 11 12 12 13 // FORWARD DEFINITION 13 14 class BoundingVolume; 14 class sVec3D;15 15 class BVTree; 16 16 template<class T> class tList; -
orxonox/trunk/src/lib/collision_detection/collision.h
r4526 r4544 13 13 14 14 class WorldEntity; 15 class sVec3D;16 15 class BoundingVolume; 17 16 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4543 r4544 19 19 #include "list.h" 20 20 #include "obb.h" 21 #include "fast_math.h" 22 #include "vector.h" 21 23 22 24 #include <math.h> … … 51 53 \param verticesList: the list of vertices of the object - each vertices triple is interpreted as a triangle 52 54 */ 53 void OBBTreeNode::spawnBVTree(const int depth, constsVec3D *verticesList, const int length)55 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length) 54 56 { 55 57 float facelet[length]; //!< surface area of the i'th triangle of the convex hull … … 57 59 float centroid[length]; //!< centroid of the i'th convex hull 58 60 OBB* obb = new OBB(); //!< the new obb to add 61 Vector p, q, r; //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d 62 Vector t1, t2; 59 63 60 /* fist compute all the convex hull face lets */61 for(int i = 0; i < length; ++i)64 /* fist compute all the convex hull face/facelets */ 65 for(int i = 0; i < length; i+=3) 62 66 { 63 facelet[i] = 0.5f * fabs(5.0); 67 p = *(verticesList + i); 68 q = *(verticesList + i + 1); 69 r = *(verticesList + i + 2); 70 71 t1 = p - q; t2 = p - r; 72 73 /* finding the facelet surface via cross-product */ 74 facelet[i] = 0.5f * fabs( t1.cross(t2).len() ); 75 76 /* update the entire convex hull surface */ 77 face += facelet[i]; 64 78 } 79 80 65 81 } 66 82 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
r4543 r4544 12 12 // FORWARD DEFINITION 13 13 class BoundingVolume; 14 class sVec3D;15 14 16 15 //! A class that represents a bounding volume tree … … 22 21 virtual ~OBBTreeNode(); 23 22 24 virtual void spawnBVTree(const int depth, constsVec3D *verticesList, const int length);23 virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length); 25 24 26 25 BoundingVolume* getBV(int index) const { return this->bvElement; }
Note: See TracChangeset
for help on using the changeset viewer.