~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to COLLADAMaya/include/COLLADAMayaAnimationKeys.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
        This file is part of COLLADAMaya.
 
5
 
 
6
    Portions of the code are:
 
7
    Copyright (c) 2005-2007 Feeling Software Inc.
 
8
    Copyright (c) 2005-2007 Sony Computer Entertainment America
 
9
    Copyright (c) 2004-2005 Alias Systems Corp.
 
10
 
 
11
    Licensed under the MIT Open Source License,
 
12
    for details please see LICENSE file or the website
 
13
    http://www.opensource.org/licenses/mit-license.php
 
14
*/
 
15
 
 
16
#ifndef __COLLADA_MAYA_ANIMATION_KEYS_H__
 
17
#define __COLLADA_MAYA_ANIMATION_KEYS_H__
 
18
 
 
19
#include "COLLADAMayaPrerequisites.h"
 
20
#include "COLLADAMayaTangentPoint.h"
 
21
#include "COLLADASWLibraryAnimations.h"
 
22
 
 
23
namespace COLLADAMaya
 
24
{
 
25
    /**
 
26
    * This file contains the AnimationKey, AnimationKeyBezier and AnimationKeyTCB classes.
 
27
    */
 
28
 
 
29
    // ----------------------------------------------------------
 
30
    /**
 
31
    This class is the base for every animation key.
 
32
    */
 
33
 
 
34
    class BaseAnimationKey
 
35
    {
 
36
 
 
37
    public:
 
38
        BaseAnimationKey() : input (-1) {}
 
39
 
 
40
        /** The key input. Typically, this will be a time value, in seconds.
 
41
        For driven curves, the dimension of this value will depend on the driver. */
 
42
        float input;
 
43
 
 
44
        /** The key interpolation type. */
 
45
        COLLADASW::LibraryAnimations::InterpolationType interpolation;
 
46
    };
 
47
 
 
48
    // ----------------------------------------------------------
 
49
    /**
 
50
    A simple animation key.
 
51
    This class is the base for the more complex one-dimensional keys
 
52
    and it is used directly for linear and step keys.
 
53
 
 
54
    Do not create directly.
 
55
    Instead call AnimationCurve::AddKey(LINEAR)
 
56
    or AnimationCurve::AddKey(STEP).
 
57
    */
 
58
 
 
59
    class AnimationKey : public BaseAnimationKey
 
60
    {
 
61
 
 
62
    public:
 
63
        AnimationKey() : BaseAnimationKey (), output (-1) {}
 
64
 
 
65
        /** The key output. */
 
66
        float output;
 
67
    };
 
68
 
 
69
    /** Animation key list */
 
70
    typedef std::vector<AnimationKey*> AnimationKeyList;
 
71
 
 
72
    // ----------------------------------------------------------
 
73
    /**
 
74
    An animation key with tangents values.
 
75
    This class is used for bezier keys and soon: for hermite keys as well.
 
76
 
 
77
    Do not create directly.
 
78
    Instead call AnimationCurve::AddKey(BEZIER).
 
79
    */
 
80
 
 
81
    class AnimationKeyBezier : public AnimationKey
 
82
    {
 
83
 
 
84
    public:
 
85
 
 
86
        AnimationKeyBezier() : AnimationKey () {}
 
87
 
 
88
        TangentPoint inTangent;  /**< The incoming tangent value. */
 
89
        TangentPoint outTangent; /**< The outcoming tangent value. */
 
90
    };
 
91
 
 
92
    // ----------------------------------------------------------
 
93
    /**
 
94
    An animation key with tension, continuity and bias values.
 
95
    This class is used for 3dsMax TCB keys.
 
96
 
 
97
    Do not create directly.
 
98
    Instead call AnimationCurve::AddKey(TCB).
 
99
    */
 
100
 
 
101
    class AnimationKeyTCB : public AnimationKey
 
102
    {
 
103
 
 
104
    public:
 
105
 
 
106
        AnimationKeyTCB() 
 
107
            : AnimationKey (), tension(-1), continuity(-1), bias(-1), easeIn(-1), easeOut(-1)
 
108
        {}
 
109
 
 
110
        float tension;  /**< The tension. */
 
111
        float continuity; /**< The continuity. */
 
112
        float bias;   /**< The bias. */
 
113
 
 
114
        float easeIn;  /**< The ease-in factor. */
 
115
        float easeOut;  /**< The ease-out factor. */
 
116
    };
 
117
 
 
118
    // ----------------------------------------------------------
 
119
    /**
 
120
    A simple multi-dimensional animation key.
 
121
    This class is the base for the more complex multi-dimensional keys
 
122
    and it is used directly for linear and step multi-dimensional keys.
 
123
    */
 
124
 
 
125
    class AnimationMKey : public BaseAnimationKey
 
126
    {
 
127
 
 
128
    private:
 
129
        uint dimension;
 
130
 
 
131
    public:
 
132
        /** Constructor. Do not use directly.
 
133
        Instead call AnimationMultiCurve::AddKey(FUDaeInterpolation::LINEAR)
 
134
        or AnimationMultiCurve::AddKey(FUDaeInterpolation::STEP).
 
135
        @param dimension The number of dimension to the key output. */
 
136
        AnimationMKey ( uint dimension );
 
137
 
 
138
        /** Destructor. */
 
139
        virtual ~AnimationMKey();
 
140
 
 
141
        /** Retrieves the number of dimensions for this key.
 
142
        @return The number of dimensions. */
 
143
        uint getDimension() const
 
144
        {
 
145
            return dimension;
 
146
        };
 
147
 
 
148
        /** The multi-dimensional key output. */
 
149
        float* output;
 
150
    };
 
151
 
 
152
    /** A array of multi-dimensional animation keys. */
 
153
    typedef std::vector<AnimationMKey*> AnimationMKeyList;
 
154
 
 
155
    // ----------------------------------------------------------
 
156
    /**
 
157
    A multi-dimensional animation key with tangents values.
 
158
    This class is used for bezier keys and soon: for hermite keys as well.
 
159
    */
 
160
 
 
161
    class AnimationMKeyBezier : public AnimationMKey
 
162
    {
 
163
 
 
164
    public:
 
165
        /** Constructor: do not use directly.
 
166
        Instead call AnimationCurve::AddKey(FUDaeInterpolation::BEZIER).
 
167
        @param dimension The number of dimension to the key output. */
 
168
        AnimationMKeyBezier ( uint dimension );
 
169
 
 
170
        /** Destructor. */
 
171
        virtual ~AnimationMKeyBezier();
 
172
 
 
173
        TangentPoint* inTangent; /**< The incoming tangent value. */
 
174
        TangentPoint* outTangent; /**< The outcoming tangent value. */
 
175
    };
 
176
 
 
177
    // ----------------------------------------------------------
 
178
    /**
 
179
    An animation key with tension, continuity and bias values.
 
180
    This class is used for 3dsMax TCB keys.
 
181
    */
 
182
 
 
183
    class AnimationMKeyTCB : public AnimationMKey
 
184
    {
 
185
 
 
186
    public:
 
187
        /** Constructor: do not use directly.
 
188
        Instead call AnimationMultiCurve::AddKey(FUDaeInterpolation::TCB).
 
189
        @param dimension The number of dimension to the key output. */
 
190
        AnimationMKeyTCB ( uint dimension );
 
191
 
 
192
        /** Destructor. */
 
193
        virtual ~AnimationMKeyTCB();
 
194
 
 
195
        float* tension; /**< The multi-dimensional tensions. */
 
196
        float* continuity; /**< The multi-dimensional continuities. */
 
197
        float* bias; /**< The multi-dimensional biases. */
 
198
 
 
199
        float* easeIn; /**< The multi-dimensional ease-in factors. */
 
200
        float* easeOut; /**< The multi-dimensional ease-out factors. */
 
201
    };
 
202
 
 
203
}
 
204
 
 
205
#endif // __COLLADA_MAYA_ANIMATION_KEYS_H__
 
206