Blender  V2.59
KX_SCA_AddObjectActuator.h
Go to the documentation of this file.
00001 // $Id: KX_SCA_AddObjectActuator.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 
00034 #ifndef __KX_SCA_AddObjectActuator
00035 #define __KX_SCA_AddObjectActuator
00036 
00037 /* Actuator tree */
00038 #include "SCA_IActuator.h"
00039 #include "SCA_LogicManager.h"
00040 
00041 #include "MT_Vector3.h"
00042 
00043 
00044 
00045 class SCA_IScene;
00046 
00047 class KX_SCA_AddObjectActuator : public SCA_IActuator
00048 {
00049         Py_Header;
00050 
00052         int     m_timeProp;
00053 
00055         SCA_IObject*    m_OriginalObject;
00056 
00058         SCA_IScene*     m_scene;
00059 
00061         float  m_linear_velocity[3];
00063         bool m_localLinvFlag;
00064         
00066         float  m_angular_velocity[3];
00068         bool m_localAngvFlag; 
00069         
00070         
00071         
00072         
00073         SCA_IObject*    m_lastCreatedObject;
00074         
00075 public:
00076 
00082         KX_SCA_AddObjectActuator(
00083                 SCA_IObject *gameobj,
00084                 SCA_IObject *original,
00085                 int time,
00086                 SCA_IScene* scene,
00087                 const float *linvel,
00088                 bool linv_local,
00089                 const float *angvel,
00090                 bool angv_local
00091         );
00092 
00093         ~KX_SCA_AddObjectActuator(void);
00094 
00095                 CValue* 
00096         GetReplica(
00097         ) ;
00098 
00099         virtual void 
00100         ProcessReplica();
00101 
00102         virtual void Replace_IScene(SCA_IScene *val)
00103         {
00104                 m_scene= val;
00105         };
00106 
00107         virtual bool 
00108         UnlinkObject(SCA_IObject* clientobj);
00109 
00110         virtual void 
00111         Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map);
00112 
00113         virtual bool 
00114         Update();
00115 
00116                 SCA_IObject*    
00117         GetLastCreatedObject(
00118         ) const ;
00119 
00120         void    InstantAddObject();
00121 
00122 #ifdef WITH_PYTHON
00123 
00124         KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
00125 
00126         static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00127         static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00128         static PyObject* pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00129         
00130 #endif // WITH_PYTHON
00131 
00132 }; /* end of class KX_SCA_AddObjectActuator : public KX_EditObjectActuator */
00133 
00134 #endif
00135