|
Blender
V2.59
|
00001 /* 00002 * $Id: KX_ParentActuator.h 36523 2011-05-06 20:18:42Z blendix $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. The Blender 00010 * Foundation also sells licenses for use in proprietary software under 00011 * the Blender License. See http://www.blender.org/BL/ for information 00012 * about this. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 * 00023 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00024 * All rights reserved. 00025 * 00026 * The Original Code is: all of this file. 00027 * 00028 * Contributor(s): none yet. 00029 * 00030 * ***** END GPL LICENSE BLOCK ***** 00031 */ 00032 00038 #ifndef __KX_PARENTACTUATOR 00039 #define __KX_PARENTACTUATOR 00040 00041 #include "SCA_IActuator.h" 00042 #include "SCA_LogicManager.h" 00043 00044 class KX_ParentActuator : public SCA_IActuator 00045 { 00046 Py_Header; 00047 00049 int m_mode; 00050 00052 bool m_addToCompound; 00053 bool m_ghost; 00055 SCA_IObject *m_ob; 00056 00057 00058 00059 public: 00060 enum KX_PARENTACT_MODE 00061 { 00062 KX_PARENT_NODEF = 0, 00063 KX_PARENT_SET, 00064 KX_PARENT_REMOVE, 00065 KX_PARENT_MAX 00066 00067 }; 00068 00069 KX_ParentActuator(class SCA_IObject* gameobj, 00070 int mode, 00071 bool addToCompound, 00072 bool ghost, 00073 SCA_IObject *ob); 00074 virtual ~KX_ParentActuator(); 00075 virtual bool Update(); 00076 00077 virtual CValue* GetReplica(); 00078 virtual void ProcessReplica(); 00079 virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); 00080 virtual bool UnlinkObject(SCA_IObject* clientobj); 00081 00082 #ifdef WITH_PYTHON 00083 00084 /* --------------------------------------------------------------------- */ 00085 /* Python interface ---------------------------------------------------- */ 00086 /* --------------------------------------------------------------------- */ 00087 00088 /* These are used to get and set m_ob */ 00089 static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); 00090 static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); 00091 00092 #endif // WITH_PYTHON 00093 00094 }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ 00095 00096 #endif 00097