Normand Briere
2019-08-28 547c9203ab5d8e4bee36d1cbb453dfa36bbec4ef
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
68
69
70
71
72
package mocap.figure;
 
import java.util.List;
 
/**
 * Stores mocap animation data.
 * 
 * @author Michael Kipp
 */
public class AnimData implements java.io.Serializable
{
    static final long serialVersionUID = -2918094393566350403L;
 
    //private double[][] _data2; // first index: bones, second index: frames
    //transient
    public
            float[][] _data; // first index: bones, second index: frames
    public
            float scale; // may 2014: scale for position
    private int _numFrames;
    private float _fps;
 
    public AnimData(int numBones)
    {
        _data = new float[numBones][];
    }
 
    public void putBoneData(int index, List<Float> data)
    {
        _data[index] = new float[data.size()];
        int j = 0;
        for (Float x : data) {
            _data[index][j++] = x;
        }
    }
 
    public void putBoneData(int index, float[] data)
    {
        _data[index] = data;
    }
 
    public float[] getBoneData(int index)
    {
        return _data[index];
    }
 
    public void setNumFrames(int n)
    {
        _numFrames = n;
    }
 
    public int getNumFrames()
    {
        return _numFrames;
    }
 
    public void setFps(float fps)
    {
        _fps = fps;
    }
 
    public float getFps()
    {
        return _fps;
    }
 
    @Override
    public String toString()
    {
        return "<AnimData frames:" + _numFrames + ">";
    }
}