]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/clouds3d/SkyRenderableInstanceGeneric.hpp
Clouds3D crashes because there is no Light
[simgear.git] / simgear / scene / sky / clouds3d / SkyRenderableInstanceGeneric.hpp
1 //------------------------------------------------------------------------------
2 // File : SkyRenderableInstanceGeneric.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 SkyRenderableInstanceGeneric.hpp
20  * 
21  * Interface for a basic implementation of SkyRenderableInstance
22  */
23 #ifndef __SKYRENDERABLEINSTANCEGENERIC_HPP__
24 #define __SKYRENDERABLEINSTANCEGENERIC_HPP__
25
26 #include "SkyRenderableInstance.hpp"
27
28 // forward to reduce unnecessary dependencies
29 class SkyRenderable;
30 class SkyMinMaxBox;
31
32 //------------------------------------------------------------------------------
33 /**
34  * @class SkyRenderableInstanceGeneric
35  * @brief A generic renderable instance
36  * 
37  * The SkyRenderableInstanceGeneric is a basic implementation of the base class.
38  * For view frustum culling, the function ViewFrustumCull should be called once
39  * per frame, at which point a flag is set if the object is culled or not.  It
40  * is possible that the object is then queried multiple times if it is culled or
41  * not by various other objects before being displayed, that is why the flag is
42  * stored.
43  */
44 class SkyRenderableInstanceGeneric : public SkyRenderableInstance
45 {
46 public:
47   SkyRenderableInstanceGeneric(SkyRenderable *pObject);
48   SkyRenderableInstanceGeneric(SkyRenderable *pObject, 
49                                const Vec3f   &position, 
50                                const Mat33f  &rotation, 
51                                const float   scale);
52   virtual ~SkyRenderableInstanceGeneric();
53
54   // Setters / Getters
55
56   virtual void SetRenderable(SkyRenderable *pRenderable );
57                                                       
58   //! Returns a pointer to the renderable that this instance represents.
59   virtual SkyRenderable* GetRenderable() const     { return _pObj;       }
60
61   virtual SKYRESULT      Display();
62
63   // Test / Set / Get
64   virtual bool           ViewFrustumCull( const Camera &cam );
65
66   
67   virtual SkyMinMaxBox*  GetBoundingVolume() const { return _pBV;        }
68
69 protected:
70
71 protected:
72   SkyRenderable     *_pObj;         // Pointer to the renderable object
73   SkyMinMaxBox      *_pBV;          // Pointer to bounding volume
74 };
75
76 #endif //__SKYRENDERABLEINSTANCEGENERIC_HPP__