Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8731 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jun 22, 2006, 4:28:18 PM (19 years ago)
Author:
bensch
Message:

new player

Location:
trunk/src/lib/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/math/quaternion.cc

    r8724 r8731  
    216216
    217217/**
    218  * @returns the heading
     218 * @returns the Heading
    219219 */
    220220float Quaternion::getHeading() const
     
    230230
    231231/**
     232 * @returns the Heading-Quaternion
     233 */
     234Quaternion Quaternion::getHeadingQuat() const
     235{
     236  return Quaternion(this->getHeading(), Vector(0,1,0));
     237}
     238
     239/**
    232240 * @returns the Attitude
    233241 */
     
    236244  return asin(2.0 * (v.x*v.y + v.z*w));
    237245}
     246
     247/**
     248 * @returns the Attitude-Quaternion
     249 */
     250Quaternion Quaternion::getAttitudeQuat() const
     251{
     252  return Quaternion(this->getAttitude(), Vector(0,0,1));
     253}
     254
    238255
    239256/**
     
    247264    return 0.0f;
    248265}
     266
     267/**
     268 * @returns the Bank-Quaternion
     269 */
     270Quaternion Quaternion::getBankQuat() const
     271{
     272  return Quaternion(this->getBank(), Vector(1,0,0));
     273}
     274
    249275
    250276
  • trunk/src/lib/math/quaternion.h

    r8724 r8731  
    9898
    9999  float getHeading() const;
     100  Quaternion getHeadingQuat() const;
    100101  float getAttitude() const;
     102  Quaternion getAttitudeQuat() const;
    101103  float getBank() const;
     104  Quaternion getBankQuat() const;
    102105  /** @returns the rotational axis of this Quaternion */
    103106  inline Vector getSpacialAxis() const { return this->v / sin(acos(w));/*sqrt(v.x*v.x + v.y*v.y + v.z+v.z);*/ };
Note: See TracChangeset for help on using the changeset viewer.