#include <PrecipitationController.h>
Public Types | |
typedef std::map < Ogre::Viewport *, PrecipitationInstance * > | ViewportInstanceMap |
Public Member Functions | |
void | setParams (const PrecipitationPresetParams ¶ms) |
Set all parameters at once. | |
void | setPresetType (PrecipitationType value) |
Quickly set a certain preset type of precipitation. | |
PrecipitationType | getPresetType () const |
Get the preset type. | |
void | setTextureName (const Ogre::String &textureName) |
const Ogre::String | getTextureName () const |
void | setColour (const Ogre::ColourValue &color) |
Precipitation color. Part of a preset. | |
const Ogre::ColourValue | getColour () const |
void | setSpeed (Real value) |
Precipitation speed (affects direction). Part of a preset. | |
Real | getSpeed () const |
void | setIntensity (Real value) |
Precipitation intensity. | |
Real | getIntensity () const |
void | setWindSpeed (const Ogre::Vector3 &value) |
Wind speed and direction. | |
const Ogre::Vector3 | getWindSpeed () const |
void | setFallingDirection (const Ogre::Vector3 &value) |
The basic direction for falling precipitation. | |
const Ogre::Vector3 | getFallingDirection () const |
void | setManualCameraSpeed (const Ogre::Vector3 &value) |
Set manual camera speed for all viewports. | |
void | setAutoCameraSpeed () |
Set auto camera speed everywhere.o. | |
void | setAutoDisableThreshold (Real value) |
Automatically disable compositors when intensity is low. | |
Real | getAutoDisableThreshold () const |
void | setCameraSpeedScale (const Ogre::Vector3 &value) |
Automatically scale camera speed. | |
const Ogre::Vector3 | getCameraSpeedScale () const |
void | setCameraSpeedScale (Ogre::Real value) |
Set an equal camera speed scale in all dimensions. | |
void | update (Real secondsSinceLastFrame, Ogre::ColourValue colour) |
Update the the precipitation controller. | |
PrecipitationController (Ogre::SceneManager *sceneMgr) | |
PrecipitationInstance * | createViewportInstance (Ogre::Viewport *viewport) |
Add precipitation to a certain viewport. | |
void | destroyViewportInstance (Ogre::Viewport *viewport) |
Remove precipitation from a certain viewport. | |
PrecipitationInstance * | getViewportInstance (Ogre::Viewport *viewport) |
Get per-viewport instance, or null if not created yet. | |
void | destroyAllViewportInstances () |
Remove from all attached viewports; clean up. | |
Static Public Member Functions | |
static bool | isPresetType (PrecipitationType value) |
Check if a preset type is valid. | |
static const PrecipitationPresetParams & | getPresetParams (PrecipitationType value) |
Get preset parameters for a certain type of precipitation. | |
Public Attributes | |
ViewportInstanceMap | mViewportInstanceMap |
Static Public Attributes | |
static const String | COMPOSITOR_NAME = "Caelum/PrecipitationCompositor" |
Name of the compositor resource. | |
static const String | MATERIAL_NAME = "Caelum/PrecipitationMaterial" |
Name of the compositor material. | |
Friends | |
class | PrecipitationInstance |
This class will add and control precipitation controllers to viewports.
Compositors clone the composing materials. This controller will register itself as a compositor listener and change the material in notifyMaterialSetup.
Definition at line 61 of file PrecipitationController.h.
PrecipitationType Caelum::PrecipitationController::getPresetType | ( | ) | const |
Get the preset type.
Will return PRECIPITATION_CUSTOM if you modify parameters manually after setPresetType.
Definition at line 115 of file PrecipitationController.cpp.
void Caelum::PrecipitationController::setFallingDirection | ( | const Ogre::Vector3 & | value | ) | [inline] |
The basic direction for falling precipitation.
This property define the notion of a "falling down" direction. By default this is Vector3::NEGATIVE_UNIT_Y. You need to change this for a Z-up system.
Definition at line 137 of file PrecipitationController.h.
void Caelum::PrecipitationController::setAutoDisableThreshold | ( | Real | value | ) | [inline] |
Automatically disable compositors when intensity is low.
A negative value always enable the compositor.
Definition at line 151 of file PrecipitationController.h.
void Caelum::PrecipitationController::setCameraSpeedScale | ( | const Ogre::Vector3 & | value | ) | [inline] |
Automatically scale camera speed.
This is multiplied per-component with camera speed; manual or automatic. It's most useful for automatic camera speed to control how much of an effect moving the camera has on rain drop directions.
The components should probably be equal.
Default in Ogre::Vector3::UNIT_SCALE
Definition at line 164 of file PrecipitationController.h.
void Caelum::PrecipitationController::update | ( | Real | secondsSinceLastFrame, | |
Ogre::ColourValue | colour | |||
) |
Update the the precipitation controller.
secondsSinceLastFrame | Number of secods since the last frame. |
Definition at line 135 of file PrecipitationController.cpp.
Referenced by Caelum::CaelumSystem::updateSubcomponents().