Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 16, 2008, 3:46:25 AM (16 years ago)
Author:
landauf
Message:

added comments to all my classes in util

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/Math.cc

    r1625 r1791  
    2727 */
    2828
     29/**
     30    @file Math.cc
     31    @brief Implementation of several math-functions.
     32*/
     33
    2934#include <OgrePlane.h>
    3035
     
    3338
    3439/**
    35     @brief Function for writing to a stream.
     40    @brief Function for writing a Radian to a stream.
    3641*/
    3742std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian)
     
    4247
    4348/**
    44     @brief Function for reading from a stream.
     49    @brief Function for reading a Radian from a stream.
    4550*/
    4651std::istream& operator>>(std::istream& in, orxonox::Radian& radian)
     
    5358
    5459/**
    55     @brief Function for writing to a stream.
     60    @brief Function for writing a Degree to a stream.
    5661*/
    5762std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)
     
    6267
    6368/**
    64     @brief Function for reading from a stream.
     69    @brief Function for reading a Degree from a stream.
    6570*/
    6671std::istream& operator>>(std::istream& in, orxonox::Degree& degree)
     
    7378
    7479
     80/**
     81    @brief Gets the angle between my viewing direction and the direction to the position of the other object.
     82    @param myposition My position
     83    @param mydirection My viewing direction
     84    @param otherposition The position of the other object
     85    @return The angle
     86
     87    @example
     88    If the other object is exactly in front of me, the function returns 0.
     89    If the other object is exactly behind me, the function returns pi.
     90    If the other object is exactly right/left to me (or above/below), the function returns pi/2.
     91*/
    7592float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition)
    7693{
     
    83100}
    84101
     102/**
     103    @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object.
     104    @param myposition My position
     105    @param mydirection My viewing direction
     106    @param myorthonormal My orthonormalvector (pointing upwards through my head)
     107    @param otherposition The position of the other object
     108    @return The viewing direction
     109
     110    @example
     111    If the other object is exactly in front of me, the function returns Vector2(0, 0).
     112    If the other object is exactly at my left, the function returns Vector2(-1, 0).
     113    If the other object is exactly at my right, the function returns Vector2(1, 0).
     114    If the other object is only a bit at my right, the function still returns Vector2(1, 0).
     115    If the other object is exactly above me, the function returns Vector2(0, 1).
     116*/
    85117orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
    86118{
     
    100132}
    101133
     134/**
     135    @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0° = 0, 180° = 1).
     136    @param myposition My position
     137    @param mydirection My viewing direction
     138    @param myorthonormal My orthonormalvector (pointing upwards through my head)
     139    @param otherposition The position of the other object
     140    @return The viewing direction
     141
     142    @example
     143    If the other object is exactly in front of me, the function returns Vector2(0, 0).
     144    If the other object is exactly at my left, the function returns Vector2(-0.5, 0).
     145    If the other object is exactly at my right, the function returns Vector2(0.5, 0).
     146    If the other object is only a bit at my right, the function still returns Vector2(0.01, 0).
     147    If the other object is exactly above me, the function returns Vector2(0, 0.5).
     148*/
    102149orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
    103150{
     
    121168}
    122169
     170/**
     171    @brief Returns the predicted position I have to aim at, if I want to hit a moving target with a moving projectile.
     172    @param myposition My position
     173    @param projectilespeed The speed of my projectile
     174    @param targetposition The position of my target
     175    @param targetvelocity The velocity of my target
     176    @return The predicted position
     177
     178    The function predicts the position based on a linear velocity of the target. If the target changes speed or direction, the projectile will miss.
     179*/
    123180orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity)
    124181{
Note: See TracChangeset for help on using the changeset viewer.