Check symlinks with stat() to know if they are directories or not
[oweals/minetest.git] / src / MyBillboardSceneNode.h
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_BILLBOARD_SCENE_NODE_H_INCLUDED__\r
6 #define __C_BILLBOARD_SCENE_NODE_H_INCLUDED__\r
7 \r
8 #include "IBillboardSceneNode.h"\r
9 #include "S3DVertex.h"\r
10 \r
11 namespace irr\r
12 {\r
13 namespace scene\r
14 {\r
15 \r
16 //! Scene node which is a billboard. A billboard is like a 3d sprite: A 2d element,\r
17 //! which always looks to the camera. \r
18 class MyBillboardSceneNode : virtual public IBillboardSceneNode\r
19 {\r
20 public:\r
21 \r
22         //! constructor\r
23         MyBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,\r
24                 const core::vector3df& position, const core::dimension2d<f32>& size);\r
25 \r
26         //! pre render event\r
27         virtual void OnRegisterSceneNode();\r
28 \r
29         //! render\r
30         virtual void render();\r
31 \r
32         //! returns the axis aligned bounding box of this node\r
33         virtual const core::aabbox3d<f32>& getBoundingBox() const;\r
34 \r
35         //! sets the size of the billboard\r
36         virtual void setSize(const core::dimension2d<f32>& size);\r
37 \r
38         //! gets the size of the billboard\r
39         virtual const core::dimension2d<f32>& getSize() const;\r
40 \r
41         virtual video::SMaterial& getMaterial(u32 i);\r
42         \r
43         //! returns amount of materials used by this scene node.\r
44         virtual u32 getMaterialCount() const;\r
45         \r
46         //! Set the color of all vertices of the billboard\r
47         //! \param overallColor: the color to set\r
48         virtual void setColor(const video::SColor & overallColor);\r
49 \r
50         //! Set the color of the top and bottom vertices of the billboard\r
51         //! \param topColor: the color to set the top vertices\r
52         //! \param bottomColor: the color to set the bottom vertices\r
53         virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor);\r
54 \r
55         //! Gets the color of the top and bottom vertices of the billboard\r
56         //! \param[out] topColor: stores the color of the top vertices\r
57         //! \param[out] bottomColor: stores the color of the bottom vertices\r
58         virtual void getColor(video::SColor& topColor, video::SColor& bottomColor) const;\r
59 \r
60         virtual void setTCoords(u32 i, core::vector2d<f32> c);\r
61 \r
62 private:\r
63 \r
64         core::dimension2d<f32> Size;\r
65         core::aabbox3d<f32> BBox;\r
66         video::SMaterial Material;\r
67 \r
68         video::S3DVertex vertices[4];\r
69         u16 indices[6];\r
70 };\r
71 \r
72 \r
73 } // end namespace scene\r
74 } // end namespace irr\r
75 \r
76 #endif\r
77 \r