Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7919 in orxonox.OLD for trunk/src/lib/math


Ignore:
Timestamp:
May 28, 2006, 3:48:13 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the gui branche back
merged with command:
https://svn.orxonox.net/orxonox/branches/gui
no conflicts

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/math/Makefile.am

    r7033 r7919  
    1313                plane.cc \
    1414                line.cc \
     15                rect2D.cc \
    1516                rotation_OBSOLETE.cc
    1617
     
    2324                plane.h \
    2425                line.h \
     26                rect2D.h \
    2527                rotation_OBSOLETE.h
  • trunk/src/lib/math/vector2D.h

    r6616 r7919  
    2424#define __VECTOR2D_H_
    2525
    26 #include <math.h>
     26#include <cmath>
    2727#include "compiler.h"
    2828
     
    4040
    4141  /** @param v: the Vecor to compare with this one @returns true, if the Vecors are the same, false otherwise */
    42   inline bool operator== (const Vector2D& v) const { return (this->x==v.x && this->y==v.y)?true:false; };
     42  inline bool operator== (const Vector2D& v) const { return (this->x==v.x && this->y==v.y); };
     43  /** @param v: the Vector to negative-compare with this one @returns true if the two vectors are different */
     44  inline bool operator!= (const Vector2D& v) const { return (this->x!=v.x && this->y!=v.y); };
    4345  /** @param index The index of the "array" @returns the x/y coordinate */
    4446  inline float operator[] (float index) const { return ( index == 0)? this->x : this->y; }
     
    7779  /** @param v: the other vector \return the dot product of the vectors */
    7880  float dot (const Vector2D& v) const { return x*v.x+y*v.y; };
     81  /** @param v multipy each entry with each other @returns this reference */
     82  const Vector2D& internalMultipy(const Vector2D& v) { this->x *= v.x; this->y *= y; };
    7983  /** scales the this vector with v* @param v the vector to scale this with */
    8084  void scale(const Vector2D& v) {   x *= v.x;  y *= v.y; };
     
    8589  Vector2D getNormalized() const;
    8690  Vector2D abs();
     91
     92  /** @param v the Vector to slerp to @param val 0 = stay 1 = at v */
     93  void slerp(const Vector2D& v, float val) { *this += (*this - v) * val; }
    8794
    8895  void debug() const;
Note: See TracChangeset for help on using the changeset viewer.