Changeset 1981 in orxonox.OLD for orxonox/branches/chris/core/collision.cc
- Timestamp:
- Jun 18, 2004, 2:43:46 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/core/collision.cc
r1975 r1981 22 22 using namespace std; 23 23 24 /** 25 \brief simple CollisionCluster constructor 26 \param rad: the radius of the base sphere 27 \param mid: the middle point of the sphere 28 */ 24 29 CollisionCluster::CollisionCluster (float rad = 1.0, Vector mid = Vector(0,0,0)) 25 30 { … … 31 36 } 32 37 38 /** 39 \brief loads a CollisionCluster from a data file 40 \param filename: self-explanatory 41 */ 33 42 CollisionCluster::CollisionCluster (char* filename) 34 43 { … … 58 67 } 59 68 69 /** 70 \brief Simple destructor that cleans up all the mess 71 */ 60 72 CollisionCluster::~CollisionCluster () 61 73 { … … 63 75 } 64 76 77 /** 78 \brief stores the CollisionCluster into a file 79 \param filename: self-explanatory 80 \return zero on success, -1 on error 81 */ 65 82 int CollisionCluster::store (char* filename) 66 83 { … … 74 91 } 75 92 93 /** 94 \brief performs a collision check between a CollisionCluster and a Line 95 \param pa: pointer to the Placement of the CollisionCluster 96 \param a: pointer to the CollisionCluster 97 \param ahitflags: pointer to an unsigned long to store hitlocation data 98 \param trace: pointer to the Line 99 \param impactpoint: pointer to a Vector where the point of intersection is stored in 100 \return true on collision, false otherwise. If true is returned, the flag in ahitflags that symbolises the hit subsphere is set, and impactpoint is set to the Location where the intersection occured 101 */ 76 102 bool check_trace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint) 77 103 { … … 82 108 } 83 109 110 /** 111 \brief performs a collision check between two CollisionClusters 112 \param pa: pointer to the Placement of the first CollisionCluster 113 \param a: pointer to the first CollisionCluster 114 \param ahitflags: pointer to an unsigned long to store hitlocation data on the first CollisionCluster 115 \param pb: pointer to the Placement of the second CollisionCluster 116 \param b: pointer to the second CollisionCluster 117 \param bhitflags: pointer to an unsigned long to store hitlocation data on the second CollisionCluster 118 \return true on collision, false otherwise 119 If true is returned, all flags in ahitflags and bhitflags that symbolize intersecting subspheres in the respective CollisionCluster are set 120 */ 84 121 bool check_collision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags) 85 122 { … … 91 128 } 92 129 130 /** 131 \brief performs an intersection check between two spheres 132 \param m1: center point of first sphere 133 \param r1: radius of first sphere 134 \param m2: center point of second sphere 135 \param r2: radius of second sphere 136 \return true on intersection, false otherwise 137 */ 93 138 bool sphere_sphere_collision( Vector m1, float r1, Vector m2, float r2) 94 139 { … … 97 142 } 98 143 144 /** 145 \brief performs an intersection check between a Line and a sphere 146 \param m: center point of the sphere 147 \param r: radius of the sphere 148 \param l: pointer to the Line 149 \param impactpoint: pointer to a buffer to store the point of intersection 150 \return true on intersection, false otherwise. If true is returned, impactpoint is set to the loaction where the intersection occured 151 */ 99 152 bool trace_sphere_collision( Vector m, float r, const Line* l, Vector* impactpoint) 100 153 { … … 124 177 } 125 178 179 /** 180 \brief recursive implementation for collision detection within a CC_Tree 181 */ 126 182 bool cctree_iterate(const Placement* pa, CC_Tree* ta, unsigned long* ahitflags, const Placement* pb, CC_Tree* tb, unsigned long* bhitflags) 127 183 { … … 163 219 } 164 220 221 /** 222 \brief sets the <ID>th flag in flags 223 \param flags: pointer to the long used for flagging 224 \param ID: number of the flag to be set 225 */ 165 226 void setflag( unsigned long* flags, unsigned long ID) 166 227 { … … 175 236 } 176 237 238 /** 239 \brief frees the memory allocated in a CC_Tree 240 */ 177 241 void free_CC_Tree( CC_Tree* tree) 178 242 { … … 185 249 } 186 250 251 /** 252 \brief loads a CC_Tree from a stream 253 */ 187 254 CC_Tree* load_CC_Tree (FILE* stream) 188 255 { … … 233 300 } 234 301 302 /** 303 \brief saves a CC_Tree to a stream 304 */ 235 305 int save_CC_Tree (CC_Tree* tree, FILE* stream) 236 306 { … … 263 333 } 264 334 335 /** 336 \brief recursive implementation for traceing detection within a CC_Tree 337 */ 265 338 bool cctree_trace( const Placement* p, CC_Tree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint) 266 339 {
Note: See TracChangeset
for help on using the changeset viewer.