|
@ -21,6 +21,7 @@ using namespace std; |
|
|
class GVector3; |
|
|
class GVector3; |
|
|
class GVector; |
|
|
class GVector; |
|
|
class GMatrix; |
|
|
class GMatrix; |
|
|
|
|
|
class GPlane; |
|
|
typedef GVector3 GPoint3; |
|
|
typedef GVector3 GPoint3; |
|
|
|
|
|
|
|
|
class GVector3 { |
|
|
class GVector3 { |
|
@ -226,3 +227,18 @@ public: |
|
|
bool IsOnLine(const GPoint3& q); |
|
|
bool IsOnLine(const GPoint3& q); |
|
|
friend float dist(const GPoint3& q, const GLine& l); |
|
|
friend float dist(const GPoint3& q, const GLine& l); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class GPlane { |
|
|
|
|
|
private: |
|
|
|
|
|
//ax+by+cz+d=0 a b c 其实就是法线,d是平面上的一点点乘法线再取负号 |
|
|
|
|
|
GVector3 n; |
|
|
|
|
|
float d; |
|
|
|
|
|
public: |
|
|
|
|
|
GPlane(const GVector3& _n = GVector3(0.0f, 0.0f, 0.0f), const GPoint3& _p = GVector3(0.0f, 0.0f, 0.0f)); |
|
|
|
|
|
GPlane(const GPoint3& p1, const GPoint3& p2, const GPoint3& p3); |
|
|
|
|
|
GPlane(const float& a, const float& b, const float&c, const float& d); |
|
|
|
|
|
GPlane(const GPlane& copy); |
|
|
|
|
|
|
|
|
|
|
|
GPlane& operator =(const GPlane& rhs); |
|
|
|
|
|
GVector3 GetNormal() const; |
|
|
|
|
|
}; |