# Visualization Library

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

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

Public Member Functions | Protected Member Functions | Protected Attributes | Friends

# 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

virtual const char * | className ()
| Returns the name of the class.
| 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
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

Definition at line 53 of file SceneManagerPortals.hpp.

## Constructor & Destructor Documentation

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

Constructor.

Definition at line 60 of file SceneManagerPortals.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

## Member Function Documentation

virtual const char* vl::Portal::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 57 of file SceneManagerPortals.hpp.

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.

Definition at line 68 of file SceneManagerPortals.hpp.

Referenced by computeNormal(), and vl::SceneManagerPortals::renderPortal().

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.

Definition at line 70 of file SceneManagerPortals.hpp.

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

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

Definition at line 73 of file SceneManagerPortals.hpp.

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

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

Definition at line 75 of file SceneManagerPortals.hpp.

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

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

Definition at line 77 of file SceneManagerPortals.hpp.

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.

Definition at line 80 of file SceneManagerPortals.hpp.

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.

Definition at line 82 of file SceneManagerPortals.hpp.

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

Used internally.

Definition at line 86 of file SceneManagerPortals.hpp.

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

Used internally.

Definition at line 88 of file SceneManagerPortals.hpp.

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.

Definition at line 42 of file SceneManagerPortals.cpp.

References vl::cross(), vl::Log::error(), geometry(), mNormal, and mTargetSector.

## Friends And Related Function Documentation

friend class SceneManagerPortals`[friend]`

Definition at line 55 of file SceneManagerPortals.hpp.

## Member Data Documentation

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

Definition at line 95 of file SceneManagerPortals.hpp.

Sector* vl::Portal::mTargetSector`[protected]`

Definition at line 96 of file SceneManagerPortals.hpp.

Referenced by computeNormal().

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

Definition at line 97 of file SceneManagerPortals.hpp.

Referenced by computeNormal().

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

Definition at line 98 of file SceneManagerPortals.hpp.

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

Definition at line 99 of file SceneManagerPortals.hpp.

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/SceneManagerPortals.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/SceneManagerPortals.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:45.
Permission is granted to use this page to write and publish articles regarding Visualization Library.