diff --git a/.vs/3dMath/v15/.suo b/.vs/3dMath/v15/.suo index ba30555..7e1982f 100644 Binary files a/.vs/3dMath/v15/.suo and b/.vs/3dMath/v15/.suo differ diff --git a/GMath.cpp b/GMath.cpp index 7d09e3a..dd8b1d9 100644 --- a/GMath.cpp +++ b/GMath.cpp @@ -1062,3 +1062,25 @@ GPoint3 GLine::operator()(const float t) const { return p + v*t; } + +GLine & GLine::SetPt(const GPoint3 & _p) +{ + p = _p; + return *this; +} + +GLine & GLine::SetDir(const GVector3 & _v) +{ + v = _v; + return *this; +} + +GVector3 GLine::GetPt() const +{ + return p; +} + +GVector3 GLine::GetDir() const +{ + return v; +} diff --git a/GMath.h b/GMath.h index 9dc7475..ff9532a 100644 --- a/GMath.h +++ b/GMath.h @@ -216,4 +216,10 @@ public: GLine& operator =(const GLine& rhs); GPoint3 operator ()(const float t) const; + + GLine& SetPt(const GPoint3& _p); + GLine& SetDir(const GVector3& _v); + + GVector3 GetPt() const; + GVector3 GetDir() const; }; \ No newline at end of file diff --git a/main.cpp b/main.cpp index 720e3a7..d004704 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,11 @@ int main() { GPoint3 p = l(2.0f); - cout << p << endl; + l.SetPt(GPoint3(0.0f, 0.0f, 1.0f)); + l.SetDir(GVector3(1.0f, 0.0f, 0.0f)); + + GPoint3 q = l(1.0f); + + cout << q << endl; return 0; } \ No newline at end of file