]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/clouds3d/SkyRenderableInstanceGroup.hpp
Clouds3D crashes because there is no Light
[simgear.git] / simgear / scene / sky / clouds3d / SkyRenderableInstanceGroup.hpp
1 //------------------------------------------------------------------------------
2 // File : SkyRenderableInstanceGroup.hpp
3 //------------------------------------------------------------------------------
4 // SkyWorks : Copyright 2002 Mark J. Harris and
5 //                                              The University of North Carolina at Chapel Hill
6 //------------------------------------------------------------------------------
7 // Permission to use, copy, modify, distribute and sell this software and its 
8 // documentation for any purpose is hereby granted without fee, provided that 
9 // the above copyright notice appear in all copies and that both that copyright 
10 // notice and this permission notice appear in supporting documentation. 
11 // Binaries may be compiled with this software without any royalties or 
12 // restrictions. 
13 //
14 // The author(s) and The University of North Carolina at Chapel Hill make no 
15 // representations about the suitability of this software for any purpose. 
16 // It is provided "as is" without express or 
17 // implied warranty.
18 /**
19  * @file SkyRenderableInstanceGroup.hpp
20  * 
21  * Interface definition for class SkyRenderableInstanceGroup, an instance that groups
22  * other instances.
23  */
24 #ifndef __SKYRENDERABLEINSTANCEGROUP_HPP__
25 #define __SKYRENDERABLEINSTANCEGROUP_HPP__
26
27 #include "SkyRenderableInstance.hpp"
28 #include "SkyMinMaxBox.hpp"
29
30 //------------------------------------------------------------------------------
31 /**
32  * @class SkyRenderableInstanceGroup
33  * @brief A renderable instance that groups other instances.
34  * 
35  * This class provides a very basic way to implement static hierarchies of objects.
36  * It is not meant to be a full scene graph -- 
37  */
38 class SkyRenderableInstanceGroup : public SkyRenderableInstance
39 {
40 public:
41         SkyRenderableInstanceGroup();
42         virtual ~SkyRenderableInstanceGroup();
43
44   //! Update all sub-instances.
45   virtual SKYRESULT Update(const Camera &cam);
46   //! Render all sub-instances.
47   virtual SKYRESULT Display();
48
49   //! Returns true if and only if the bounding volume of this instance lies entirely outside @a cam.  
50   virtual bool      ViewFrustumCull(const Camera &cam);
51   
52   //! Adds an instance to the group that this instance represents.
53   void              AddSubInstance(SkyRenderableInstance *pInstance, bool bTransparent);
54
55 protected:
56   InstanceArray _opaqueSubInstances;
57   InstanceArray _transparentSubInstances;
58   
59   SkyMinMaxBox  *_pObjectSpaceBV; // Pointer to bounding volume in object space
60 };
61
62
63 #endif //__SKYRENDERABLEINSTANCEGROUP_HPP__