Blender V2.61 - r43446
|
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 00032 #ifndef __KX_TrackToActuator 00033 #define __KX_TrackToActuator 00034 00035 #include "SCA_IActuator.h" 00036 #include "SCA_IObject.h" 00037 #include "MT_Matrix3x3.h" 00038 #include "KX_GameObject.h" 00039 00040 00041 class KX_TrackToActuator : public SCA_IActuator 00042 { 00043 Py_Header 00044 // Object reference. Actually, we use the object's 'life' 00045 SCA_IObject* m_object; 00046 // 3d toggle 00047 bool m_allow3D; 00048 // time field 00049 int m_time; 00050 int m_trackTime; 00051 int m_trackflag; 00052 int m_upflag; 00053 00054 MT_Matrix3x3 m_parentlocalmat; 00055 KX_GameObject* m_parentobj; 00056 00057 public: 00058 KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time, 00059 bool threedee,int trackflag,int upflag); 00060 virtual ~KX_TrackToActuator(); 00061 virtual CValue* GetReplica() { 00062 KX_TrackToActuator* replica = new KX_TrackToActuator(*this); 00063 replica->ProcessReplica(); 00064 return replica; 00065 }; 00066 00067 virtual void ProcessReplica(); 00068 virtual bool UnlinkObject(SCA_IObject* clientobj); 00069 virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); 00070 virtual bool Update(double curtime, bool frame); 00071 00072 #ifdef WITH_PYTHON 00073 00074 /* Python part */ 00075 00076 /* These are used to get and set m_ob */ 00077 static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); 00078 static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); 00079 00080 #endif // WITH_PYTHON 00081 00082 }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */ 00083 00084 #endif 00085