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
5 #ifndef __C_BILLBOARD_SCENE_NODE_H_INCLUDED__
\r
6 #define __C_BILLBOARD_SCENE_NODE_H_INCLUDED__
\r
8 #include "IBillboardSceneNode.h"
\r
9 #include "S3DVertex.h"
\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
23 MyBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
\r
24 const core::vector3df& position, const core::dimension2d<f32>& size);
\r
26 //! pre render event
\r
27 virtual void OnRegisterSceneNode();
\r
30 virtual void render();
\r
32 //! returns the axis aligned bounding box of this node
\r
33 virtual const core::aabbox3d<f32>& getBoundingBox() const;
\r
35 //! sets the size of the billboard
\r
36 virtual void setSize(const core::dimension2d<f32>& size);
\r
38 //! gets the size of the billboard
\r
39 virtual const core::dimension2d<f32>& getSize() const;
\r
41 virtual video::SMaterial& getMaterial(u32 i);
\r
43 //! returns amount of materials used by this scene node.
\r
44 virtual u32 getMaterialCount() const;
\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
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
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
60 virtual void setTCoords(u32 i, core::vector2d<f32> c);
\r
64 core::dimension2d<f32> Size;
\r
65 core::aabbox3d<f32> BBox;
\r
66 video::SMaterial Material;
\r
68 video::S3DVertex vertices[4];
\r
73 } // end namespace scene
\r
74 } // end namespace irr
\r