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
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 SkyRenderableInstanceGroup.hpp
21 * Interface definition for class SkyRenderableInstanceGroup, an instance that groups
24 #ifndef __SKYRENDERABLEINSTANCEGROUP_HPP__
25 #define __SKYRENDERABLEINSTANCEGROUP_HPP__
27 #include "SkyRenderableInstance.hpp"
28 #include "SkyMinMaxBox.hpp"
30 //------------------------------------------------------------------------------
32 * @class SkyRenderableInstanceGroup
33 * @brief A renderable instance that groups other instances.
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 --
38 class SkyRenderableInstanceGroup : public SkyRenderableInstance
41 SkyRenderableInstanceGroup();
42 virtual ~SkyRenderableInstanceGroup();
44 //! Update all sub-instances.
45 virtual SKYRESULT Update(const Camera &cam);
46 //! Render all sub-instances.
47 virtual SKYRESULT Display();
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);
52 //! Adds an instance to the group that this instance represents.
53 void AddSubInstance(SkyRenderableInstance *pInstance, bool bTransparent);
56 InstanceArray _opaqueSubInstances;
57 InstanceArray _transparentSubInstances;
59 SkyMinMaxBox *_pObjectSpaceBV; // Pointer to bounding volume in object space
63 #endif //__SKYRENDERABLEINSTANCEGROUP_HPP__