Planeshift
|
00001 /* 00002 * Author: Andrew Robberts 00003 * 00004 * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 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 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 */ 00019 00020 #ifndef PS_EFFECT_OBJ_DECAL_HEADER 00021 #define PS_EFFECT_OBJ_DECAL_HEADER 00022 00023 #include "pseffectobj.h" 00024 00025 #define PS_EFFECT_ENABLE_DECAL 00026 00027 #ifdef PS_EFFECT_ENABLE_DECAL 00028 #include <ivaria/decal.h> 00029 00030 class psEffect2DRenderer; 00031 00036 class psEffectObjDecal : public psEffectObj 00037 { 00038 public: 00039 psEffectObjDecal(iView* parentView, psEffect2DRenderer* renderer2d); 00040 virtual ~psEffectObjDecal(); 00041 00042 // inheritted function overloads 00043 virtual bool Load(iDocumentNode* node, iLoaderContext* ldr_context); 00044 virtual bool Render(const csVector3 &up); 00045 virtual bool Update(csTicks elapsed); 00046 virtual psEffectObj* Clone() const; 00047 00048 00049 protected: 00050 00056 virtual bool PostSetup(); 00057 00058 csRef<iDecalManager> decalMgr; 00059 iDecal* decal; 00060 csRef<iDecalTemplate> decalTemplate; 00061 00062 // cached values of the current decal so we know if we have to refresh the decal 00063 csVector3 pos; 00064 csVector3 up; 00065 csVector3 normal; 00066 float width; 00067 float height; 00068 }; 00069 00070 #endif // PS_EFFECT_ENABLE_DECAL 00071 00074 #endif