Revision 162,
459 bytes
checked in by bittner, 19 years ago
(diff) |
functional raycasting version
|
Rev | Line | |
---|
[162] | 1 | #ifndef _Plane3_H__ |
---|
| 2 | #define _Plane3_H__ |
---|
| 3 | |
---|
| 4 | #include "Vector3.h" |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | /** 3D Plane */ |
---|
| 8 | class Plane3 { |
---|
| 9 | public: |
---|
| 10 | Vector3 mNormal; |
---|
| 11 | float mD; |
---|
| 12 | |
---|
| 13 | Plane3() {} |
---|
| 14 | |
---|
| 15 | Plane3(const Vector3 &a, |
---|
| 16 | const Vector3 &b, |
---|
| 17 | const Vector3 &c |
---|
| 18 | ) { |
---|
| 19 | Vector3 v1=a-b, v2=c-b; |
---|
| 20 | mNormal = Normalize(CrossProd(v2,v1)); |
---|
| 21 | mD = -DotProd(b, mNormal); |
---|
| 22 | |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | friend ostream &operator<<(ostream &s, const Plane3 p) { |
---|
| 26 | s<<p.mNormal<<" "<<p.mD; |
---|
| 27 | return s; |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | }; |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.