aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/CVolumeLightSceneNode.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CVolumeLightSceneNode.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CVolumeLightSceneNode.h b/libraries/irrlicht-1.8/source/Irrlicht/CVolumeLightSceneNode.h
new file mode 100644
index 0000000..7ee9e3c
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/CVolumeLightSceneNode.h
@@ -0,0 +1,93 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4//
5// created by Dean Wadsworth aka Varmint Dec 31 2007
6
7#ifndef __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
8#define __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
9
10#include "IVolumeLightSceneNode.h"
11#include "IMesh.h"
12
13namespace irr
14{
15namespace scene
16{
17 class CVolumeLightSceneNode : public IVolumeLightSceneNode
18 {
19 public:
20
21 //! constructor
22 CVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
23 const u32 subdivU = 32, const u32 subdivV = 32,
24 const video::SColor foot = video::SColor(51, 0, 230, 180),
25 const video::SColor tail = video::SColor(0, 0, 0, 0),
26 const core::vector3df& position = core::vector3df(0,0,0),
27 const core::vector3df& rotation = core::vector3df(0,0,0),
28 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
29
30 virtual ~CVolumeLightSceneNode();
31
32 virtual void OnRegisterSceneNode();
33
34 //! renders the node.
35 virtual void render();
36
37 //! returns the axis aligned bounding box of this node
38 virtual const core::aabbox3d<f32>& getBoundingBox() const;
39
40 //! returns the material based on the zero based index i.
41 virtual video::SMaterial& getMaterial(u32 i);
42
43 //! returns amount of materials used by this scene node.
44 virtual u32 getMaterialCount() const;
45
46 //! Returns type of the scene node
47 virtual ESCENE_NODE_TYPE getType() const { return ESNT_VOLUME_LIGHT; }
48
49 //! Writes attributes of the scene node.
50 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
51
52 //! Reads attributes of the scene node.
53 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
54
55 //! Creates a clone of this scene node and its children.
56 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
57
58 virtual void setSubDivideU(const u32 inU);
59 virtual void setSubDivideV(const u32 inV);
60
61 virtual u32 getSubDivideU() const { return SubdivideU; }
62 virtual u32 getSubDivideV() const { return SubdivideV; }
63
64 virtual void setFootColor(const video::SColor inColor);
65 virtual void setTailColor(const video::SColor inColor);
66
67 virtual video::SColor getFootColor() const { return FootColor; }
68 virtual video::SColor getTailColor() const { return TailColor; }
69
70 private:
71 void constructLight();
72
73 IMesh* Mesh;
74
75 f32 LPDistance; // Distance to hypothetical lightsource point -- affects fov angle
76
77 u32 SubdivideU; // Number of subdivisions in U and V space.
78 u32 SubdivideV; // Controls the number of "slices" in the volume.
79 // NOTE : Total number of polygons = 2 + ((SubdivideU + 1) + (SubdivideV + 1)) * 2
80 // Each slice being a quad plus the rectangular plane at the bottom.
81
82 video::SColor FootColor; // Color at the source
83 video::SColor TailColor; // Color at the end.
84
85 core::vector3df LightDimensions; // LightDimensions.Y Distance of shooting -- Length of beams
86 // LightDimensions.X and LightDimensions.Z determine the size/dimension of the plane
87 };
88
89} // end namespace scene
90} // end namespace irr
91
92#endif
93