rt300@0: // rt300@0: // globalForces.h rt300@0: // wablet rt300@0: // rt300@0: // Created by Robert Tubb on 18/07/2011. rt300@0: // Copyright 2011 __MyCompanyName__. All rights reserved. rt300@0: // rt300@0: #ifndef _GLOBALFORCES rt300@0: #define _GLOBALFORCES rt300@0: rt300@0: #include "2dvector.h" rt300@0: #include "ofMain.h" rt300@8: #include "json.h" rt300@0: #include "ofxiPhone.h" rt300@0: #include "ofxiPhoneExtras.h" rt300@0: #include rt300@0: rt300@0: struct forceTouchPoint{ rt300@0: double x, y; rt300@0: int tid; rt300@0: rt300@0: //forceTouchPoint(double ax,double ay,int atid): x(ax),y(ay),tid(atid){}; rt300@0: rt300@0: }; rt300@0: rt300@0: class GlobalForces{ rt300@0: rt300@0: public: rt300@0: rt300@0: enum excitationTypes {POSITION,VELOCITY}; rt300@0: enum excitationShapes {NOISE,GAUSS,SINE}; rt300@0: rt300@0: excitationTypes excitationType; rt300@0: excitationShapes excitationShape; rt300@0: rt300@0: bool gravityOn, forceTouchOn, pressureOn; rt300@0: // params for adjusting stuff rt300@0: double pressureAmt, gravityAmt, touchStrength, excitationStrength, homingAmt, avFilterAmt; rt300@0: int exciteShapeX, exciteShapeY; rt300@0: // general params rt300@0: double speedLimit, wallBounce; rt300@8: double delt; // time step between frames not used really rt300@0: double volume; rt300@0: rt300@0: forceTouchPoint* forceTouchPoints; rt300@0: TwoVector grav; rt300@0: double pressure; rt300@0: rt300@0: int maxForcePoints; rt300@0: rt300@0: GlobalForces(); rt300@0: ~GlobalForces(); rt300@0: void update(); rt300@0: void setPressure(double aP); rt300@0: void createForceTouchPoint(double ax,double ay, int touchId); rt300@0: void moveForceTouchPoint(double ax,double ay, int touchId); rt300@0: void removeForceTouchPoint(int touchId); rt300@0: TwoVector getAllForceAt(double ax, double ay); rt300@0: rt300@9: Json::Value convertToJsonForSaving(); rt300@9: void setFromJson(Json::Value jgf); rt300@0: }; rt300@0: rt300@0: rt300@0: #endif