Planeshift
shadowmanager.h
Go to the documentation of this file.
1 /*
2 * shadowmanager.h - Author: Andrew Robberts
3 *
4 * Copyright (C) 2007 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 SHADOW_MANAGER_H
21 #define SHADOW_MANAGER_H
22 
23 // PS INCLUDES
24 #include "pscelclient.h"
25 
26 struct iConfigManager;
27 
32 {
33 private:
34  csRef<iConfigManager> cfgmgr;
35  float shadowRange;
36  bool shadowsEnabled;
37 
38  bool WithinRange(GEMClientObject * object, const csBox3 & bbox = csBox3()) const;
39 public:
42 
43  bool Load(const char * filename);
44 
45  void CreateShadow(GEMClientObject * object);
46  void RemoveShadow(GEMClientObject * object);
47 
48  void RecreateAllShadows();
49  void RemoveAllShadows();
50 
51  float GetShadowRange() const;
52  void SetShadowRange(float shadowRange);
53 
54  void UpdateShadows();
55 
56  void DisableShadows() { shadowsEnabled = false; RemoveAllShadows(); }
57 
58  void EnableShadows() { shadowsEnabled = true; RecreateAllShadows(); }
59 
60  bool ShadowsEnabled() { return shadowsEnabled; }
61 };
62 
63 #endif // SHADOW_MANAGER_H
float GetShadowRange() const
void SetShadowRange(float shadowRange)
void CreateShadow(GEMClientObject *object)
void DisableShadows()
Definition: shadowmanager.h:56
Create shadows under the player/NPC/item entity.
Definition: shadowmanager.h:31
bool ShadowsEnabled()
Definition: shadowmanager.h:60
An object that the client knows about.
Definition: pscelclient.h:373
void RecreateAllShadows()
bool Load(const char *filename)
void RemoveShadow(GEMClientObject *object)
void EnableShadows()
Definition: shadowmanager.h:58
void UpdateShadows()
void RemoveAllShadows()