Blender V2.61 - r43446

KX_ArmatureSensor.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #ifndef __KX_ARMATURESENSOR
00034 #define __KX_ARMATURESENSOR
00035 
00036 struct bConstraint;
00037 
00038 #include "SCA_ISensor.h"
00039 #include "DNA_sensor_types.h"
00040 
00041 class KX_ArmatureSensor : public SCA_ISensor
00042 {
00043     Py_Header
00044     //class CExpression*    m_rightexpr;
00045 
00046 protected:
00047 
00048 public:
00049     KX_ArmatureSensor(class SCA_EventManager* eventmgr,
00050                     SCA_IObject* gameobj,
00051                     const char *posechannel,
00052                     const char *constraintname,
00053                     int type,
00054                     float value);
00055     
00060     virtual ~KX_ArmatureSensor();
00061     virtual CValue* GetReplica();
00062     virtual void ReParent(SCA_IObject* parent);
00063     virtual void Init();
00064     virtual bool Evaluate();
00065     virtual bool IsPositiveTrigger();
00066 
00067     // identify the constraint that this actuator controls
00068     void FindConstraint();
00069 
00070 #ifdef WITH_PYTHON
00071 
00072     /* --------------------------------------------------------------------- */
00073     /* Python interface ---------------------------------------------------- */
00074     /* --------------------------------------------------------------------- */
00075     static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00076 
00077 #endif // WITH_PYTHON
00078 
00079 private:
00080     struct bConstraint* m_constraint;
00081     STR_String      m_posechannel;
00082     STR_String      m_constraintname;
00083     int             m_type;
00084     float           m_value;
00085     bool            m_result;
00086     bool            m_lastresult;
00087 };
00088 
00089 #endif
00090