From 98437cad0a3a59245e5fe772d4e310de4228757a Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 19 Apr 2012 09:41:27 +0100 Subject: cleaning up --- gaunt01/bin/data/Bird-anim.xml | Bin 0 -> 2638 bytes gaunt01/bin/data/Bird-poses.xml | 193 +++++++++++++++++++++++++++++++++++++ gaunt01/bin/data/Drops_1.tga | Bin 0 -> 76044 bytes gaunt01/bin/data/Drops_2.tga | Bin 0 -> 76044 bytes gaunt01/bin/data/Drops_3.tga | Bin 0 -> 76044 bytes gaunt01/bin/data/GUI_gotya.png | Bin 0 -> 35986 bytes gaunt01/bin/data/GUI_nzsLogo.png | Bin 0 -> 27745 bytes gaunt01/bin/data/GUI_objective.png | Bin 0 -> 79773 bytes gaunt01/bin/data/GUI_title.png | Bin 0 -> 39748 bytes gaunt01/src/outsidePolygon.cpp | 35 +++++++ gaunt01/src/outsidePolygon.h | 5 + gaunt01/src/testApp.cpp | 32 ------ gaunt01/src/testApp.h | 1 + 13 files changed, 234 insertions(+), 32 deletions(-) create mode 100644 gaunt01/bin/data/Bird-anim.xml create mode 100644 gaunt01/bin/data/Bird-poses.xml create mode 100644 gaunt01/bin/data/Drops_1.tga create mode 100644 gaunt01/bin/data/Drops_2.tga create mode 100644 gaunt01/bin/data/Drops_3.tga create mode 100644 gaunt01/bin/data/GUI_gotya.png create mode 100644 gaunt01/bin/data/GUI_nzsLogo.png create mode 100644 gaunt01/bin/data/GUI_objective.png create mode 100644 gaunt01/bin/data/GUI_title.png create mode 100644 gaunt01/src/outsidePolygon.cpp create mode 100644 gaunt01/src/outsidePolygon.h (limited to 'gaunt01') diff --git a/gaunt01/bin/data/Bird-anim.xml b/gaunt01/bin/data/Bird-anim.xml new file mode 100644 index 0000000..3c7e0b3 Binary files /dev/null and b/gaunt01/bin/data/Bird-anim.xml differ diff --git a/gaunt01/bin/data/Bird-poses.xml b/gaunt01/bin/data/Bird-poses.xml new file mode 100644 index 0000000..a4adb92 --- /dev/null +++ b/gaunt01/bin/data/Bird-poses.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gaunt01/bin/data/Drops_1.tga b/gaunt01/bin/data/Drops_1.tga new file mode 100644 index 0000000..0aac86c Binary files /dev/null and b/gaunt01/bin/data/Drops_1.tga differ diff --git a/gaunt01/bin/data/Drops_2.tga b/gaunt01/bin/data/Drops_2.tga new file mode 100644 index 0000000..9fea7db Binary files /dev/null and b/gaunt01/bin/data/Drops_2.tga differ diff --git a/gaunt01/bin/data/Drops_3.tga b/gaunt01/bin/data/Drops_3.tga new file mode 100644 index 0000000..4cebeb0 Binary files /dev/null and b/gaunt01/bin/data/Drops_3.tga differ diff --git a/gaunt01/bin/data/GUI_gotya.png b/gaunt01/bin/data/GUI_gotya.png new file mode 100644 index 0000000..3542bf0 Binary files /dev/null and b/gaunt01/bin/data/GUI_gotya.png differ diff --git a/gaunt01/bin/data/GUI_nzsLogo.png b/gaunt01/bin/data/GUI_nzsLogo.png new file mode 100644 index 0000000..ecf3750 Binary files /dev/null and b/gaunt01/bin/data/GUI_nzsLogo.png differ diff --git a/gaunt01/bin/data/GUI_objective.png b/gaunt01/bin/data/GUI_objective.png new file mode 100644 index 0000000..39e784f Binary files /dev/null and b/gaunt01/bin/data/GUI_objective.png differ diff --git a/gaunt01/bin/data/GUI_title.png b/gaunt01/bin/data/GUI_title.png new file mode 100644 index 0000000..c7c3ce3 Binary files /dev/null and b/gaunt01/bin/data/GUI_title.png differ diff --git a/gaunt01/src/outsidePolygon.cpp b/gaunt01/src/outsidePolygon.cpp new file mode 100644 index 0000000..8f9b61e --- /dev/null +++ b/gaunt01/src/outsidePolygon.cpp @@ -0,0 +1,35 @@ +#include "outsidePolygon.h" + + +bool OutsidePolygon(vector& polygon,ofPoint p) +//thanks to Paul Bourke +//http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/ +{ + int counter = 0; + int i; + double xinters; + ofPoint p1,p2; + + p1 = polygon[0]; + for (i=1;i<=polygon.size();i++) { + p2 = polygon[i % polygon.size()]; + if (p.y > min(p1.y,p2.y)) { + if (p.y <= max(p1.y,p2.y)) { + if (p.x <= max(p1.x,p2.x)) { + if (p1.y != p2.y) { + xinters = (p.y-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x; + if (p1.x == p2.x || p.x <= xinters) + counter++; + } + } + } + } + p1 = p2; + } + + if (counter % 2 == 0) + return true; + else + return false; +} + diff --git a/gaunt01/src/outsidePolygon.h b/gaunt01/src/outsidePolygon.h new file mode 100644 index 0000000..7616241 --- /dev/null +++ b/gaunt01/src/outsidePolygon.h @@ -0,0 +1,5 @@ +#pragma once + +#include "ofMain.h" + +bool OutsidePolygon(vector& polygon,ofPoint p) \ No newline at end of file diff --git a/gaunt01/src/testApp.cpp b/gaunt01/src/testApp.cpp index 785eb5a..a78a690 100644 --- a/gaunt01/src/testApp.cpp +++ b/gaunt01/src/testApp.cpp @@ -14,38 +14,6 @@ Is this too much work for every frame? Should it be put in a seperate thread? */ -bool OutsidePolygon(vector& polygon,ofPoint p) -//thanks to Paul Bourke -//http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/ -{ - int counter = 0; - int i; - double xinters; - ofPoint p1,p2; - - p1 = polygon[0]; - for (i=1;i<=polygon.size();i++) { - p2 = polygon[i % polygon.size()]; - if (p.y > min(p1.y,p2.y)) { - if (p.y <= max(p1.y,p2.y)) { - if (p.x <= max(p1.x,p2.x)) { - if (p1.y != p2.y) { - xinters = (p.y-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x; - if (p1.x == p2.x || p.x <= xinters) - counter++; - } - } - } - } - p1 = p2; - } - - if (counter % 2 == 0) - return true; - else - return false; -} - void testApp::setup(){ bLearnBakground = true; diff --git a/gaunt01/src/testApp.h b/gaunt01/src/testApp.h index c25defe..2ba60c4 100644 --- a/gaunt01/src/testApp.h +++ b/gaunt01/src/testApp.h @@ -13,6 +13,7 @@ #include "trapdoor.h" #include "bird.h" #include "player.h" +#include "outsidePolygon.h" //#define _USE_LIVE_VIDEO // uncomment this to use a live camera // otherwise, we'll use a movie file -- cgit v1.2.3