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