~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/gameengine/GameLogic/SCA_ISensor.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * $Id: SCA_ISensor.h 26841 2010-02-12 13:34:04Z campbellbarton $
3
 
 *
 
1
/*
4
2
 * ***** BEGIN GPL LICENSE BLOCK *****
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or
25
23
 * Contributor(s): none yet.
26
24
 *
27
25
 * ***** END GPL LICENSE BLOCK *****
28
 
 * Interface Class for all logic Sensors. Implements
29
 
 * pulsemode and pulsefrequency, and event suppression.
30
 
 */
31
 
 
32
 
#ifndef __SCA_ISENSOR
33
 
#define __SCA_ISENSOR
 
26
 */
 
27
 
 
28
/** \file SCA_IController.h
 
29
 *  \ingroup gamelogic
 
30
 *  \brief Interface Class for all logic Sensors. Implements
 
31
 *   pulsemode and pulsefrequency, and event suppression.
 
32
 */
 
33
 
 
34
#ifndef __SCA_ISENSOR_H__
 
35
#define __SCA_ISENSOR_H__
34
36
 
35
37
#include "SCA_IController.h"
36
38
 
45
47
 */
46
48
class SCA_ISensor : public SCA_ILogicBrick
47
49
{
48
 
        Py_Header;
 
50
        Py_Header
49
51
protected:
50
52
        class SCA_EventManager* m_eventmgr;
51
53
 
101
103
        };
102
104
 
103
105
        SCA_ISensor(SCA_IObject* gameobj,
104
 
                                class SCA_EventManager* eventmgr);;
 
106
                                class SCA_EventManager* eventmgr);
105
107
        ~SCA_ISensor();
106
108
        virtual void    ReParent(SCA_IObject* parent);
107
109
 
108
 
        /** Because we want sensors to share some behaviour, the Activate has     */
 
110
        /** Because we want sensors to share some behavior, the Activate has     */
109
111
        /* an implementation on this level. It requires an evaluate on the lower */
110
112
        /* level of individual sensors. Mapping the old activate()s is easy.     */
111
113
        /* The IsPosTrig() also has to change, to keep things consistent.        */
116
118
 
117
119
        virtual CValue* GetReplica()=0;
118
120
 
119
 
        /** Set parameters for the pulsing behaviour.
120
 
         * @param posmode Trigger positive pulses?
121
 
         * @param negmode Trigger negative pulses?
122
 
         * @param freq    Frequency to use when doing pulsing.
 
121
        /** Set parameters for the pulsing behavior.
 
122
         * \param posmode Trigger positive pulses?
 
123
         * \param negmode Trigger negative pulses?
 
124
         * \param freq    Frequency to use when doing pulsing.
123
125
         */
124
126
        void SetPulseMode(bool posmode,
125
127
                                          bool negmode,
167
169
                return m_prev_state;
168
170
        }
169
171
 
 
172
        /** get the number of ticks since the last positive pulse */
 
173
        int GetPosTicks()
 
174
        {
 
175
                return m_pos_ticks;
 
176
        }
 
177
 
 
178
        /** get the number of ticks since the last negative pulse */
 
179
        int GetNegTicks()
 
180
        {
 
181
                return m_neg_ticks;
 
182
        }
 
183
 
170
184
        /** Resume sensing. */
171
185
        void Resume();
172
186
 
178
192
        bool IsNoLink() const 
179
193
                { return !m_links; }
180
194
 
181
 
#ifndef DISABLE_PYTHON
 
195
#ifdef WITH_PYTHON
182
196
        /* Python functions: */
183
197
        KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset);
184
198
        
185
199
        static PyObject*        pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
186
200
        static PyObject*        pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
187
201
        static PyObject*        pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
 
202
        static PyObject*        pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
 
203
        static PyObject*        pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
 
204
 
188
205
        static int          pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
189
206
        static int          pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
190
207
        
195
212
                KX_SENSOR_JUST_DEACTIVATED
196
213
        
197
214
        };
198
 
#endif // DISABLE_PYTHON
 
215
#endif // WITH_PYTHON
199
216
};
200
217
 
201
 
#endif //__SCA_ISENSOR
 
218
#endif //__SCA_ISENSOR_H__
202
219