Changeset 1981 in orxonox.OLD for orxonox/branches/chris
- Timestamp:
- Jun 18, 2004, 2:43:46 PM (20 years ago)
- Location:
- orxonox/branches/chris/core
- Files:
-
- 2 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 { -
orxonox/branches/chris/core/vector.cc
r1954 r1981 25 25 \brief add two vectors 26 26 \param v: the other vector 27 \return the sum of both vectors 27 28 */ 28 29 Vector Vector::operator+ (const Vector& v) const … … 40 41 \brief subtract a vector from another 41 42 \param v: the other vector 43 \return the difference between the vectors 42 44 */ 43 45 Vector Vector::operator- (const Vector& v) const … … 55 57 \brief calculate the dot product of two vectors 56 58 \param v: the other vector 59 \return the dot product of the vectors 57 60 */ 58 61 float Vector::operator* (const Vector& v) const … … 63 66 /** 64 67 \brief multiply a vector with a float 65 \param v: the factor 68 \param f: the factor 69 \return the vector multipied by f 66 70 */ 67 71 Vector Vector::operator* (float f) const … … 78 82 /** 79 83 \brief divide a vector with a float 80 \param v: the factor 84 \param f: the divisor 85 \return the vector divided by f 81 86 */ 82 87 Vector Vector::operator/ (float f) const … … 100 105 \brief calculate the dot product of two vectors 101 106 \param v: the other vector 107 \return the dot product of the vectors 102 108 */ 103 109 float Vector::dot (const Vector& v) const … … 107 113 108 114 /** 109 \brief calculate the cross product of two vectors 110 \param v: the other vector 115 \brief calculate the cross product of two vectors 116 \param v: the other vector 117 \return the cross product of the vectors 111 118 */ 112 119 Vector Vector::cross (const Vector& v) const … … 122 129 123 130 /** 124 \brief normalize the vector to lenght 1.0131 \brief normalizes the vector to lenght 1.0 125 132 */ 126 133 void Vector::normalize () … … 140 147 141 148 /** 142 \brief calculate the lenght of the vector 149 \brief calculates the lenght of the vector 150 \return the lenght of the vector 143 151 */ 144 152 float Vector::len () const … … 151 159 \param v1: a vector 152 160 \param v2: another vector 161 \return the angle between the vectors in radians 153 162 */ 154 163 float angle_rad (const Vector& v1, const Vector& v2) … … 161 170 \param v1: a vector 162 171 \param v2: another vector 172 \return the angle between the vectors in degrees 163 173 */ 164 174 float angle_deg (const Vector& v1, const Vector& v2) … … 240 250 241 251 /** 242 \brief creates a nullrotation 252 \brief creates a nullrotation (an identity rotation) 243 253 */ 244 254 Rotation::Rotation () … … 259 269 \param v: a vector 260 270 \param r: a rotation 271 \return the rotated vector 261 272 */ 262 273 Vector rotate_vector( const Vector& v, const Rotation& r) … … 274 285 \brief calculate the distance between two lines 275 286 \param l: the other line 287 \return the distance between the lines 276 288 */ 277 289 float Line::distance (const Line& l) const … … 288 300 \brief calculate the distance between a line and a point 289 301 \param v: the point 302 \return the distance between the Line and the point 290 303 */ 291 304 float Line::distance_point (const Vector& v) const … … 299 312 \brief calculate the two points of minimal distance of two lines 300 313 \param l: the other line 314 \return a Vector[2] (!has to be deleted after use!) containing the two points of minimal distance 301 315 */ 302 316 Vector* Line::footpoints (const Line& l) const … … 311 325 312 326 /** 313 \brief calculate the length of a line 327 \brief calculate the length of a line 328 \return the lenght of the line 314 329 */ 315 330 float Line::len() const … … 331 346 332 347 /** 333 \brief create a plane from three lines348 \brief create a plane from three points 334 349 \param a: first point 335 350 \param b: second point … … 367 382 \brief returns the distance between the plane and a point 368 383 \param p: a Point 384 \return the distance between the plane and the point (can be negative) 369 385 */ 370 386 float Plane::distance_point (const Vector& p) const … … 376 392 377 393 /** 378 \brief returns the side a point is located relative to a plane394 \brief returns the side a point is located relative to a Plane 379 395 \param p: a Point 396 \return 0 if the point is contained within the Plane, positive(negative) if the point is in the positive(negative) semi-space of the Plane 380 397 */ 381 398 float Plane::locate_point (const Vector& p) const
Note: See TracChangeset
for help on using the changeset viewer.