Blender  V2.59
KX_TrackToActuator.h
Go to the documentation of this file.
00001 // $Id: KX_TrackToActuator.h 36523 2011-05-06 20:18:42Z blendix $
00002 //
00003 // ***** BEGIN GPL LICENSE BLOCK *****
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software Foundation,
00017 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 //
00019 // The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00020 // All rights reserved.
00021 //
00022 // The Original Code is: all of this file.
00023 //
00024 // Contributor(s): none yet.
00025 //
00026 // ***** END GPL LICENSE BLOCK *****
00027 //
00028 
00033 #ifndef __KX_TrackToActuator
00034 #define __KX_TrackToActuator
00035 
00036 #include "SCA_IActuator.h"
00037 #include "SCA_IObject.h"
00038 #include "MT_Matrix3x3.h"
00039 #include "KX_GameObject.h"
00040 
00041 
00042 class KX_TrackToActuator : public SCA_IActuator
00043 {
00044         Py_Header;
00045         // Object reference. Actually, we use the object's 'life'
00046         SCA_IObject*    m_object;
00047         // 3d toggle
00048         bool m_allow3D;
00049         // time field
00050         int m_time;
00051         int     m_trackTime;
00052         int     m_trackflag;
00053         int m_upflag;
00054         
00055         MT_Matrix3x3 m_parentlocalmat;
00056         KX_GameObject* m_parentobj;
00057 
00058   public:
00059         KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time,
00060                                        bool threedee,int trackflag,int upflag);
00061         virtual ~KX_TrackToActuator();
00062         virtual CValue* GetReplica() {
00063                 KX_TrackToActuator* replica = new KX_TrackToActuator(*this);
00064                 replica->ProcessReplica();
00065                 return replica;
00066         };
00067 
00068         virtual void ProcessReplica();
00069         virtual bool UnlinkObject(SCA_IObject* clientobj);
00070         virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map);
00071         virtual bool Update(double curtime, bool frame);
00072 
00073 #ifdef WITH_PYTHON
00074 
00075         /* Python part */
00076 
00077         /* These are used to get and set m_ob */
00078         static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00079         static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00080         
00081 #endif // WITH_PYTHON
00082 
00083 }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */
00084 
00085 #endif
00086