From 5422ce494b3a83ece8f12156e7498cc9ce313539 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Thu, 13 Feb 2014 16:32:47 +0000 Subject: 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 --- libcgh.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libcgh.h') diff --git a/libcgh.h b/libcgh.h index 00ad967..943601f 100644 --- a/libcgh.h +++ b/libcgh.h @@ -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 #include @@ -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); -- cgit v1.2.3