Changeset 7919 in orxonox.OLD for trunk/src/lib/math
- Timestamp:
- May 28, 2006, 3:48:13 PM (19 years ago)
- Location:
- trunk/src/lib/math
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/Makefile.am
r7033 r7919 13 13 plane.cc \ 14 14 line.cc \ 15 rect2D.cc \ 15 16 rotation_OBSOLETE.cc 16 17 … … 23 24 plane.h \ 24 25 line.h \ 26 rect2D.h \ 25 27 rotation_OBSOLETE.h -
trunk/src/lib/math/vector2D.h
r6616 r7919 24 24 #define __VECTOR2D_H_ 25 25 26 #include < math.h>26 #include <cmath> 27 27 #include "compiler.h" 28 28 … … 40 40 41 41 /** @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); }; 43 45 /** @param index The index of the "array" @returns the x/y coordinate */ 44 46 inline float operator[] (float index) const { return ( index == 0)? this->x : this->y; } … … 77 79 /** @param v: the other vector \return the dot product of the vectors */ 78 80 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; }; 79 83 /** scales the this vector with v* @param v the vector to scale this with */ 80 84 void scale(const Vector2D& v) { x *= v.x; y *= v.y; }; … … 85 89 Vector2D getNormalized() const; 86 90 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; } 87 94 88 95 void debug() const;
Note: See TracChangeset
for help on using the changeset viewer.