Changeset 5673 in orxonox.OLD for trunk/src/lib/math
- Timestamp:
- Nov 21, 2005, 4:02:23 PM (19 years ago)
- Location:
- trunk/src/lib/math
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/matrix.cc
r5670 r5673 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: Patrick Boenzli 14 */ 15 #include "matrix.h" 1 16 2 17 #include <stdio.h> 3 18 #include <math.h> 4 #include "matrix.h"5 19 6 20 -
trunk/src/lib/math/matrix.h
r5668 r5673 1 /*! 2 * @file matrix.h 3 * @brief Definition of a 3x3 matrix. 4 */ 5 1 6 #include <math.h> 2 3 /// @todo TAKE THIS OUT 4 class Vector 5 { 6 public: 7 Vector() {this->x = this->y = this->z = 0; }; 8 Vector (float x, float y, float z) { this->x=x; this->y = y; this->z = z; }; 9 inline const Vector& operator/= (float f) {if ((f == 0.0)) {this->x=0;this->y=0;this->z=0;} else {this->x /= f; this->y /= f; this->z /= f;} return *this; }; 10 11 float x, y, z; 12 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 ); } 13 inline float len() const { return sqrt (x*x+y*y+z*z); } 14 }; 15 7 #include "vector.h" 16 8 17 9
Note: See TracChangeset
for help on using the changeset viewer.