|
Blender
V2.59
|
00001 /* 00002 * $Id: KX_WorldIpoController.h 35072 2011-02-22 12:42:55Z jesterking $ 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. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00034 #ifndef KX_WORLDIPOCONTROLLER_H 00035 #define KX_WORLDIPOCONTROLLER_H 00036 00037 #include "SG_Controller.h" 00038 #include "SG_Spatial.h" 00039 #include "KX_IInterpolator.h" 00040 00041 class KX_WorldIpoController : public SG_Controller 00042 { 00043 public: 00044 MT_Scalar m_mist_rgb[3]; 00045 MT_Scalar m_mist_start; 00046 MT_Scalar m_mist_dist; 00047 00048 private: 00049 T_InterpolatorList m_interpolators; 00050 unsigned short m_modify_mist_color : 1; 00051 unsigned short m_modify_mist_start : 1; 00052 unsigned short m_modify_mist_dist : 1; 00053 bool m_modified; 00054 00055 double m_ipotime; 00056 00057 public: 00058 KX_WorldIpoController() : 00059 m_modify_mist_color(false), 00060 m_modify_mist_start(false), 00061 m_modify_mist_dist(false), 00062 m_modified(true), 00063 m_ipotime(0.0) 00064 {} 00065 00066 virtual ~KX_WorldIpoController(); 00067 00068 virtual SG_Controller* GetReplica(class SG_Node* destnode); 00069 00070 virtual bool Update(double time); 00071 00072 virtual void SetSimulatedTime(double time) { 00073 m_ipotime = time; 00074 m_modified = true; 00075 } 00076 00077 void SetModifyMistStart(bool modify) { 00078 m_modify_mist_start = modify; 00079 } 00080 00081 void SetModifyMistColor(bool modify) { 00082 m_modify_mist_color = modify; 00083 } 00084 00085 void SetModifyMistDist(bool modify) { 00086 m_modify_mist_dist = modify; 00087 } 00088 00089 void 00090 SetOption( 00091 int option, 00092 int value 00093 ){ 00094 // intentionally empty 00095 }; 00096 00097 void AddInterpolator(KX_IInterpolator* interp); 00098 00099 00100 #ifdef WITH_CXX_GUARDEDALLOC 00101 public: 00102 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); } 00103 void operator delete( void *mem ) { MEM_freeN(mem); } 00104 #endif 00105 }; 00106 00107 #endif // KX_LIGHTIPOSGCONTROLLER_H 00108