summaryrefslogtreecommitdiff
path: root/morpher/src/morphmesh.h
blob: ca1231c574c072357432897201c84d516ecabd9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef MORPHMESH_H
#define MORPHMESH_H

#include <iostream>
#include <iterator>

#include <ofMesh.h>
#include <ofxXmlSettings.h>

/*
Tim Redfern, March 2012

Loads meshes in Oak3D XML format

Draws blended morph targets

Multiple meshes are loaded as morph targets

Coords are absolute


--managing movement sequences
--cycles can refer to targets by name
--high level controller objects can refer to animation sequences by name
--this makes it impossible for a re-odering to banjax everything

cycles have a start time, and they either loop or act as a transition

Working out the morphs is a question of:
-working out which cycles are active based on behaviours
-adding their morph targets into the current vector of targets

behaviours are triggered by things like spotting people or avoiding the wall.
These could be parameterised on top of the rest?

*/


class sequence
{
    //stores a morph sequence: an animation cycle or transition
    public:
        sequence();
        virtual ~sequence();


};

class morphmesh : public ofMesh
{
    public:
        morphmesh();
	morphmesh(string filename);
        virtual ~morphmesh();
	bool loadMesh(string filename);
	bool isLoaded();
	void draw();
	void draw(int target);
	void draw(const vector<string>& targets, const vector<float>& weights);
    int getNumTargets();
    protected:
    private:
	map< string,vector<ofVec3f> > morphs;
	bool loaded;
};

#endif // MORPHMESH_H