annotate globalForces.h @ 15:d5758530a039 tip

oF0.84 Retina, and iPhone support
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 12 May 2015 15:48:52 +0100
parents 0e03760cf2d9
children
rev   line source
rt300@0 1 //
rt300@0 2 // globalForces.h
rt300@0 3 // wablet
rt300@0 4 //
rt300@0 5 // Created by Robert Tubb on 18/07/2011.
rt300@0 6 // Copyright 2011 __MyCompanyName__. All rights reserved.
rt300@0 7 //
rt300@0 8 #ifndef _GLOBALFORCES
rt300@0 9 #define _GLOBALFORCES
rt300@0 10
rt300@0 11 #include "2dvector.h"
rt300@0 12 #include "ofMain.h"
rt300@8 13 #include "json.h"
rt300@0 14 #include "ofxiPhone.h"
rt300@0 15 #include "ofxiPhoneExtras.h"
rt300@0 16 #include <list>
rt300@0 17
rt300@0 18 struct forceTouchPoint{
rt300@0 19 double x, y;
rt300@0 20 int tid;
rt300@0 21
rt300@0 22 //forceTouchPoint(double ax,double ay,int atid): x(ax),y(ay),tid(atid){};
rt300@0 23
rt300@0 24 };
rt300@0 25
rt300@0 26 class GlobalForces{
rt300@0 27
rt300@0 28 public:
rt300@0 29
rt300@0 30 enum excitationTypes {POSITION,VELOCITY};
rt300@0 31 enum excitationShapes {NOISE,GAUSS,SINE};
rt300@0 32
rt300@0 33 excitationTypes excitationType;
rt300@0 34 excitationShapes excitationShape;
rt300@0 35
rt300@0 36 bool gravityOn, forceTouchOn, pressureOn;
rt300@0 37 // params for adjusting stuff
rt300@0 38 double pressureAmt, gravityAmt, touchStrength, excitationStrength, homingAmt, avFilterAmt;
rt300@0 39 int exciteShapeX, exciteShapeY;
rt300@0 40 // general params
rt300@0 41 double speedLimit, wallBounce;
rt300@8 42 double delt; // time step between frames not used really
rt300@0 43 double volume;
rt300@0 44
rt300@0 45 forceTouchPoint* forceTouchPoints;
rt300@0 46 TwoVector grav;
rt300@0 47 double pressure;
rt300@0 48
rt300@0 49 int maxForcePoints;
rt300@0 50
rt300@0 51 GlobalForces();
rt300@0 52 ~GlobalForces();
rt300@0 53 void update();
rt300@0 54 void setPressure(double aP);
rt300@0 55 void createForceTouchPoint(double ax,double ay, int touchId);
rt300@0 56 void moveForceTouchPoint(double ax,double ay, int touchId);
rt300@0 57 void removeForceTouchPoint(int touchId);
rt300@0 58 TwoVector getAllForceAt(double ax, double ay);
rt300@0 59
rt300@9 60 Json::Value convertToJsonForSaving();
rt300@9 61 void setFromJson(Json::Value jgf);
rt300@0 62 };
rt300@0 63
rt300@0 64
rt300@0 65 #endif