view globalForces.h @ 0:c667dfe12d47

OK. Ther real deal.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 19 Nov 2012 13:00:42 +0000
parents
children 4ea605899aca
line wrap: on
line source
//
//  globalForces.h
//  wablet
//
//  Created by Robert Tubb on 18/07/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
#ifndef _GLOBALFORCES
#define _GLOBALFORCES

#include "2dvector.h"
#include "ofMain.h"
#include "ofxiPhone.h"
#include "ofxiPhoneExtras.h"
#include <list>

struct forceTouchPoint{
    double x, y;
    int tid;

    //forceTouchPoint(double ax,double ay,int atid): x(ax),y(ay),tid(atid){};
    
};

class GlobalForces{

public: 

    enum excitationTypes {POSITION,VELOCITY};
    enum excitationShapes {NOISE,GAUSS,SINE};

    excitationTypes excitationType;
    excitationShapes excitationShape;
    
    bool gravityOn, forceTouchOn, pressureOn;
    // params for adjusting stuff
    double pressureAmt, gravityAmt, touchStrength, excitationStrength, homingAmt, avFilterAmt;
    int exciteShapeX, exciteShapeY;
    // general params
    double speedLimit, wallBounce;
    double delt; // time step between frames
    double volume;
    
    forceTouchPoint* forceTouchPoints;
    TwoVector grav;
    double pressure;
    
    int maxForcePoints;
    
    GlobalForces();
    ~GlobalForces();
    void update();
    void setPressure(double aP);
    void createForceTouchPoint(double ax,double ay, int touchId);
    void moveForceTouchPoint(double ax,double ay, int touchId);
    void removeForceTouchPoint(int touchId);
    TwoVector getAllForceAt(double ax, double ay);
    
    
};


#endif