diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-02-13 16:32:47 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-02-13 16:32:47 +0000 |
commit | 5422ce494b3a83ece8f12156e7498cc9ce313539 (patch) | |
tree | d6c46fee655505736079ccdccacf93c6d7cc5fb0 /libcgh.h | |
parent | 2748b33cd1330cc3da99ed62cd17859342079773 (diff) | |
download | bullet-lab-remix-5422ce494b3a83ece8f12156e7498cc9ce313539.tar.xz |
M resources/ss.png
M trunk/CHANGELOG.TXT
M trunk/VERSION.TXT
M trunk/global.h
M trunk/levels.h
M trunk/libcgh.h
M trunk/main.cpp
M trunk/towernbullet.h
Diffstat (limited to 'libcgh.h')
-rw-r--r-- | libcgh.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,7 +1,7 @@ //Chrisoft Bullet Lab Remix HGE //Chrisoft Game Helper header //"Copyleft" Chrisoft 2013 -//libcgh version 0002 +//libcgh version 0003 //^Modify that when big change is made^ #include <hge.h> #include <hgefont.h> @@ -19,6 +19,12 @@ struct vector2d double x,y; vector2d(double _x,double _y){x=_x;y=_y;} vector2d(){x=y=0;} + void ToUnitCircle() + { + double l=sqrt(sqr(x)+sqr(y)); + x/=l;y/=l; + } + void Swap(){double t=x;x=y;y=t;} friend vector2d operator -(vector2d a,vector2d b) { return vector2d(a.x-b.x,a.y-b.y); |