Visualization Library 2.0.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 Attributes | List of all members
vl::SceneManagerBVH< T > Class Template Reference

The SceneManagerBVH class implements the basic functionalities for bounding-volume-hierarchy based scene managers. More...

#include <SceneManagerBVH.hpp>

+ Inheritance diagram for vl::SceneManagerBVH< T >:

Public Member Functions

void setTree (T *bbh)
 Sets the tree to be used by the scene manager. More...
 
const T * tree () const
 Returns the tree used by the scene manager. More...
 
T * tree ()
 Returns the tree used by the scene manager. More...
 
virtual void extractVisibleActors (ActorCollection &list, const Camera *camera)
 Extracts all the enabled and visible Actors contained in the ActorTree hierarchy and appends them to the given ActorCollection. More...
 
virtual void extractActors (ActorCollection &list)
 Appends all the Actors contained in the scene manager without performing frustum culling or checking enable masks. More...
 
- Public Member Functions inherited from vl::SceneManager
 SceneManager ()
 Constructor. More...
 
virtual void computeBounds ()
 Computes the bounding box and bounding sphere of the scene manager and of all the Actors contained in the SceneManager. More...
 
void setBoundingSphere (const Sphere &sphere)
 Explicitly set the scene manager's bounding sphere. See also computeBounds(). More...
 
const SphereboundingSphere () const
 Returns the scene manager's bounding sphere. More...
 
void setBoundingBox (const AABB &bbox)
 Explicitly set the scene manager's bounding sphere. See also computeBounds(). More...
 
const AABBboundingBox () const
 Returns the scene manager's bounding box. More...
 
void setBoundsDirty (bool dirty)
 Flags a scene manager's bounding box and bounding sphere as dirty. The bounds will be recomputed using computeBounds() at the next rendering frame. More...
 
bool boundsDirty () const
 Returns true if the scene manager's bounds should be recomputed at the next rendering frame. More...
 
void setCullingEnabled (bool enable)
 Used to enable or disable frustum culling or whichever culling system the scene manager implements. More...
 
bool cullingEnabled () const
 Used to enable or disable frustum culling or whichever culling system the scene manager implements. More...
 
void setEnableMask (unsigned int enabled)
 The enable mask to be used by extractVisibleActors() More...
 
unsigned int enableMask () const
 The enable mask to be used by extractVisibleActors() More...
 
bool isEnabled (Actor *a) const
 Returns true if "a->enableMask() & enableMask()) != 0". 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 Attributes

ref< T > mBoundingVolumeTree
 
- Protected Attributes inherited from vl::SceneManager
Sphere mSphere
 
AABB mAABB
 
unsigned int mEnableMask
 
bool mBoundsDirty
 
bool mCullingEnabled
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

template<class T>
class vl::SceneManagerBVH< T >

The SceneManagerBVH class implements the basic functionalities for bounding-volume-hierarchy based scene managers.

See also

Definition at line 55 of file SceneManagerBVH.hpp.

Member Function Documentation

◆ extractActors()

template<class T>
virtual void vl::SceneManagerBVH< T >::extractActors ( ActorCollection list)
inlinevirtual

Appends all the Actors contained in the scene manager without performing frustum culling or checking enable masks.

Implements vl::SceneManager.

Definition at line 78 of file SceneManagerBVH.hpp.

Referenced by vl::SceneManagerBVH< ActorTree >::extractVisibleActors().

◆ extractVisibleActors()

template<class T>
virtual void vl::SceneManagerBVH< T >::extractVisibleActors ( ActorCollection list,
const Camera camera 
)
inlinevirtual

Extracts all the enabled and visible Actors contained in the ActorTree hierarchy and appends them to the given ActorCollection.

See also
SceneManager::enableMask(), Actor::enableMask(), Actor::isEnabled(), ActorTreeAbstract::isEnabled()

Implements vl::SceneManager.

Definition at line 67 of file SceneManagerBVH.hpp.

◆ setTree()

template<class T>
void vl::SceneManagerBVH< T >::setTree ( T *  bbh)
inline

Sets the tree to be used by the scene manager.

Definition at line 61 of file SceneManagerBVH.hpp.

◆ tree() [1/2]

template<class T>
const T* vl::SceneManagerBVH< T >::tree ( ) const
inline

Returns the tree used by the scene manager.

Definition at line 63 of file SceneManagerBVH.hpp.

Referenced by vl::SceneManagerBVH< ActorTree >::extractActors(), and vl::SceneManagerBVH< ActorTree >::extractVisibleActors().

◆ tree() [2/2]

template<class T>
T* vl::SceneManagerBVH< T >::tree ( )
inline

Returns the tree used by the scene manager.

Definition at line 65 of file SceneManagerBVH.hpp.

Member Data Documentation

◆ mBoundingVolumeTree

template<class T>
ref<T> vl::SceneManagerBVH< T >::mBoundingVolumeTree
protected

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