~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/gameengine/Converter/BL_ShapeActionActuator.h

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: BL_ShapeActionActuator.h 16689 2008-09-22 21:49:48Z ben2610 $
 
3
 *
 
4
 * ***** BEGIN GPL LICENSE BLOCK *****
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software Foundation,
 
18
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
21
 * All rights reserved.
 
22
 *
 
23
 * The Original Code is: all of this file.
 
24
 *
 
25
 * Contributor(s): none yet.
 
26
 *
 
27
 * ***** END GPL LICENSE BLOCK *****
 
28
 */
 
29
 
 
30
#ifndef BL_SHAPEACTIONACTUATOR
 
31
#define BL_SHAPEACTIONACTUATOR
 
32
 
 
33
#include "GEN_HashedPtr.h"
 
34
#include "SCA_IActuator.h"
 
35
#include "MT_Point3.h"
 
36
#include <vector>
 
37
 
 
38
struct Key;
 
39
class BL_ShapeActionActuator : public SCA_IActuator  
 
40
{
 
41
public:
 
42
        Py_Header;
 
43
        BL_ShapeActionActuator(SCA_IObject* gameobj,
 
44
                                                const STR_String& propname,
 
45
                                                const STR_String& framepropname,
 
46
                                                float starttime,
 
47
                                                float endtime,
 
48
                                                struct bAction *action,
 
49
                                                short   playtype,
 
50
                                                short   blendin,
 
51
                                                short   priority,
 
52
                                                float   stride,
 
53
                                                PyTypeObject* T=&Type) 
 
54
                : SCA_IActuator(gameobj,T),
 
55
                
 
56
                m_lastpos(0, 0, 0),
 
57
                m_blendframe(0),
 
58
                m_flag(0),
 
59
                m_startframe (starttime),
 
60
                m_endframe(endtime) ,
 
61
                m_starttime(0),
 
62
                m_localtime(starttime),
 
63
                m_lastUpdate(-1),
 
64
                m_blendin(blendin),
 
65
                m_blendstart(0),
 
66
                m_stridelength(stride),
 
67
                m_playtype(playtype),
 
68
                m_priority(priority),
 
69
                m_action(action),
 
70
                m_framepropname(framepropname), 
 
71
                m_propname(propname)
 
72
        {
 
73
        };
 
74
        virtual ~BL_ShapeActionActuator();
 
75
        virtual bool Update(double curtime, bool frame);
 
76
        virtual CValue* GetReplica();
 
77
        virtual void ProcessReplica();
 
78
        
 
79
        void SetBlendTime (float newtime);
 
80
        void BlendShape(struct Key* key, float weigth);
 
81
 
 
82
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetAction);
 
83
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendin);
 
84
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetPriority);
 
85
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetStart);
 
86
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetEnd);
 
87
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetFrame);
 
88
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetProperty);
 
89
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetFrameProperty);
 
90
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendtime);
 
91
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetChannel);
 
92
 
 
93
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction);
 
94
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin);
 
95
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority);
 
96
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart);
 
97
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd);
 
98
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame);
 
99
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty);
 
100
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty);
 
101
//      KX_PYMETHOD(BL_ActionActuator,GetChannel);
 
102
        KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType);
 
103
        KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType);
 
104
 
 
105
        virtual PyObject* _getattr(const STR_String& attr);
 
106
 
 
107
protected:
 
108
 
 
109
        void SetStartTime(float curtime);
 
110
        void SetLocalTime(float curtime);
 
111
        bool ClampLocalTime();
 
112
 
 
113
        MT_Point3       m_lastpos;
 
114
        float   m_blendframe;
 
115
        int             m_flag;
 
116
        /** The frame this action starts */
 
117
        float   m_startframe;
 
118
        /** The frame this action ends */
 
119
        float   m_endframe;
 
120
        /** The time this action started */
 
121
        float   m_starttime;
 
122
        /** The current time of the action */
 
123
        float   m_localtime;
 
124
        
 
125
        float   m_lastUpdate;
 
126
        float   m_blendin;
 
127
        float   m_blendstart;
 
128
        float   m_stridelength;
 
129
        short   m_playtype;
 
130
        short   m_priority;
 
131
        struct bAction *m_action;
 
132
        STR_String      m_propname;
 
133
        STR_String      m_framepropname;
 
134
        vector<float> m_blendshape;
 
135
};
 
136
 
 
137
#endif
 
138