diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CLightSceneNode.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CLightSceneNode.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CLightSceneNode.h b/libraries/irrlicht-1.8/source/Irrlicht/CLightSceneNode.h new file mode 100644 index 0000000..b2940ea --- /dev/null +++ b/libraries/irrlicht-1.8/source/Irrlicht/CLightSceneNode.h | |||
@@ -0,0 +1,108 @@ | |||
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 | #ifndef __C_LIGHT_SCENE_NODE_H_INCLUDED__ | ||
6 | #define __C_LIGHT_SCENE_NODE_H_INCLUDED__ | ||
7 | |||
8 | #include "ILightSceneNode.h" | ||
9 | |||
10 | namespace irr | ||
11 | { | ||
12 | namespace scene | ||
13 | { | ||
14 | |||
15 | //! Scene node which is a dynamic light. You can switch the light on and off by | ||
16 | //! making it visible or not, and let it be animated by ordinary scene node animators. | ||
17 | class CLightSceneNode : public ILightSceneNode | ||
18 | { | ||
19 | public: | ||
20 | |||
21 | //! constructor | ||
22 | CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, | ||
23 | const core::vector3df& position, video::SColorf color, f32 range); | ||
24 | |||
25 | virtual ~CLightSceneNode() { } | ||
26 | |||
27 | //! pre render event | ||
28 | virtual void OnRegisterSceneNode(); | ||
29 | |||
30 | //! render | ||
31 | virtual void render(); | ||
32 | |||
33 | //! set node light data from light info | ||
34 | virtual void setLightData(const video::SLight& light); | ||
35 | |||
36 | //! \return Returns the light data. | ||
37 | virtual const video::SLight& getLightData() const; | ||
38 | |||
39 | //! \return Returns the light data. | ||
40 | virtual video::SLight& getLightData(); | ||
41 | |||
42 | //! Sets if the node should be visible or not. | ||
43 | /** All children of this node won't be visible either, when set | ||
44 | to true. | ||
45 | \param isVisible If the node shall be visible. */ | ||
46 | virtual void setVisible(bool isVisible); | ||
47 | |||
48 | //! returns the axis aligned bounding box of this node | ||
49 | virtual const core::aabbox3d<f32>& getBoundingBox() const; | ||
50 | |||
51 | //! Returns type of the scene node | ||
52 | virtual ESCENE_NODE_TYPE getType() const { return ESNT_LIGHT; } | ||
53 | |||
54 | //! Writes attributes of the scene node. | ||
55 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const; | ||
56 | |||
57 | //! Reads attributes of the scene node. | ||
58 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0); | ||
59 | |||
60 | //! Creates a clone of this scene node and its children. | ||
61 | virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0); | ||
62 | |||
63 | |||
64 | //! Sets the light's radius of influence. | ||
65 | /** Outside this radius the light won't lighten geometry and cast no | ||
66 | shadows. Setting the radius will also influence the attenuation, setting | ||
67 | it to (0,1/radius,0). If you want to override this behavior, set the | ||
68 | attenuation after the radius. | ||
69 | \param radius The new radius. */ | ||
70 | virtual void setRadius(f32 radius); | ||
71 | |||
72 | //! Gets the light's radius of influence. | ||
73 | /** \return The current radius. */ | ||
74 | virtual f32 getRadius() const; | ||
75 | |||
76 | //! Sets the light type. | ||
77 | /** \param type The new type. */ | ||
78 | virtual void setLightType(video::E_LIGHT_TYPE type); | ||
79 | |||
80 | //! Gets the light type. | ||
81 | /** \return The current light type. */ | ||
82 | virtual video::E_LIGHT_TYPE getLightType() const; | ||
83 | |||
84 | //! Sets whether this light casts shadows. | ||
85 | /** Enabling this flag won't automatically cast shadows, the meshes | ||
86 | will still need shadow scene nodes attached. But one can enable or | ||
87 | disable distinct lights for shadow casting for performance reasons. | ||
88 | \param shadow True if this light shall cast shadows. */ | ||
89 | virtual void enableCastShadow(bool shadow=true); | ||
90 | |||
91 | //! Check whether this light casts shadows. | ||
92 | /** \return True if light would cast shadows, else false. */ | ||
93 | virtual bool getCastShadow() const; | ||
94 | private: | ||
95 | |||
96 | video::SLight LightData; | ||
97 | core::aabbox3d<f32> BBox; | ||
98 | s32 DriverLightIndex; | ||
99 | bool LightIsOn; | ||
100 | void doLightRecalc(); | ||
101 | }; | ||
102 | |||
103 | |||
104 | } // end namespace scene | ||
105 | } // end namespace irr | ||
106 | |||
107 | #endif | ||
108 | |||