git-svn-id: https://scorched3d.svn.sourceforge.net/svnroot/scorched3d/trunk/scorched...
[scorched3d/parasti.git] / src / client / tankgraph / TargetRendererImpl.h
blobefcfe5a64758b440f09c15cfad6b5f4c84a583fa
1 ////////////////////////////////////////////////////////////////////////////////
2 // Scorched3D (c) 2000-2009
3 //
4 // This file is part of Scorched3D.
5 //
6 // Scorched3D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // Scorched3D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with Scorched3D; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ////////////////////////////////////////////////////////////////////////////////
21 #if !defined(__INCLUDE_TargetRendererImplh_INCLUDE__)
22 #define __INCLUDE_TargetRendererImplh_INCLUDE__
24 #include <target/Target.h>
25 #include <target/TargetRenderer.h>
26 #include <common/Matrix16.h>
28 class TargetVisibilityPatch;
29 class RenderObjectLists;
30 class TargetRendererImpl : public TargetRenderer
32 public:
33 TargetRendererImpl(Target *target);
34 virtual ~TargetRendererImpl();
36 // Interface
37 virtual void drawParticle(float distance) = 0;
38 virtual void simulate(float frameTime) = 0;
39 virtual void moved();
41 // Particles
42 void setMakeParticle() { particleMade_ = false; }
44 // Highlight
45 enum HighlightType
47 eNoHighlight,
48 ePlayerHighlight,
49 eOtherHighlight
51 static void setHighlightType(HighlightType type) { highlightType_ = type; }
52 void createParticle();
54 protected:
55 static HighlightType highlightType_;
56 bool tree_, matrixCached_;
57 Matrix16 cachedMatrix_;
58 Target *target_;
59 TargetVisibilityPatch *currentVisibilityPatch_;
60 int patchEpoc_;
61 bool particleMade_;
63 void drawShield(float shieldHit, float totalTime);
64 void drawParachute();
66 bool getVisible();
68 float getTargetSize();
69 float getTargetFade(float distance, float size);
70 void storeTarget2DPos();
72 void setMovedPatch(TargetVisibilityPatch *newPatch);
74 double posX_, posY_, posZ_;
77 #endif // __INCLUDE_TargetRendererImplh_INCLUDE__