PixelLightAPI  .
Classes | Public Types | Public Member Functions | Public Attributes
PLScene::SQCull Class Reference

Visibility determination scene query class. More...

#include <SQCull.h>

Inheritance diagram for PLScene::SQCull:
Inheritance graph
[legend]

List of all members.

Classes

struct  Statistics
 Several statistics of the culling process. More...

Public Types

enum  EMode { Frustum = 0, StopAndWait = 1, Coherent = 2, Previous = 3 }
 Cull mode. More...

Public Member Functions

 pl_class (PLS_RTTI_EXPORT, SQCull,"PLScene", PLScene::SceneQuery,"Visibility determination scene query class") pl_constructor_0(DefaultConstructor
PLS_API SQCull ()
 Default constructor.
virtual PLS_API ~SQCull ()
 Destructor.
PLS_API EMode GetMode () const
 Returns the used cull mode.
PLS_API void SetMode (EMode nMode=Coherent)
 Sets the used cull mode.
PLS_API PLCore::uint32 GetVisibilityThreshold () const
 Returns visibility threshold.
PLS_API void SetVisibilityThreshold (PLCore::uint32 nThreshold=1)
 Sets visible pixels threshold for visibility classification.
PLS_API const StatisticsGetStatistics () const
 Returns the statistics.
PLS_API SceneContainerGetCameraContainer () const
 Returns the container the camera is in.
PLS_API bool SetCameraContainer (SceneContainer *pCameraContainer)
 Sets the container the camera is in.
PLS_API const PLMath::Vector3GetCameraPosition () const
 Returns the used camera position.
PLS_API void SetCameraPosition (const PLMath::Vector3 &vPos)
 Sets the used camera position.
PLS_API const PLMath::PlaneSetGetViewFrustum () const
 Returns the used view frustum.
PLS_API void SetViewFrustum (const PLMath::PlaneSet &cFrustum)
 Sets the used view frustum.
PLS_API const PLMath::Matrix4x4GetProjectionMatrix () const
PLS_API void SetProjectionMatrix (const PLMath::Matrix4x4 &mProjection)
PLS_API const PLMath::Matrix4x4GetViewMatrix () const
PLS_API void SetViewMatrix (const PLMath::Matrix4x4 &mView)
PLS_API const PLMath::Matrix4x4GetViewProjectionMatrix () const
PLS_API void SetViewProjectionMatrix (const PLMath::Matrix4x4 &mViewProjection)
PLS_API const VisContainerGetVisRootContainer () const
 Returns the visibility root container.
PLS_API const VisContainerGetVisContainer () const
 Returns the visibility container this scene query belongs to.
virtual PLS_API bool PerformQuery () override
 Performs the query.

Public Attributes

Default constructor

Detailed Description

Visibility determination scene query class.

Remarks:
This scene query is used to request the current visible scene nodes. (Hidden Surface Removal (HSR)) You can choose between different culling algorithms whereby the advanced techniques not only ignore scene nodes outside the view frustum but also scene nodes which are hidden through other scene nodes. Additionally, some statistics are calculated. In optimal situations, cells&portals, frustum culling and occlusion culling are used all together to get the desired results. The result of the whole process is called PVS. (Potential Visibility Set)
Note:
  • The 'PerformQuery()'-call must be done within the correct render target and with a valid set viewport and scissor rectangle

Member Enumeration Documentation

Cull mode.

Enumerator:
Frustum 

Culls the scene with view frustum culling only

StopAndWait 

Culls the scene with the hierarchical stop and wait algorithm

Coherent 

Culls the scene with the coherent hierarchical algorithm (CHC)

Previous 

Culls the scene using the visibility information of the previous frame


Constructor & Destructor Documentation

Default constructor.

virtual PLS_API PLScene::SQCull::~SQCull ( ) [virtual]

Destructor.


Member Function Documentation

PLScene::SQCull::pl_class ( PLS_RTTI_EXPORT  ,
SQCull  ,
"PLScene"  ,
PLScene::SceneQuery  ,
"Visibility determination scene query class"   
)
PLS_API EMode PLScene::SQCull::GetMode ( ) const

Returns the used cull mode.

Returns:
Used cull mode
PLS_API void PLScene::SQCull::SetMode ( EMode  nMode = Coherent)

Sets the used cull mode.

Parameters:
[in]nModeUsed cull mode
PLS_API PLCore::uint32 PLScene::SQCull::GetVisibilityThreshold ( ) const

Returns visibility threshold.

Returns:
Visibility threshold
Remarks:
The visibility threshold is dependent of the render target dimension. If you set the visibility threshold to 100 and your render target dimension is 100x100 scene nodes may ugly disappear and at a render target dimension of 1000x1000 you can't see such disappearances.
Note:
  • Used by the render modes StopAndWait and Coherent
PLS_API void PLScene::SQCull::SetVisibilityThreshold ( PLCore::uint32  nThreshold = 1)

Sets visible pixels threshold for visibility classification.

Parameters:
[in]nThresholdThreshold
See also:
PLS_API const Statistics& PLScene::SQCull::GetStatistics ( ) const

Returns the statistics.

Returns:
Statistics

Returns the container the camera is in.

Returns:
Container the camera is in, a null pointer on error
PLS_API bool PLScene::SQCull::SetCameraContainer ( SceneContainer pCameraContainer)

Sets the container the camera is in.

Parameters:
[in]pCameraContainerContainer the camera is in, can be a null pointer
Returns:
'true' if all went fine, else 'false'

Returns the used camera position.

Returns:
The used camera position (container space)
PLS_API void PLScene::SQCull::SetCameraPosition ( const PLMath::Vector3 vPos)

Sets the used camera position.

Parameters:
[in]vPosThe used camera position (container space)

Returns the used view frustum.

Returns:
The used view frustum (container space)
PLS_API void PLScene::SQCull::SetViewFrustum ( const PLMath::PlaneSet cFrustum)

Sets the used view frustum.

Parameters:
[in]cFrustumThe used view frustum (container space)
PLS_API void PLScene::SQCull::SetProjectionMatrix ( const PLMath::Matrix4x4 mProjection)
PLS_API void PLScene::SQCull::SetViewMatrix ( const PLMath::Matrix4x4 mView)
PLS_API void PLScene::SQCull::SetViewProjectionMatrix ( const PLMath::Matrix4x4 mViewProjection)

Returns the visibility root container.

Returns:
The visibility root container, a null pointer on error
See also:

Returns the visibility container this scene query belongs to.

Returns:
The visibility container this scene query belongs to, same as GetRootContainer() if this is the visibility root container
Remarks:
After you performed the cull query (= visibility determination) you can use this function to get the resulting visibility scene tree. Using this tree, you can render the visible parts of the scene without any effort.
virtual PLS_API bool PLScene::SQCull::PerformQuery ( ) [override, virtual]

Performs the query.

Note:
  • Before you start the query you have to do some settings within the derived query classes first. (for instance setting the query volume)
Returns:
'true' if the query was cancelled by the user, else 'false'

Implements PLScene::SceneQuery.


Member Data Documentation


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:42
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported