Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1981 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 18, 2004, 2:43:46 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/chris: added doxygen-optimized comments

Location:
orxonox/branches/chris/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/chris/core/collision.cc

    r1975 r1981  
    2222using namespace std;
    2323
     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*/
    2429CollisionCluster::CollisionCluster (float rad = 1.0, Vector mid = Vector(0,0,0))
    2530{
     
    3136}
    3237
     38/**
     39   \brief loads a CollisionCluster from a data file
     40   \param filename: self-explanatory
     41*/
    3342CollisionCluster::CollisionCluster (char* filename)
    3443{
     
    5867}
    5968
     69/**
     70   \brief Simple destructor that cleans up all the mess
     71*/
    6072CollisionCluster::~CollisionCluster ()
    6173{
     
    6375}
    6476
     77/**
     78   \brief stores the CollisionCluster into a file
     79   \param filename: self-explanatory
     80   \return zero on success, -1 on error
     81*/
    6582int CollisionCluster::store (char* filename)
    6683{
     
    7491}
    7592
     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*/
    76102bool check_trace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint)
    77103{
     
    82108}
    83109
     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*/
    84121bool check_collision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags)
    85122{
     
    91128}
    92129
     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*/
    93138bool sphere_sphere_collision( Vector m1, float r1, Vector m2, float r2)
    94139{
     
    97142}
    98143
     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*/
    99152bool trace_sphere_collision( Vector m, float r, const Line* l, Vector* impactpoint)
    100153{
     
    124177}
    125178
     179/**
     180   \brief recursive implementation for collision detection within a CC_Tree
     181*/
    126182bool cctree_iterate(const Placement* pa, CC_Tree* ta, unsigned long* ahitflags, const Placement* pb, CC_Tree* tb, unsigned long* bhitflags)
    127183{
     
    163219}
    164220
     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*/
    165226void setflag( unsigned long* flags, unsigned long ID)
    166227{
     
    175236}
    176237
     238/**
     239   \brief frees the memory allocated in a CC_Tree
     240*/
    177241void free_CC_Tree( CC_Tree* tree)
    178242{
     
    185249}
    186250
     251/**
     252   \brief loads a CC_Tree from a stream
     253*/
    187254CC_Tree* load_CC_Tree (FILE* stream)
    188255{
     
    233300}
    234301
     302/**
     303   \brief saves a CC_Tree to a stream
     304*/
    235305int save_CC_Tree (CC_Tree* tree, FILE* stream)
    236306{
     
    263333}
    264334
     335/**
     336   \brief recursive implementation for traceing detection within a CC_Tree
     337*/
    265338bool cctree_trace( const Placement* p, CC_Tree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint)
    266339{
  • orxonox/branches/chris/core/vector.cc

    r1954 r1981  
    2525   \brief add two vectors
    2626   \param v: the other vector
     27   \return the sum of both vectors
    2728*/
    2829Vector Vector::operator+ (const Vector& v) const
     
    4041   \brief subtract a vector from another
    4142   \param v: the other vector
     43   \return the difference between the vectors
    4244*/
    4345Vector Vector::operator- (const Vector& v) const
     
    5557   \brief calculate the dot product of two vectors
    5658   \param v: the other vector
     59   \return the dot product of the vectors
    5760*/
    5861float Vector::operator* (const Vector& v) const
     
    6366/**
    6467   \brief multiply a vector with a float
    65    \param v: the factor
     68   \param f: the factor
     69   \return the vector multipied by f
    6670*/
    6771Vector Vector::operator* (float f) const
     
    7882/**
    7983   \brief divide a vector with a float
    80    \param v: the factor
     84   \param f: the divisor
     85   \return the vector divided by f   
    8186*/
    8287Vector Vector::operator/ (float f) const
     
    100105   \brief calculate the dot product of two vectors
    101106   \param v: the other vector
     107   \return the dot product of the vectors
    102108*/
    103109float Vector::dot (const Vector& v) const
     
    107113
    108114/**
    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
    111118*/
    112119Vector Vector::cross (const Vector& v) const
     
    122129 
    123130/**
    124    \brief normalize the vector to lenght 1.0
     131   \brief normalizes the vector to lenght 1.0
    125132*/
    126133void Vector::normalize ()
     
    140147 
    141148/**
    142    \brief calculate the lenght of the vector
     149   \brief calculates the lenght of the vector
     150   \return the lenght of the vector
    143151*/
    144152float Vector::len () const
     
    151159   \param v1: a vector
    152160   \param v2: another vector
     161   \return the angle between the vectors in radians
    153162*/
    154163float angle_rad (const Vector& v1, const Vector& v2)
     
    161170   \param v1: a vector
    162171   \param v2: another vector
     172   \return the angle between the vectors in degrees
    163173*/
    164174float angle_deg (const Vector& v1, const Vector& v2)
     
    240250
    241251/**
    242    \brief creates a nullrotation
     252   \brief creates a nullrotation (an identity rotation)
    243253*/
    244254Rotation::Rotation ()
     
    259269   \param v: a vector
    260270   \param r: a rotation
     271   \return the rotated vector
    261272*/
    262273Vector rotate_vector( const Vector& v, const Rotation& r)
     
    274285   \brief calculate the distance between two lines
    275286   \param l: the other line
     287   \return the distance between the lines
    276288*/
    277289float Line::distance (const Line& l) const
     
    288300   \brief calculate the distance between a line and a point
    289301   \param v: the point
     302   \return the distance between the Line and the point
    290303*/
    291304float Line::distance_point (const Vector& v) const
     
    299312   \brief calculate the two points of minimal distance of two lines
    300313   \param l: the other line
     314   \return a Vector[2] (!has to be deleted after use!) containing the two points of minimal distance
    301315*/
    302316Vector* Line::footpoints (const Line& l) const
     
    311325
    312326/**
    313    \brief calculate the length of a line
     327  \brief calculate the length of a line
     328  \return the lenght of the line
    314329*/
    315330float Line::len() const
     
    331346
    332347/**
    333    \brief create a plane from three lines
     348   \brief create a plane from three points
    334349   \param a: first point
    335350   \param b: second point
     
    367382   \brief returns the distance between the plane and a point
    368383   \param p: a Point
     384   \return the distance between the plane and the point (can be negative)
    369385*/
    370386float Plane::distance_point (const Vector& p) const
     
    376392
    377393/**
    378    \brief returns the side a point is located relative to a plane
     394   \brief returns the side a point is located relative to a Plane
    379395   \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
    380397*/
    381398float Plane::locate_point (const Vector& p) const
Note: See TracChangeset for help on using the changeset viewer.