Visualization Library 2.1.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
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:

Public Member Functions

 Portal ()
 Constructor. More...
 
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. More...
 
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. More...
 
void setTargetSector (Sector *sector)
 The Sector that is behind the portal and that is seen through the portal. More...
 
SectortargetSector ()
 The Sector that is behind the portal and that is seen through the portal. More...
 
const SectortargetSector () const
 The Sector that is behind the portal and that is seen through the portal. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

void setNormal (const fvec3 &n)
 Used internally. More...
 
const fvec3normal () const
 Used internally. More...
 
bool computeNormal ()
 Computes the normal of the portal polygon. More...
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

std::vector< fvec3mPortalGeometry
 
SectormTargetSector
 
fvec3 mNormal
 
unsigned int mVisitTick
 
bool mIsOpen
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Friends

class SceneManagerPortals
 

Detailed Description

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

See also:

Definition at line 53 of file SceneManagerPortals.hpp.

Constructor & Destructor Documentation

◆ Portal()

vl::Portal::Portal ( )
inline

Constructor.

Definition at line 61 of file SceneManagerPortals.hpp.

Member Function Documentation

◆ computeNormal()

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.

◆ geometry() [1/2]

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 69 of file SceneManagerPortals.hpp.

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

◆ geometry() [2/2]

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 71 of file SceneManagerPortals.hpp.

◆ isOpen()

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 81 of file SceneManagerPortals.hpp.

◆ normal()

const fvec3& vl::Portal::normal ( ) const
inlineprotected

Used internally.

Definition at line 89 of file SceneManagerPortals.hpp.

◆ setIsOpen()

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 83 of file SceneManagerPortals.hpp.

◆ setNormal()

void vl::Portal::setNormal ( const fvec3 n)
inlineprotected

Used internally.

Definition at line 87 of file SceneManagerPortals.hpp.

◆ setTargetSector()

void vl::Portal::setTargetSector ( Sector sector)
inline

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

Definition at line 74 of file SceneManagerPortals.hpp.

◆ targetSector() [1/2]

Sector* vl::Portal::targetSector ( )
inline

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

Definition at line 76 of file SceneManagerPortals.hpp.

◆ targetSector() [2/2]

const Sector* vl::Portal::targetSector ( ) const
inline

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

Definition at line 78 of file SceneManagerPortals.hpp.

Friends And Related Function Documentation

◆ SceneManagerPortals

friend class SceneManagerPortals
friend

Definition at line 57 of file SceneManagerPortals.hpp.

Member Data Documentation

◆ mIsOpen

bool vl::Portal::mIsOpen
protected

Definition at line 100 of file SceneManagerPortals.hpp.

◆ mNormal

fvec3 vl::Portal::mNormal
protected

Definition at line 98 of file SceneManagerPortals.hpp.

Referenced by computeNormal().

◆ mPortalGeometry

std::vector<fvec3> vl::Portal::mPortalGeometry
protected

Definition at line 96 of file SceneManagerPortals.hpp.

◆ mTargetSector

Sector* vl::Portal::mTargetSector
protected

Definition at line 97 of file SceneManagerPortals.hpp.

Referenced by computeNormal().

◆ mVisitTick

unsigned int vl::Portal::mVisitTick
protected

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