Changeset 3958 in orxonox.OLD for orxonox/branches/particleEngine/src/lib/math/vector.h
- Timestamp:
- Apr 25, 2005, 2:49:51 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/math/vector.h
r3951 r3958 31 31 32 32 inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); } 33 inline const Vector operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;} 33 34 inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); } 35 inline const Vector operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;} 34 36 inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; } 37 inline const Vector operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;} 35 38 inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); } 39 inline const Vector operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;} 36 40 Vector operator/ (float f) const; 41 inline const Vector operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;} 37 42 float dot (const Vector& v) const; 38 inline Vector cross (const Vector& v) const { 43 inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); } 39 44 void scale(const Vector& v); 40 45 inline float len() const { return sqrt (x*x+y*y+z*z); } … … 50 55 z = z / l; 51 56 } 52 Vector*getNormalized();57 const Vector getNormalized(); 53 58 Vector abs(); 54 59
Note: See TracChangeset
for help on using the changeset viewer.