Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
DynamicShadowManager.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_DYNAMICSHADOWMANAGER_H
13#define TT_INCLUDE_DYNAMICSHADOWMANAGER_H
14class PhysClass;
15class DynTexProjectClass;
16#include "Vector3.h"
17class DynamicShadowManagerClass
18{
19public:
20 DynamicShadowManagerClass(PhysClass & parent);
21 ~DynamicShadowManagerClass(void);
22 void Update_Shadow(void);
23 void Set_Shadow_Planes(float znear = -1.0f,float zfar = -1.0f);
24 void Get_Shadow_Planes(float * set_znear,float * set_zfar);
25 void Enable_Force_Use_Blob_Box(bool onoff) { ForceUseBlobBox = onoff; }
26 bool Is_Force_Use_Blob_Box_Enabled(void) { return ForceUseBlobBox; }
27 void Set_Blob_Box_Projection_Scale(const Vector3 & scl) { BlobBoxProjectionScale = scl; }
28 const Vector3 & Get_Blob_Box_Projection_Scale(void) { return BlobBoxProjectionScale; }
29 bool Is_Casting_Shadow(void) { return (Shadow != NULL); }
30protected:
31 void Allocate_Shadow(void);
32 void Release_Shadow(void);
33
34 PhysClass & Parent; // 0000
35 DynTexProjectClass * Shadow; // 0004
36 float ShadowNearZ; // 0008
37 float ShadowFarZ; // 000C
38 bool ForceUseBlobBox; // 0010
39 Vector3 BlobBoxProjectionScale; // 0014
40private:
41 DynamicShadowManagerClass & operator = (const DynamicShadowManagerClass &);
42}; // 0020
43inline void DynamicShadowManagerClass::Set_Shadow_Planes(float znear,float zfar)
44{
45 ShadowNearZ = znear;
46 ShadowFarZ = zfar;
47}
48inline void DynamicShadowManagerClass::Get_Shadow_Planes(float * set_znear,float * set_zfar)
49{
50 *set_znear = ShadowNearZ;
51 *set_zfar = ShadowFarZ;
52}
53
54#endif