Last change
on this file since 7832 was
6617,
checked in by bensch, 19 years ago
|
trunk: split Rotation/Line/Quaternion/Plane(Rectangle) into seperate files
|
File size:
1.2 KB
|
Rev | Line | |
---|
[5420] | 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: Christian Meyer |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
[4578] | 16 | /*! |
---|
[6617] | 17 | * @file line.h |
---|
| 18 | * A basic 3D math line framework |
---|
[5008] | 19 | * |
---|
[6617] | 20 | * Contains class to handle lines |
---|
[4578] | 21 | */ |
---|
[2043] | 22 | |
---|
[6617] | 23 | #ifndef __LINE_H_ |
---|
| 24 | #define __LINE_H_ |
---|
[2043] | 25 | |
---|
| 26 | #include <math.h> |
---|
[3860] | 27 | #include "compiler.h" |
---|
[6617] | 28 | #include "vector.h" |
---|
| 29 | #include "rotation_OBSOLETE.h" |
---|
[2043] | 30 | |
---|
| 31 | //! 3D line |
---|
| 32 | /** |
---|
| 33 | Class to store Lines in 3-dimensional space |
---|
| 34 | |
---|
| 35 | Supports line-to-line distance measurements and rotation |
---|
| 36 | */ |
---|
| 37 | class Line |
---|
| 38 | { |
---|
| 39 | public: |
---|
[4578] | 40 | |
---|
[2043] | 41 | Vector r; //!< Offset |
---|
| 42 | Vector a; //!< Direction |
---|
[4578] | 43 | |
---|
[2043] | 44 | Line ( Vector r, Vector a) : r(r), a(a) {} //!< assignment constructor |
---|
| 45 | Line () : r(Vector(0,0,0)), a(Vector (1,1,1)) {} |
---|
| 46 | ~Line () {} |
---|
[4578] | 47 | |
---|
[2043] | 48 | float distance (const Line& l) const; |
---|
[3228] | 49 | float distancePoint (const Vector& v) const; |
---|
[4578] | 50 | float distancePoint (const sVec3D& v) const; |
---|
[2043] | 51 | Vector* footpoints (const Line& l) const; |
---|
| 52 | float len () const; |
---|
[4578] | 53 | |
---|
[2043] | 54 | void rotate(const Rotation& rot); |
---|
| 55 | }; |
---|
| 56 | |
---|
[4578] | 57 | |
---|
[6617] | 58 | #endif /* __LINE_H_ */ |
---|
[4578] | 59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.