Planeshift
pseffectobjdecal.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Robberts
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PS_EFFECT_OBJ_DECAL_HEADER
21 #define PS_EFFECT_OBJ_DECAL_HEADER
22 
23 #include "pseffectobj.h"
24 
25 #define PS_EFFECT_ENABLE_DECAL
26 
27 #ifdef PS_EFFECT_ENABLE_DECAL
28 #include <ivaria/decal.h>
29 
30 class psEffect2DRenderer;
31 
37 {
38 public:
39  psEffectObjDecal(iView* parentView, psEffect2DRenderer* renderer2d);
40  virtual ~psEffectObjDecal();
41 
42  // inheritted function overloads
43  virtual bool Load(iDocumentNode* node, iLoaderContext* ldr_context);
44  virtual bool Render(const csVector3 &up);
45  virtual bool Update(csTicks elapsed);
46  virtual psEffectObj* Clone() const;
47 
48 
49 protected:
50 
56  virtual bool PostSetup();
57 
58  csRef<iDecalManager> decalMgr;
59  iDecal* decal;
60  csRef<iDecalTemplate> decalTemplate;
61 
62  // cached values of the current decal so we know if we have to refresh the decal
63  csVector3 pos;
64  csVector3 up;
65  csVector3 normal;
66  float width;
67  float height;
68 };
69 
70 #endif // PS_EFFECT_ENABLE_DECAL
71 
74 #endif
virtual ~psEffectObjDecal()
csRef< iDecalTemplate > decalTemplate
The manager of all 2D effect elements.
virtual psEffectObj * Clone() const
Clones the effect object.
virtual bool PostSetup()
Performs the post setup (after the effect obj has been loaded).
csRef< iDecalManager > decalMgr
psEffectObjDecal(iView *parentView, psEffect2DRenderer *renderer2d)
virtual bool Render(const csVector3 &up)
Renders the effect.
An effect is not much more than a collection of effect objects.
Definition: pseffectobj.h:207
virtual bool Update(csTicks elapsed)
Updates the spell effect – called every frame.
virtual bool Load(iDocumentNode *node, iLoaderContext *ldr_context)
Loads the effect object from an xml node.
psEffect2DRenderer * renderer2d
Definition: pseffectobj.h:529