Skip to content

Commit

Permalink
Further code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rwb11001 committed Dec 8, 2015
1 parent 03f9e8c commit b19bd3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
6 changes: 3 additions & 3 deletions RangeApp/Camera.pde
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Camera {
if(mouseButton == RIGHT) {
difX /= (float)(width);
difY /= (float)(height);
_scale = epsilon + abs((1 - 4*(difX + difY)) * _oldScale);
_scale = f_EPSILON + abs((1 - 4*(difX + difY)) * _oldScale);
_x = _oldX * _scale;
_y = _oldY * _scale;
} else {
Expand All @@ -58,8 +58,8 @@ class Camera {
_y = _oldY + difY;
break;
case 1:
float initAngle = atan((_initMY - height/2)/(epsilon + _initMX - width/2));
float newAngle = atan((mouseY - height/2)/(epsilon + mouseX - width/2));
float initAngle = atan((_initMY - height/2)/(f_EPSILON + _initMX - width/2));
float newAngle = atan((mouseY - height/2)/(f_EPSILON + mouseX - width/2));
float delta = newAngle - initAngle;
_angle = _oldAngle + delta;
break;
Expand Down
12 changes: 4 additions & 8 deletions RangeApp/Properties.pde
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


// Pallete
color c_WHITE = color (255, 255, 255);
color c_BLACK = color (0, 0, 0);
Expand Down Expand Up @@ -30,19 +28,13 @@ color c_helpStroke = c_BLACK;
color c_helpText = c_WHITE;
int i_helpStrokeWidth = 2;

// Status Colors
color c_statusMode = c_YELLOW;
color c_statusBackground = c_PROCBLUE;
color c_statusText = c_WHITE;

// Point
color c_pointStroke = c_BLACK;
color c_pointDefault = c_WHITE;
color c_pointSelect = color (100, 255, 100);
int i_pointRad = 20;

// Tree stuff
float f_INFINITY = 99999;
int i_relationWidth = 2;
int i_boundaryWidth = 3;

Expand All @@ -60,3 +52,7 @@ String[] s_helpStrings = {
"g: Select Point",
"c: Clear Points"
};

// Math Stuff
float f_EPSILON = 0.000001;
float f_INFINITY = 999999;
8 changes: 0 additions & 8 deletions RangeApp/RangeApp.pde
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ Selector selector;
Point nearestNeighbor;
ArrayList<Point> pointList;
boolean drawCon, drawHelp, drawTreeRelations, drawTreeBoundaries, drawGnoman, useSelector;
float epsilon = 0.000001;
int G_mode;
// 1 = SCALE
// 2 = PAN
// 3 = ROTATE
// 4 = PLACE [removed]
// 5 = CIRC SELECT
// 6 = RECT SELECT

void setup() {
size(800,800);
Expand Down

0 comments on commit b19bd3d

Please sign in to comment.