diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-04-02 13:12:38 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-04-02 13:12:38 +0000 |
commit | 9884abca9d646fe3b27d95efc3a6d2211de45968 (patch) | |
tree | d2cb9a7b2a00e6d2b4dbdfcaad4fa7c7cbb02e55 /towernbullet.h | |
parent | 4f8c05c5dac35b386fdfe09d2f3d086fcc2cbada (diff) | |
download | bullet-lab-remix-9884abca9d646fe3b27d95efc3a6d2211de45968.tar.xz |
New level, modify laser.
Diffstat (limited to 'towernbullet.h')
-rw-r--r-- | towernbullet.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/towernbullet.h b/towernbullet.h index 3fc2fcd..2cba49c 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -1559,16 +1559,16 @@ private: vector2d data1[MaxRes],data2[MaxRes]; double GetDist() { - double res=99999.9999f; - double tres=99999.9999f; + double res=99999.9999f,tres; + static vector2d correction=vector2d(8.4,8.4); for (int i=0;i<Res-1;++i) { vector2d sa,sb; sa=data1[i]+RenCtr;sb=data1[i+1]+RenCtr; - tres=GetDistSeg(sa,sb,playerpos); + tres=GetDistSeg(sa,sb,playerpos+correction); sa=data2[i]+RenCtr;sb=data2[i+1]+RenCtr; - if(GetDistSeg(sa,sb,playerpos)<tres) - tres=GetDistSeg(sa,sb,playerpos); + if(GetDistSeg(sa,sb,playerpos+correction)<tres) + tres=GetDistSeg(sa,sb,playerpos+correction); if (tres<res)res=tres; } return res; @@ -1631,7 +1631,7 @@ public: Render(); if (EnableColl) { - if (GetDist()<4.0f&&clrrange<1e-5&&clrrad-pi/2<1e-7) + if (GetDist()<3.0f&&clrrange<1e-5&&clrrad-pi/2<1e-7) { if (!LOWFPS)++collbrk;else collbrk+=17; if (collbrk>200) @@ -2828,3 +2828,35 @@ public: } } }; +class LineLaser:public Laser +{ +protected: + double width; + vector2d a,b; + DWORD color; +public: + void SetColl(bool col){EnableColl=col;} + void InitLine(vector2d _a,vector2d _b,double _w,DWORD _c) + { + a=_a;b=_b;color=_c;Init(2); + SetTexture(SprSheet,151,264,2,8); + SetWidth(_w);RenCtr=vector2d(0,0); + } + void SetWidth(double _w) + { + width=_w; + vector2d dir(a-b);dir.ToUnitCircle(); + vector2d pd=dir;pd.Rotate(pi/2); + Setdata(0,a-width*pd,a+width*pd,color); + for(int i=1;i<MaxRes;++i)Setdata(i,b-width*pd,b+width*pd,color); + } + double GetWidth(){return width;} + //use Laser::Process... +}; +class SimpLL:public LineLaser +{ +public: + bool active; + int stp; + double brk; +}; |