Blender  V2.59
KX_CameraActuator.h
Go to the documentation of this file.
00001 /*
00002  * KX_CameraActuator.h
00003  *
00004  * $Id: KX_CameraActuator.h 37455 2011-06-13 17:08:33Z dfelinto $
00005  *
00006  * ***** BEGIN GPL LICENSE BLOCK *****
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software Foundation,
00020  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021  *
00022  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00023  * All rights reserved.
00024  *
00025  * The Original Code is: all of this file.
00026  *
00027  * Contributor(s): none yet.
00028  *
00029  * ***** END GPL LICENSE BLOCK *****
00030  */
00031 
00036 #ifndef __KX_CAMERAACTUATOR
00037 #define __KX_CAMERAACTUATOR
00038 
00039 #include "SCA_IActuator.h"
00040 #include "MT_Scalar.h"
00041 #include "SCA_LogicManager.h"
00042 
00051 class KX_CameraActuator : public SCA_IActuator
00052 {
00053         Py_Header;
00054 private :
00056         SCA_IObject *m_ob;
00057 
00059         //const MT_Scalar m_height;
00061         //const MT_Scalar m_minHeight;
00063         //const MT_Scalar m_maxHeight;
00064         
00066         float m_height;
00067         
00069         float m_minHeight;
00070         
00072         float m_maxHeight;
00073         
00075         bool m_x;
00076         
00078         float m_damping;
00079 
00080         /* get the KX_IGameObject with this name */
00081         CValue *findObject(char *obName);
00082 
00083         /* parse x or y to a toggle pick */
00084         bool string2axischoice(const char *axisString);
00085         
00086  public:
00087         static STR_String X_AXIS_STRING;
00088         static STR_String Y_AXIS_STRING;
00089         
00093         KX_CameraActuator(
00094 
00095                 SCA_IObject *gameobj,
00096                 //const CValue *ob,
00097                 SCA_IObject *ob,
00098                 float hght,
00099                 float minhght,
00100                 float maxhght,
00101                 bool xytog,
00102                 float damping
00103         );
00104 
00105 
00106         ~KX_CameraActuator();
00107 
00108 
00109 
00111         CValue* GetReplica();
00112         virtual void ProcessReplica();
00113         
00114 
00116         virtual bool Update(
00117                 double curtime,
00118                 bool frame
00119         );
00120         virtual bool    UnlinkObject(SCA_IObject* clientobj);
00121 
00123         virtual void    Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map);
00124 
00125 #ifdef WITH_PYTHON
00126 
00127         /* --------------------------------------------------------------------- */
00128         /* Python interface ---------------------------------------------------- */
00129         /* --------------------------------------------------------------------- */
00130 
00131         /* set object to look at */
00132         static PyObject*        pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00133         static int                      pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00134 
00135 #endif // WITH_PYTHON
00136 
00137 };
00138 
00139 #endif //__KX_CAMERAACTUATOR
00140