Last change
on this file since 8150 was
6617,
checked in by bensch, 19 years ago
|
trunk: split Rotation/Line/Quaternion/Plane(Rectangle) into seperate files
|
File size:
1.2 KB
|
Line | |
---|
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 | |
---|
16 | /*! |
---|
17 | * @file line.h |
---|
18 | * A basic 3D math line framework |
---|
19 | * |
---|
20 | * Contains class to handle lines |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef __LINE_H_ |
---|
24 | #define __LINE_H_ |
---|
25 | |
---|
26 | #include <math.h> |
---|
27 | #include "compiler.h" |
---|
28 | #include "vector.h" |
---|
29 | #include "rotation_OBSOLETE.h" |
---|
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: |
---|
40 | |
---|
41 | Vector r; //!< Offset |
---|
42 | Vector a; //!< Direction |
---|
43 | |
---|
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 () {} |
---|
47 | |
---|
48 | float distance (const Line& l) const; |
---|
49 | float distancePoint (const Vector& v) const; |
---|
50 | float distancePoint (const sVec3D& v) const; |
---|
51 | Vector* footpoints (const Line& l) const; |
---|
52 | float len () const; |
---|
53 | |
---|
54 | void rotate(const Rotation& rot); |
---|
55 | }; |
---|
56 | |
---|
57 | |
---|
58 | #endif /* __LINE_H_ */ |
---|
59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.