RigsofRods
Soft-body Physics Simulation
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Hydrax::RttManager Class Reference

Rtt's manager class. More...

#include <RttManager.h>

+ Collaboration diagram for Hydrax::RttManager:

Data Structures

class  CDepthListener
 
class  CDepthReflectionListener
 
class  CGPUNormalMapListener
 
class  CReflectionListener
 RttManager::CReflectionListener class. More...
 
class  CRefractionListener
 RttManager::CRefractionListener class. More...
 
class  RttListener
 Rtt Listener class. More...
 
struct  RttOptions
 Rtt options struct. More...
 

Public Types

enum  RttType {
  RTT_REFLECTION = 0, RTT_REFRACTION = 1, RTT_DEPTH = 2, RTT_DEPTH_REFLECTION = 3,
  RTT_DEPTH_AIP = 4, RTT_GPU_NORMAL_MAP = 5
}
 Rtt enumeration. More...
 
enum  BitsPerChannel { BPC_8 = 8, BPC_16 = 16, BPC_32 = 32 }
 Bits per channel. More...
 
enum  NumberOfChannels { NOC_1 = 1, NOC_2 = 2, NOC_3 = 3, NOC_4 = 4 }
 Number of channels. More...
 

Public Member Functions

 RttManager (Hydrax *h)
 Constructor. More...
 
 ~RttManager ()
 Destructor. More...
 
void initialize (const RttType &Rtt)
 Initialize a RTT. More...
 
void remove (const RttType &Rtt)
 Removes a RTT. More...
 
void removeAll ()
 Remove all RttManager resources. More...
 
const Ogre::String & getRttName (RttType Rtt) const
 Get RTT texture name. More...
 
Ogre::TexturePtr getTexture (RttType Rtt)
 Get Rtt texture. More...
 
Ogre::SceneNode * getPlanesSceneNode ()
 
Ogre::MovablePlane * getPlane (RttType Rtt)
 Get Rtt plane. More...
 
const SizegetTextureSize (const RttType &Rtt) const
 
void setTextureSize (const RttType &Rtt, const Size &S)
 Set Rtt texture size. More...
 
void setTexturesSize (const Size &S)
 Set Rtt textures size. More...
 
const Ogre::PixelFormat getPixelFormat (const RttType &Rtt) const
 
void setNumberOfChannels (const RttType &Rtt, const NumberOfChannels &NOC)
 
const NumberOfChannelsgetNumberOfChannels (const RttType &Rtt) const
 
void setBitsPerChannel (const RttType &Rtt, const BitsPerChannel &BPC)
 
const BitsPerChannelgetBitsPerChannel (const RttType &Rtt) const
 
const RttOptionsgetRttOptions (const RttType &Rtt) const
 
void setReflectionDisplacementError (const Ogre::Real &ReflectionDisplacementError)
 Range [0.05, ~2], increase if you experience reflection issues when the camera is near to the water. More...
 
const Ogre::Real & getReflectionDisplacementError () const
 
void setDisableReflectionCustomNearCliplPlaneRenderQueues (const std::vector< Ogre::RenderQueueGroupID > &DisableReflectionCustomNearClipPlaneRenderQueues)
 
const std::vector< Ogre::RenderQueueGroupID > & getDisableReflectionCustomNearClipPlaneRenderQueues ()
 
void addRttListener (RttListener *l)
 
void removeRttListener (RttListener *l, const bool &releaseMemory=true)
 
void removeAllRttListeners (const bool &releaseMemory=true)
 

Private Member Functions

void _initializeRtt (const RttType &Rtt, const Ogre::Vector3 &RttPlaneNormal, const Ogre::ColourValue &BackgroundColour, const bool &RenderSky, Ogre::RenderTargetListener *RTListener, const Ogre::String &MaterialScheme="", const bool &ShadowsEnabled=true)
 
const bool _isRenderQueueInList (const std::vector< Ogre::RenderQueueGroupID > &l, const Ogre::RenderQueueGroupID &rq)
 
void _invokeRttListeners (const RttType &Rtt, const bool &pre)
 Invoke Rtt Listeners. More...
 

Private Attributes

HydraxmHydrax
 Hydrax parent pointer. More...
 
Ogre::SceneNode * mPlanesSceneNode
 SceneNode to attach our planes. More...
 
Ogre::MovablePlane * mPlanes [6]
 Rtt planes vector. More...
 
Ogre::TexturePtr mTextures [6]
 Rtt textures vector. More...
 
RttOptions mRttOptions [6]
 Rtt options. More...
 
CReflectionListener mReflectionListener
 Rtt listener objects. More...
 
CRefractionListener mRefractionListener
 
CDepthListener mDepthListener
 
CDepthReflectionListener mDepthReflectionListener
 
CGPUNormalMapListener mGPUNormalMapListener
 
std::vector< Ogre::RenderQueueGroupID > mDisableReflectionCustomNearClipPlaneRenderQueues
 Render queues to exclude of the reflection custom near clip plane. More...
 
std::vector< RttListener * > mRttListeners
 Rtt listeners. More...
 
Ogre::Real mReflectionDisplacementError
 Reflection displacement error, range [0.01, ~2]. More...
 

Detailed Description

Rtt's manager class.

Definition at line 45 of file RttManager.h.

Member Enumeration Documentation

◆ BitsPerChannel

Bits per channel.

Enumerator
BPC_8 
BPC_16 
BPC_32 

Definition at line 62 of file RttManager.h.

◆ NumberOfChannels

Number of channels.

Enumerator
NOC_1 
NOC_2 
NOC_3 
NOC_4 

Definition at line 71 of file RttManager.h.

◆ RttType

Rtt enumeration.

Enumerator
RTT_REFLECTION 
RTT_REFRACTION 
RTT_DEPTH 
RTT_DEPTH_REFLECTION 
RTT_DEPTH_AIP 
RTT_GPU_NORMAL_MAP 

Definition at line 50 of file RttManager.h.

Constructor & Destructor Documentation

◆ RttManager()

Hydrax::RttManager::RttManager ( Hydrax h)

Constructor.

Parameters
hHydrax parent pointer

Definition at line 40 of file RttManager.cpp.

◆ ~RttManager()

Hydrax::RttManager::~RttManager ( )

Destructor.

Definition at line 73 of file RttManager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _initializeRtt()

void Hydrax::RttManager::_initializeRtt ( const RttType Rtt,
const Ogre::Vector3 &  RttPlaneNormal,
const Ogre::ColourValue &  BackgroundColour,
const bool &  RenderSky,
Ogre::RenderTargetListener *  RTListener,
const Ogre::String &  MaterialScheme = "",
const bool &  ShadowsEnabled = true 
)
private

Definition at line 168 of file RttManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _invokeRttListeners()

void Hydrax::RttManager::_invokeRttListeners ( const RttType Rtt,
const bool &  pre 
)
private

Invoke Rtt Listeners.

Parameters
RttRtt type
pretrue for Pre render target update, false for Post render target update

◆ _isRenderQueueInList()

const bool Hydrax::RttManager::_isRenderQueueInList ( const std::vector< Ogre::RenderQueueGroupID > &  l,
const Ogre::RenderQueueGroupID &  rq 
)
inlineprivate

Definition at line 343 of file RttManager.h.

◆ addRttListener()

void Hydrax::RttManager::addRttListener ( RttListener l)
inline

Definition at line 236 of file RttManager.h.

◆ getBitsPerChannel()

const BitsPerChannel& Hydrax::RttManager::getBitsPerChannel ( const RttType Rtt) const
inline

Definition at line 204 of file RttManager.h.

◆ getDisableReflectionCustomNearClipPlaneRenderQueues()

const std::vector<Ogre::RenderQueueGroupID>& Hydrax::RttManager::getDisableReflectionCustomNearClipPlaneRenderQueues ( )
inline

Definition at line 231 of file RttManager.h.

◆ getNumberOfChannels()

const NumberOfChannels& Hydrax::RttManager::getNumberOfChannels ( const RttType Rtt) const
inline

Definition at line 189 of file RttManager.h.

◆ getPixelFormat()

const Ogre::PixelFormat Hydrax::RttManager::getPixelFormat ( const RttType Rtt) const

Definition at line 277 of file RttManager.cpp.

+ Here is the caller graph for this function:

◆ getPlane()

Ogre::MovablePlane* Hydrax::RttManager::getPlane ( RttType  Rtt)
inline

Get Rtt plane.

Definition at line 157 of file RttManager.h.

◆ getPlanesSceneNode()

Ogre::SceneNode* Hydrax::RttManager::getPlanesSceneNode ( )
inline

Definition at line 150 of file RttManager.h.

+ Here is the caller graph for this function:

◆ getReflectionDisplacementError()

const Ogre::Real& Hydrax::RttManager::getReflectionDisplacementError ( ) const
inline

Definition at line 221 of file RttManager.h.

◆ getRttName()

const Ogre::String& Hydrax::RttManager::getRttName ( RttType  Rtt) const
inline

Get RTT texture name.

Definition at line 138 of file RttManager.h.

◆ getRttOptions()

const RttOptions& Hydrax::RttManager::getRttOptions ( const RttType Rtt) const
inline

Definition at line 209 of file RttManager.h.

◆ getTexture()

Ogre::TexturePtr Hydrax::RttManager::getTexture ( RttType  Rtt)
inline

Get Rtt texture.

Definition at line 145 of file RttManager.h.

+ Here is the caller graph for this function:

◆ getTextureSize()

const Size& Hydrax::RttManager::getTextureSize ( const RttType Rtt) const
inline

Definition at line 162 of file RttManager.h.

+ Here is the caller graph for this function:

◆ initialize()

void Hydrax::RttManager::initialize ( const RttType Rtt)

Initialize a RTT.

Parameters
RttRtt to initialize
Remarks
If the RTT is already created, it will be recreated.

Definition at line 78 of file RttManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void Hydrax::RttManager::remove ( const RttType Rtt)

Removes a RTT.

Parameters
RttRtt to remove

Definition at line 128 of file RttManager.cpp.

+ Here is the caller graph for this function:

◆ removeAll()

void Hydrax::RttManager::removeAll ( )

Remove all RttManager resources.

Remarks
After calling removeAll(), calling initialize(...) is allowed.

Definition at line 153 of file RttManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAllRttListeners()

void Hydrax::RttManager::removeAllRttListeners ( const bool &  releaseMemory = true)

◆ removeRttListener()

void Hydrax::RttManager::removeRttListener ( RttListener l,
const bool &  releaseMemory = true 
)

◆ setBitsPerChannel()

void Hydrax::RttManager::setBitsPerChannel ( const RttType Rtt,
const BitsPerChannel BPC 
)
inline

Definition at line 194 of file RttManager.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDisableReflectionCustomNearCliplPlaneRenderQueues()

void Hydrax::RttManager::setDisableReflectionCustomNearCliplPlaneRenderQueues ( const std::vector< Ogre::RenderQueueGroupID > &  DisableReflectionCustomNearClipPlaneRenderQueues)
inline

Definition at line 226 of file RttManager.h.

◆ setNumberOfChannels()

void Hydrax::RttManager::setNumberOfChannels ( const RttType Rtt,
const NumberOfChannels NOC 
)
inline

Definition at line 179 of file RttManager.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReflectionDisplacementError()

void Hydrax::RttManager::setReflectionDisplacementError ( const Ogre::Real &  ReflectionDisplacementError)
inline

Range [0.05, ~2], increase if you experience reflection issues when the camera is near to the water.

Definition at line 216 of file RttManager.h.

◆ setTextureSize()

void Hydrax::RttManager::setTextureSize ( const RttType Rtt,
const Size S 
)

Set Rtt texture size.

Parameters
SNew texture size (0,0 -> get main viewport size)

Definition at line 223 of file RttManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTexturesSize()

void Hydrax::RttManager::setTexturesSize ( const Size S)

Set Rtt textures size.

Parameters
SNew texture size (0,0 -> get main viewport size)

Definition at line 245 of file RttManager.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ mDepthListener

CDepthListener Hydrax::RttManager::mDepthListener
private

Definition at line 378 of file RttManager.h.

◆ mDepthReflectionListener

CDepthReflectionListener Hydrax::RttManager::mDepthReflectionListener
private

Definition at line 379 of file RttManager.h.

◆ mDisableReflectionCustomNearClipPlaneRenderQueues

std::vector<Ogre::RenderQueueGroupID> Hydrax::RttManager::mDisableReflectionCustomNearClipPlaneRenderQueues
private

Render queues to exclude of the reflection custom near clip plane.

Definition at line 383 of file RttManager.h.

◆ mGPUNormalMapListener

CGPUNormalMapListener Hydrax::RttManager::mGPUNormalMapListener
private

Definition at line 380 of file RttManager.h.

◆ mHydrax

Hydrax* Hydrax::RttManager::mHydrax
private

Hydrax parent pointer.

Definition at line 363 of file RttManager.h.

◆ mPlanes

Ogre::MovablePlane* Hydrax::RttManager::mPlanes[6]
private

Rtt planes vector.

Definition at line 368 of file RttManager.h.

◆ mPlanesSceneNode

Ogre::SceneNode* Hydrax::RttManager::mPlanesSceneNode
private

SceneNode to attach our planes.

Definition at line 366 of file RttManager.h.

◆ mReflectionDisplacementError

Ogre::Real Hydrax::RttManager::mReflectionDisplacementError
private

Reflection displacement error, range [0.01, ~2].

Definition at line 388 of file RttManager.h.

◆ mReflectionListener

CReflectionListener Hydrax::RttManager::mReflectionListener
private

Rtt listener objects.

Definition at line 376 of file RttManager.h.

◆ mRefractionListener

CRefractionListener Hydrax::RttManager::mRefractionListener
private

Definition at line 377 of file RttManager.h.

◆ mRttListeners

std::vector<RttListener*> Hydrax::RttManager::mRttListeners
private

Rtt listeners.

Definition at line 385 of file RttManager.h.

◆ mRttOptions

RttOptions Hydrax::RttManager::mRttOptions[6]
private

Rtt options.

Definition at line 373 of file RttManager.h.

◆ mTextures

Ogre::TexturePtr Hydrax::RttManager::mTextures[6]
private

Rtt textures vector.

Definition at line 371 of file RttManager.h.


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