Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 14, 2008, 1:03:48 PM (17 years ago)
Author:
rgrieder
Message:

svn save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/util/Math.h

    r1768 r1777  
    6464_UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
    6565_UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);
    66 
    67 /////////////////////////////////////
    68 // Conversion Functions of our own //
    69 /////////////////////////////////////
    70 
    71 // Vector2 to std::string
    72 //inline bool explicitConversion(std::string* output, const orxonox::Vector2& input)
    73 //{
    74 //    std::ostringstream ostream;
    75 //    if (ostream << input.x << "," << input.y)
    76 //    {
    77 //        (*output) = ostream.str();
    78 //        return true;
    79 //    }
    80 //    return false;
    81 //}
    82 
    83 // Vector3 to std::string
    84 inline bool explicitConversion(std::string* output, const orxonox::Vector3& input)
    85 {
    86     std::ostringstream ostream;
    87     if (ostream << input.x << "," << input.y << "," << input.z)
    88     {
    89         (*output) = ostream.str();
    90         return true;
    91     }
    92     return false;
    93 }
    94 
    95 // Vector4 to std::string
    96 inline bool explicitConversion(std::string* output, const orxonox::Vector4& input)
    97 {
    98     std::ostringstream ostream;
    99     if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
    100     {
    101         (*output) = ostream.str();
    102         return true;
    103     }
    104     return false;
    105 }
    106 
    107 // Quaternion to std::string
    108 inline bool explicitConversion(std::string* output, const orxonox::Quaternion& input)
    109 {
    110     std::ostringstream ostream;
    111     if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
    112     {
    113         (*output) = ostream.str();
    114         return true;
    115     }
    116     return false;
    117 }
    118 
    119 // ColourValue to std::string
    120 inline bool explicitConversion(std::string* output, const orxonox::ColourValue& input)
    121 {
    122     std::ostringstream ostream;
    123     if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
    124     {
    125         (*output) = ostream.str();
    126         return true;
    127     }
    128     return false;
    129 }
    130 
    131 //// ColourValue to std::string
    132 //inline bool explicitConversion(std::string* output, const orxonox::ColourValue& input)
    133 //{
    134 //    std::ostringstream ostream;
    135 //    if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
    136 //    {
    137 //        (*output) = ostream.str();
    138 //        return true;
    139 //    }
    140 //    return false;
    141 //}
    142 
    143 // std::string to Vector2
    144 _UtilExport bool explicitConversion(orxonox::Vector2* output, const std::string& input);
    145 // std::string to Vector3
    146 _UtilExport bool explicitConversion(orxonox::Vector3* output, const std::string& input);
    147 // std::string to Vector4
    148 _UtilExport bool explicitConversion(orxonox::Vector4* output, const std::string& input);
    149 // std::string to Quaternion
    150 _UtilExport bool explicitConversion(orxonox::Quaternion* output, const std::string& input);
    151 // std::string to ColourValue
    152 _UtilExport bool explicitConversion(orxonox::ColourValue* output, const std::string& input);
    15366
    15467template <typename T>
Note: See TracChangeset for help on using the changeset viewer.