# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::Portal Class Reference

A planar convex polygon used to define the visibility from one Sector to another. More...

`#include <SceneManagerPortals.hpp>`

Inheritance diagram for vl::Portal:

List of all members.

## Public Member Functions

| Portal ()
| Constructor.
std::vector< fvec3 > & | geometry ()
| The set of points defining the shape of the portal. The points must define a planar convex polygon and must be in world coordinates.
const std::vector< fvec3 > & | geometry () const
| The set of points defining the shape of the portal. The points must define a planar convex polygon and must be in world coordinates.
void | setTargetSector (Sector *sector)
| The Sector that is behind the portal and that is seen through the portal.
Sector * | targetSector ()
| The Sector that is behind the portal and that is seen through the portal.
const Sector * | targetSector () const
| The Sector that is behind the portal and that is seen through the portal.
bool | isOpen () const
| If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() through this portal.
void | setIsOpen (bool is_open)
| If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() through this portal.

## Protected Member Functions

void | setNormal (const fvec3 &n)
| Used internally.
const fvec3 & | normal () const
| Used internally.
bool | computeNormal ()
| Computes the normal of the portal polygon.

## Protected Attributes

std::vector< fvec3 > | mPortalGeometry
ref< Sector > | mTargetSector
fvec3 | mNormal
unsigned int | mVisitTick
bool | mIsOpen

## Friends

class | SceneManagerPortals

## Detailed Description

A planar convex polygon used to define the visibility from one Sector to another.

See also:

- SceneManagerPortals
- Sector
- Portal-Based Culling and Scene Management Tutorial

## Constructor & Destructor Documentation

vl::Portal::Portal | ( |  | ) | `[inline]`

Constructor.

## Member Function Documentation

std::vector<fvec3>& vl::Portal::geometry | ( |  | ) | `[inline]`

The set of points defining the shape of the portal. The points must define a planar convex polygon and must be in world coordinates.

const std::vector<fvec3>& vl::Portal::geometry | ( |  | ) | const`[inline]`

The set of points defining the shape of the portal. The points must define a planar convex polygon and must be in world coordinates.

void vl::Portal::setTargetSector | ( | Sector * | sector | ) | `[inline]`

The Sector that is behind the portal and that is seen through the portal.

Sector* vl::Portal::targetSector | ( |  | ) | `[inline]`

The Sector that is behind the portal and that is seen through the portal.

const Sector* vl::Portal::targetSector | ( |  | ) | const`[inline]`

The Sector that is behind the portal and that is seen through the portal.

bool vl::Portal::isOpen | ( |  | ) | const`[inline]`

If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() through this portal.

void vl::Portal::setIsOpen | ( | bool | is_open | ) | `[inline]`

If a Portal is closed or open. If the portal is closed then the camera cannot see the targetSector() through this portal.

void vl::Portal::setNormal | ( | const fvec3 & | n | ) | `[inline, protected]`

Used internally.

const fvec3& vl::Portal::normal | ( |  | ) | const`[inline, protected]`

Used internally.

bool Portal::computeNormal | ( |  | ) | `[protected]`

Computes the normal of the portal polygon.

Must be called after all the sectors have been setup, linked to their portal, and their AABB has been updated.

## Friends And Related Function Documentation

friend class SceneManagerPortals`[friend]`

## Member Data Documentation

std::vector<fvec3> vl::Portal::mPortalGeometry`[protected]`

ref<Sector> vl::Portal::mTargetSector`[protected]`

fvec3 vl::Portal::mNormal`[protected]`

unsigned int vl::Portal::mVisitTick`[protected]`

bool vl::Portal::mIsOpen`[protected]`

The documentation for this class was generated from the following files:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/SceneManagerPortals.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/SceneManagerPortals.cpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:39 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.