From 5bfb6da40fdfad2d9953a8cd6d12114438a4ac51 Mon Sep 17 00:00:00 2001 From: blobt Date: Thu, 11 Feb 2021 14:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E7=BA=BF=E7=B1=BB=E5=A2=9E=E5=8A=A0se?= =?UTF-8?q?t=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/3dMath/v15/.suo | Bin 37888 -> 38400 bytes GMath.cpp | 22 ++++++++++++++++++++++ GMath.h | 6 ++++++ main.cpp | 7 ++++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.vs/3dMath/v15/.suo b/.vs/3dMath/v15/.suo index ba305557f9ad229369239bce88eae6d3cfc87875..7e1982f71e23220e9362071f91b9664b6fe5b931 100644 GIT binary patch delta 623 zcmY*WO=}ZT6rKC>oMhrmXy~LZG119~fz~!Ag(}!s7ZHOWv?;m}6qUBpU7;{8)!7J| zM$z1VFe?|`IPV9fWo9j8<)RyZfXhL2lkvWgmU!Xt-aY5MGxyDNzB1>KeXix1GOj5_ zNzzvK!zhX*8^eA6{M(C1;IRiB3>+{ku~soxl^;+NuhfT-SRxmhBOJ_^F^oUf+y}Zun*M#7hP-4AKoZrT6B1L&=g> z80+$LBAiQsV7Vc9xh5EJm9$F}I@o3L54G(apSk>h<(gZo`=;n5@t#cyO2~va$ zI-p}(!ZORiXGuCuMmy8>sy;sl@@Jf};c{D_C!#cwf_Cc@vh1;;l!;xKRKjcr{auFT2B#KUPY5zgK4y#{q77i~d*<$0ZinO3%|$%AHYFOp0RC(K0X1p3 A{r~^~ delta 581 zcmYjOK}%af5Z+l|US5(H(2~T6+C)vmvqa4cw1Q|4zO+eeF^V~~crZevo`k|HdXeT- zMBCD2F5)q#9(w8S*($_CsZc0Acx(F;JmgXZ<189*;A3XK`R3bQw(^BnKJ!m${Pxla zvrfhg#uz7DwpuMp4DhwK^tDt3!JliO;Q){MDi^d9Zyq0WWgWIy1G@%~%i$Mp_nL4Pa zOc5eK)=kRbtyOfxg&-RxM!l(hN??W>bpi$2<7N43LV%1!GhoDtYRk~=DPTjl^*oUl zljpG?fZ1HS_CTwq4KeC~hXs_yubm-GbDwm_-t(H3H@s~V7`Ei5wGARe_oREH`}m{e zeU~8ep)Q|JG8MY)-}o2sYg9fWWZ&X$X%-L5KK#3E$#>;H5V`13LKSC+NfO?nD!X-~ z)A8qOrasHDT8_%-+6nZj@pTwSCsee*O}U_5Sd}a5`?31AhSS9q9zE=oleJ^G0%I1f Au>b%7 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