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
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
19 * @file SkyRenderableInstanceGeneric.hpp
21 * Interface for a basic implementation of SkyRenderableInstance
23 #ifndef __SKYRENDERABLEINSTANCEGENERIC_HPP__
24 #define __SKYRENDERABLEINSTANCEGENERIC_HPP__
26 #include "SkyRenderableInstance.hpp"
28 // forward to reduce unnecessary dependencies
32 //------------------------------------------------------------------------------
34 * @class SkyRenderableInstanceGeneric
35 * @brief A generic renderable instance
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
44 class SkyRenderableInstanceGeneric : public SkyRenderableInstance
47 SkyRenderableInstanceGeneric(SkyRenderable *pObject);
48 SkyRenderableInstanceGeneric(SkyRenderable *pObject,
49 const Vec3f &position,
50 const Mat33f &rotation,
52 virtual ~SkyRenderableInstanceGeneric();
56 virtual void SetRenderable(SkyRenderable *pRenderable );
58 //! Returns a pointer to the renderable that this instance represents.
59 virtual SkyRenderable* GetRenderable() const { return _pObj; }
61 virtual SKYRESULT Display();
64 virtual bool ViewFrustumCull( const Camera &cam );
67 virtual SkyMinMaxBox* GetBoundingVolume() const { return _pBV; }
72 SkyRenderable *_pObj; // Pointer to the renderable object
73 SkyMinMaxBox *_pBV; // Pointer to bounding volume
76 #endif //__SKYRENDERABLEINSTANCEGENERIC_HPP__