From adc1fe0182495151eba174f7ab5b99a900e10b5e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 6 Apr 2012 00:00:16 +0100 Subject: changed morphmesh to use associative keys for targets --- gaunt01/src/bird.cpp | 5 ++++- gaunt01/src/morphmesh.cpp | 12 ++++++++---- gaunt01/src/morphmesh.h | 20 +++++++++++++++++--- 3 files changed, 29 insertions(+), 8 deletions(-) (limited to 'gaunt01/src') diff --git a/gaunt01/src/bird.cpp b/gaunt01/src/bird.cpp index 204bf6e..388d7af 100644 --- a/gaunt01/src/bird.cpp +++ b/gaunt01/src/bird.cpp @@ -29,14 +29,17 @@ void bird::update(const vector& players){ position+=direction*velocity*timeSeg; } void bird::draw(){ + glEnable(GL_DEPTH_TEST); ofPushMatrix(); ofTranslate(position); //ofRotate(direction); - ofRotate(90,0,-1,0); + ofRotate(90,0,0,1); + ofRotate(90,-1,0,0); //ofRotate(180,1,0,0); bindTexture(texture); model.draw(); unbindTexture(texture); ofPopMatrix(); + glDisable(GL_DEPTH_TEST); } diff --git a/gaunt01/src/morphmesh.cpp b/gaunt01/src/morphmesh.cpp index 475f93b..5fc7182 100644 --- a/gaunt01/src/morphmesh.cpp +++ b/gaunt01/src/morphmesh.cpp @@ -24,10 +24,12 @@ void morphmesh::draw() { } void morphmesh::draw(int target){ clearVertices(); - addVertices(morphs[target]); + map >::iterator it=morphs.begin(); + for ( int i=0;isecond); ofMesh::draw(); } -void morphmesh::draw(const vector& targets, const vector& weights){ +void morphmesh::draw(const vector& targets, const vector& weights){ clearVertices(); //normalise weights int targetsNum=min(targets.size(),morphs.size()); @@ -35,7 +37,7 @@ void morphmesh::draw(const vector& targets, const vector& weights){ for (int i=0;i meshnames; + for (int i=0;i& targets, const vector& weights); + void draw(const vector& targets, const vector& weights); int getNumTargets(); protected: private: - vector< vector > morphs; + map< string,vector > morphs; bool loaded; }; -- cgit v1.2.3