This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create some particles. | |
for(int i = 0; i < 10; ++i) { | |
Particle p; | |
parts.push_back(p); | |
} | |
cout << "We have:" << parts.size() << " particles." << endl; | |
// remove some | |
vector<Particle>::iterator it = parts.begin(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Particle { | |
public: | |
Particle() { | |
alive = (int)ofRandom(0,5); | |
} | |
bool operator()(const Particle& p) { | |
return p.alive; | |
} | |
int alive; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetFrameRate(60); | |
ofSetVerticalSync(true); | |
ofBackground(33); | |
ax.setup(15); | |
float s = 0.01; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline std::vector<HE_Edge*> HE_Selection::getOuterEdges() { | |
HE_Selection copy = getCopy(); | |
copy.collectEdges(); | |
const std::vector<HE_Edge*>& copy_edges = copy.getEdgesRef(); | |
const std::vector<HE_Edge*>::const_iterator it = copy_edges.begin(); | |
HE_Edge* e = NULL; | |
HE_Face* f1 = NULL; | |
HE_Face* f2 = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline std::vector<HE_Edge*> HE_Selection::getOuterEdges() { | |
HE_Selection copy = getCopy(); | |
copy.collectEdges(); | |
const std::vector<HE_Edge*>& copy_edges = copy.getEdgesRef(); | |
const std::vector<HE_Edge*>::const_iterator it = copy_edges.begin(); | |
HE_Edge* e = NULL; | |
HE_Face* f1 = NULL; | |
HE_Face* f2 = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofxRTPSession.h" | |
#include "ofMain.h" // tmp debug | |
ofxRTPSession::ofxRTPSession() { | |
must_send = false; | |
} | |
ofxRTPSession& ofxRTPSession::start() { | |
session_params.SetAcceptOwnPackets(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool AMF3Serializer::WriteArray(IOBuffer &buffer, Variant &variant, bool writeType) { | |
WRITE_AMF3_TYPE(AMF3_ARRAY); | |
Variant v = variant; | |
uint32_t denseSize = v.MapDenseSize(); | |
for (uint32_t i = 0; i < denseSize; i++) { | |
v.RemoveAt(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Particle.h" | |
// constructor function - executed directly! | |
Particle::Particle() { | |
velocity.set(1,2); | |
position.set(0,0); | |
mass = ofRandom(0.2,10); | |
forces.set(0.4,0.1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
#define DOT(a,b) a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; | |
#define LENGTH(p) sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]); | |
#define NORMALIZE(p) { float l = LENGTH(p); p[0] /= l; p[1] /= l; p[2] /= l; } | |
#define CROSS(a,b) { a[1] * b[2] - a[2] * b[1], \ | |
a[2] * b[0] - a[0] * b[2], \ | |
a[0] * b[1] - a[1] * b[0]}; | |
#define SUBTRACT(a,b,d) d[0] = a[0] - b[0]; d[1] = a[1] - b[1]; d[2] = a[2] - b[2]; | |
#define SCALE(a, s) { NORMALIZE(a); a[0] *= s; a[1] *= s; a[2] *= s; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
#include "Roxlu.h" | |
class testApp : public ofBaseApp{ | |
public: | |
testApp(); | |
void setup(); | |
void update(); |