diff options
Diffstat (limited to 'libraries/irrlicht-1.8.1/source/Irrlicht/CBillboardSceneNode.h')
-rw-r--r-- | libraries/irrlicht-1.8.1/source/Irrlicht/CBillboardSceneNode.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/CBillboardSceneNode.h b/libraries/irrlicht-1.8.1/source/Irrlicht/CBillboardSceneNode.h new file mode 100644 index 0000000..416b6ff --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/CBillboardSceneNode.h | |||
@@ -0,0 +1,99 @@ | |||
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_BILLBOARD_SCENE_NODE_H_INCLUDED__ | ||
6 | #define __C_BILLBOARD_SCENE_NODE_H_INCLUDED__ | ||
7 | |||
8 | #include "IBillboardSceneNode.h" | ||
9 | #include "S3DVertex.h" | ||
10 | |||
11 | namespace irr | ||
12 | { | ||
13 | namespace scene | ||
14 | { | ||
15 | |||
16 | //! Scene node which is a billboard. A billboard is like a 3d sprite: A 2d element, | ||
17 | //! which always looks to the camera. | ||
18 | class CBillboardSceneNode : virtual public IBillboardSceneNode | ||
19 | { | ||
20 | public: | ||
21 | |||
22 | //! constructor | ||
23 | CBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, | ||
24 | const core::vector3df& position, const core::dimension2d<f32>& size, | ||
25 | video::SColor colorTop=video::SColor(0xFFFFFFFF), | ||
26 | video::SColor colorBottom=video::SColor(0xFFFFFFFF)); | ||
27 | |||
28 | //! pre render event | ||
29 | virtual void OnRegisterSceneNode(); | ||
30 | |||
31 | //! render | ||
32 | virtual void render(); | ||
33 | |||
34 | //! returns the axis aligned bounding box of this node | ||
35 | virtual const core::aabbox3d<f32>& getBoundingBox() const; | ||
36 | |||
37 | //! sets the size of the billboard | ||
38 | virtual void setSize(const core::dimension2d<f32>& size); | ||
39 | |||
40 | //! Sets the widths of the top and bottom edges of the billboard independently. | ||
41 | virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth); | ||
42 | |||
43 | //! gets the size of the billboard | ||
44 | virtual const core::dimension2d<f32>& getSize() const; | ||
45 | |||
46 | //! Gets the widths of the top and bottom edges of the billboard. | ||
47 | virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const; | ||
48 | |||
49 | virtual video::SMaterial& getMaterial(u32 i); | ||
50 | |||
51 | //! returns amount of materials used by this scene node. | ||
52 | virtual u32 getMaterialCount() const; | ||
53 | |||
54 | //! Set the color of all vertices of the billboard | ||
55 | //! \param overallColor: the color to set | ||
56 | virtual void setColor(const video::SColor& overallColor); | ||
57 | |||
58 | //! Set the color of the top and bottom vertices of the billboard | ||
59 | //! \param topColor: the color to set the top vertices | ||
60 | //! \param bottomColor: the color to set the bottom vertices | ||
61 | virtual void setColor(const video::SColor& topColor, | ||
62 | const video::SColor& bottomColor); | ||
63 | |||
64 | //! Gets the color of the top and bottom vertices of the billboard | ||
65 | //! \param[out] topColor: stores the color of the top vertices | ||
66 | //! \param[out] bottomColor: stores the color of the bottom vertices | ||
67 | virtual void getColor(video::SColor& topColor, | ||
68 | video::SColor& bottomColor) const; | ||
69 | |||
70 | //! Writes attributes of the scene node. | ||
71 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const; | ||
72 | |||
73 | //! Reads attributes of the scene node. | ||
74 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0); | ||
75 | |||
76 | //! Returns type of the scene node | ||
77 | virtual ESCENE_NODE_TYPE getType() const { return ESNT_BILLBOARD; } | ||
78 | |||
79 | //! Creates a clone of this scene node and its children. | ||
80 | virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0); | ||
81 | |||
82 | private: | ||
83 | |||
84 | //! Size.Width is the bottom edge width | ||
85 | core::dimension2d<f32> Size; | ||
86 | f32 TopEdgeWidth; | ||
87 | core::aabbox3d<f32> BBox; | ||
88 | video::SMaterial Material; | ||
89 | |||
90 | video::S3DVertex vertices[4]; | ||
91 | u16 indices[6]; | ||
92 | }; | ||
93 | |||
94 | |||
95 | } // end namespace scene | ||
96 | } // end namespace irr | ||
97 | |||
98 | #endif | ||
99 | |||