add missing files after merging
[blender.git] / source / gameengine / Ketsji / KX_ArmatureSensor.h
1 /*
2  * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 /** \file KX_ArmatureSensor.h
31  *  \ingroup ketsji
32  *  \brief Property sensor
33  */
34
35 #ifndef __KX_ARMATURESENSOR
36 #define __KX_ARMATURESENSOR
37
38 struct bConstraint;
39
40 #include "SCA_ISensor.h"
41 #include "DNA_sensor_types.h"
42
43 class KX_ArmatureSensor : public SCA_ISensor
44 {
45         Py_Header;
46         //class CExpression*    m_rightexpr;
47
48 protected:
49
50 public:
51         KX_ArmatureSensor(class SCA_EventManager* eventmgr,
52                                         SCA_IObject* gameobj,
53                                         const char *posechannel,
54                                         const char *constraintname,
55                                         int type,
56                                         float value);
57         
58         /** 
59          *  For property sensor, it is used to release the pre-calculated expression
60          *  so that self references are removed before the sensor itself is released
61          */
62         virtual ~KX_ArmatureSensor();
63         virtual CValue* GetReplica();
64         virtual void ReParent(SCA_IObject* parent);
65         virtual void Init();
66         virtual bool Evaluate();
67         virtual bool IsPositiveTrigger();
68
69         // identify the constraint that this actuator controls
70         void FindConstraint();
71
72 #ifdef WITH_PYTHON
73
74         /* --------------------------------------------------------------------- */
75         /* Python interface ---------------------------------------------------- */
76         /* --------------------------------------------------------------------- */
77         static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
78
79 #endif // WITH_PYTHON
80
81 private:
82         struct bConstraint*     m_constraint;
83         STR_String              m_posechannel;
84         STR_String              m_constraintname;
85         int                             m_type;
86         float                   m_value;
87         bool                    m_result;
88         bool                    m_lastresult;
89 };
90
91 #endif
92