diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-11-01 23:32:22 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-11-01 23:32:22 +0800 |
commit | f68cc9034a576b6f91cf0db0344ece971944c973 (patch) | |
tree | 123744e85445f51d058b74d9c9fb2174f6abefd7 /archive/hgehelp/hgerect.cpp | |
parent | 1981e9bc81e92f479c725e6ac60ff3bd419cefd0 (diff) | |
download | bullet-lab-remix-f68cc9034a576b6f91cf0db0344ece971944c973.tar.xz |
Move hge to an archive.
Finish the main part of smPath.
This is a C++ project, add C++ tags to all source code that
could be identified as C source files.
Diffstat (limited to 'archive/hgehelp/hgerect.cpp')
-rw-r--r-- | archive/hgehelp/hgerect.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/archive/hgehelp/hgerect.cpp b/archive/hgehelp/hgerect.cpp deleted file mode 100644 index 303286c..0000000 --- a/archive/hgehelp/hgerect.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeRect helper class implementation -*/ - - -#include "hgerect.h" -#include <math.h> - - -void hgeRect::Encapsulate(float x, float y) -{ - if(bClean) - { - x1=x2=x; - y1=y2=y; - bClean=false; - } - else - { - if(x<x1) x1=x; - if(x>x2) x2=x; - if(y<y1) y1=y; - if(y>y2) y2=y; - } -} - -bool hgeRect::TestPoint(float x, float y) const -{ - if(x>=x1 && x<x2 && y>=y1 && y<y2) return true; - - return false; -} - -bool hgeRect::Intersect(const hgeRect *rect) const -{ - if(fabs(x1 + x2 - rect->x1 - rect->x2) < (x2 - x1 + rect->x2 - rect->x1)) - if(fabs(y1 + y2 - rect->y1 - rect->y2) < (y2 - y1 + rect->y2 - rect->y1)) - return true; - - return false; -} |