32 #ifndef PortalSceneManager_INCLUDE_ONCE 33 #define PortalSceneManager_INCLUDE_ONCE 46 class SceneManagerPortals;
63 VL_DEBUG_SET_OBJECT_NAME()
69 std::vector<fvec3>&
geometry() {
return mPortalGeometry; }
71 const std::vector<fvec3>&
geometry()
const {
return mPortalGeometry; }
81 bool isOpen()
const {
return mIsOpen; }
136 VL_DEBUG_SET_OBJECT_NAME()
146 std::vector< ref<Portal> >&
portals() {
return mPortals; }
148 const std::vector< ref<Portal> >&
portals()
const {
return mPortals; }
152 std::vector< AABB >&
volumes() {
return mVolumes; }
155 const std::vector< AABB >&
volumes()
const {
return mVolumes; }
158 AABB computeBoundingBox();
160 std::vector< ref<VisibilityCallback> >&
callbacks() {
return mCallbacks; }
161 const std::vector< ref<VisibilityCallback> >&
callbacks()
const {
return mCallbacks; }
192 VL_DEBUG_SET_OBJECT_NAME()
201 std::vector< ref<Sector> >&
sectors() {
return mSectors; }
203 const std::vector< ref<Sector> >&
sectors()
const {
return mSectors; }
217 void computePortalNormals();
230 const std::vector<Frustum>&
frustumStack()
const {
return mFrustumStack; }
233 void renderPortal(
Portal* portal);
Sector * targetSector()
The Sector that is behind the portal and that is seen through the portal.
The SceneManagerPortals calss implements a portal-based hidden surface removal algorithm to efficentl...
std::vector< ref< Actor > > mTempActors
std::vector< ref< Sector > > mSectors
std::map< Portal *, ref< Actor > > mPortalActorMap
ref< ActorCollection > mActors
void setShowPortals(bool show)
Whether portals should be shown in the rendering or not.
const std::vector< ref< Sector > > & sectors() const
The Sectors that are part of the scene.
ActorCollection * actors()
The Actor object contained in a sector. An actor can be part of multiple sectors. ...
bool showPortals() const
Whether portals should be shown in the rendering or not.
std::vector< fvec3 > & geometry()
The set of points defining the shape of the portal. The points must define a planar convex polygon an...
std::vector< AABB > mVolumes
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
void setTargetSector(Sector *sector)
The Sector that is behind the portal and that is seen through the portal.
const ActorCollection * actors() const
The Actor object contained in a sector. An actor can be part of multiple sectors. ...
Visualization Library main namespace.
A callback object called each time a Sector becomes visible through a Portal.
Sector * externalSector()
Returns the external sector.
const std::vector< Frustum > & frustumStack() const
The stack of frustums active at a given point during sector discovery.
const std::vector< ref< VisibilityCallback > > & callbacks() const
The AABB class implements an axis-aligned bounding box using vl::real precision.
void setIsOpen(bool is_open)
If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() ...
The base class for all the reference counted objects.
std::vector< ref< Sector > > & sectors()
The Sectors that are part of the scene.
The SceneManager class is the base class for all the scene managers.
void invalidatePortalActors()
Regenerates the portal actors next time their rendering is requested.
std::vector< ref< VisibilityCallback > > mCallbacks
const fvec3 & normal() const
Used internally.
const Sector * targetSector() const
The Sector that is behind the portal and that is seen through the portal.
#define VLGRAPHICS_EXPORT
SceneManagerPortals()
Constructor.
std::vector< ref< Portal > > mPortals
Defines an area containg a set if Actors that is connected to other Sector[s] through its Portal[s]...
std::vector< Frustum > mFrustumStack
Defined as a simple subclass of Collection<Actor>, see Collection for more information.
std::vector< ref< VisibilityCallback > > & callbacks()
The ref<> class is used to reference-count an Object.
std::vector< AABB > & volumes()
A set of volumes used to test if the camera is or not inside a Sector.
const std::vector< AABB > & volumes() const
A set of volumes used to test if the camera is or not inside a Sector.
bool isOpen() const
If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() ...
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
const Sector * externalSector() const
Returns the external sector.
const std::vector< ref< Portal > > & portals() const
The portals within a sector that connect it to other sectors.
ref< Sector > mExternalSector
const std::vector< fvec3 > & geometry() const
The set of points defining the shape of the portal. The points must define a planar convex polygon an...
std::vector< fvec3 > mPortalGeometry
void setNormal(const fvec3 &n)
Used internally.
A planar convex polygon used to define the visibility from one Sector to another. ...
std::vector< ref< Portal > > & portals()
The portals within a sector that connect it to other sectors.