6 changed files with 71 additions and 2 deletions
@ -0,0 +1,30 @@ |
|||
#include "ofxSurfaceGui.h" |
|||
|
|||
ofxSurfaceGui::ofxSurfaceGui() |
|||
{ |
|||
jointCounter = 0; |
|||
} |
|||
|
|||
ofxSurfaceGui::~ofxSurfaceGui() |
|||
{ |
|||
|
|||
} |
|||
|
|||
void ofxSurfaceGui::setup(ofxTriangleSurface& surfaceForGui) |
|||
{ |
|||
surface = &surfaceForGui; |
|||
addNumJoints(3); |
|||
} |
|||
|
|||
void ofxSurfaceGui::addJoint() |
|||
{ |
|||
jointCounter++; |
|||
} |
|||
|
|||
void ofxSurfaceGui::addNumJoints(int num) |
|||
{ |
|||
for ( int i=0; i<num; i++ ) { |
|||
addJoint(); |
|||
joints[i].position = surface->getVertex(i); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
#ifndef H_OFX_SURFACE_GUI |
|||
#define H_OFX_SURFACE_GUI |
|||
|
|||
#include "ofMain.h" |
|||
#include "ofxTriangleSurface.h" |
|||
#include "ofxCircleJoint.h" |
|||
|
|||
class ofxSurfaceGui |
|||
{ |
|||
public: |
|||
ofxSurfaceGui(); |
|||
~ofxSurfaceGui(); |
|||
|
|||
void setup(ofxTriangleSurface& surfaceForGui); |
|||
|
|||
private: |
|||
ofxTriangleSurface* surface; |
|||
ofxCircleJoint joints[100]; |
|||
int jointCounter; |
|||
|
|||
void addJoint(); |
|||
void addNumJoints(int num); |
|||
}; |
|||
|
|||
#endif |
Loading…
Reference in new issue