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 00033 #ifndef __KX_STATEACTUATOR 00034 #define __KX_STATEACTUATOR 00035 00036 #include "SCA_IActuator.h" 00037 00038 00039 /* 00040 * Use of SG_DList : element of actuator being deactivated 00041 * Head: SCA_LogicManager::m_removedActuators 00042 * Use of SG_QList : element of global activated state actuator list 00043 * Head: KX_StateActuator::m_stateActuatorHead 00044 */ 00045 class KX_StateActuator : public SCA_IActuator 00046 { 00047 Py_Header 00048 00050 enum { 00051 OP_NOP = -1, 00052 OP_CPY = 0, 00053 OP_SET, 00054 OP_CLR, 00055 OP_NEG, 00056 OP_COUNT 00057 }; 00058 // SG_Dlist: element of objects with active actuators, always put in front of the list 00059 // Head: SCA_LogicManager::m_activeActuators 00060 // SG_QList: Head of active state actuators list globally 00061 // Elements: KX_StateActuator 00062 static SG_QList m_stateActuatorHead; 00063 int m_operation; 00064 int m_mask; 00065 00066 public: 00067 00068 KX_StateActuator( 00069 SCA_IObject* gameobj, 00070 int operation, 00071 unsigned int mask 00072 ); 00073 00074 virtual 00075 ~KX_StateActuator( 00076 void 00077 ); 00078 00079 virtual CValue* 00080 GetReplica( 00081 void 00082 ); 00083 00084 virtual bool 00085 Update(); 00086 00087 virtual void Deactivate(); 00088 virtual void Activate(SG_DList& head); 00089 00090 /* --------------------------------------------------------------------- */ 00091 /* Python interface ---------------------------------------------------- */ 00092 /* --------------------------------------------------------------------- */ 00093 00094 }; 00095 00096 #endif 00097