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