RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Data Structures | Public Member Functions | Private Member Functions | Private Attributes
RoR::Water Class Reference

#include <Water.h>

+ Inheritance diagram for RoR::Water:
+ Collaboration diagram for RoR::Water:

Data Structures

struct  ReflectionListener
 
struct  RefractionListener
 
struct  WaveTrain
 

Public Member Functions

 Water (Ogre::Vector3 terrn_size)
 
 ~Water ()
 
float GetStaticWaterHeight () override
 Returns static water level configured in 'terrn2'. More...
 
void SetStaticWaterHeight (float value) override
 
void SetWaterBottomHeight (float value) override
 
void SetWavesHeight (float value) override
 
float CalcWavesHeight (Ogre::Vector3 pos) override
 
Ogre::Vector3 CalcWavesVelocity (Ogre::Vector3 pos) override
 
void SetWaterVisible (bool value) override
 
bool IsUnderWater (Ogre::Vector3 pos) override
 
void SetReflectionPlaneHeight (float centerheight) override
 
void UpdateReflectionPlane (float h) override
 
void WaterPrepareShutdown () override
 
void UpdateWater () override
 
void FrameStepWater (float dt) override
 
void SetForcedCameraTransform (Ogre::Radian fovy, Ogre::Vector3 pos, Ogre::Quaternion rot) override
 
void ClearForcedCameraTransform () override
 
- Public Member Functions inherited from RoR::IWater
 IWater ()
 
virtual ~IWater ()
 
virtual void WaterSetSunPosition (Ogre::Vector3)
 

Private Member Functions

float GetWaveHeight (Ogre::Vector3 pos)
 
void ShowWave (Ogre::Vector3 refpos)
 
bool IsCameraUnderWater ()
 
void PrepareWater ()
 

Private Attributes

bool m_water_visible = true
 
float m_water_height = 0.f
 
float m_waves_height = 0.f
 
float m_bottom_height = 0.f
 
float m_max_ampl = 0.f
 
float m_waterplane_mesh_scale = 1.f
 
int m_frame_counter = 0
 
float m_sim_time_counter = 0.f
 Elapsed simulation time in seconds. More...
 
Ogre::Vector3 m_map_size = Ogre::Vector3::ZERO
 
Ogre::Plane m_water_plane
 
Ogre::MeshPtr m_waterplane_mesh
 
Ogre::Entity * m_waterplane_entity = nullptr
 
Ogre::SceneNode * m_waterplane_node = nullptr
 
Ogre::HardwareVertexBufferSharedPtr m_waterplane_vert_buf
 
float * m_waterplane_vert_buf_local = nullptr
 
bool m_waterplane_force_update_pos = false
 
Ogre::Plane m_reflect_plane
 
Ogre::Plane m_refract_plane
 
ReflectionListener m_reflect_listener
 
RefractionListener m_refract_listener
 
Ogre::Camera * m_reflect_cam = nullptr
 
Ogre::Camera * m_refract_cam = nullptr
 
Ogre::RenderTexture * m_refract_rtt_target = nullptr
 
Ogre::RenderTexture * m_reflect_rtt_target = nullptr
 
Ogre::TexturePtr m_refract_rtt_texture
 
Ogre::TexturePtr m_reflect_rtt_texture
 
Ogre::Viewport * m_refract_rtt_viewport = nullptr
 
Ogre::Viewport * m_reflect_rtt_viewport = nullptr
 
Ogre::SceneNode * m_bottomplane_node = nullptr
 
Ogre::Plane m_bottom_plane
 
std::vector< WaveTrainm_wavetrain_defs
 
bool m_cam_forced = false
 
Ogre::Radian m_cam_forced_fovy = Ogre::Radian(0.f)
 
Ogre::Vector3 m_cam_forced_position = Ogre::Vector3::ZERO
 
Ogre::Quaternion m_cam_forced_orientation = Ogre::Quaternion::IDENTITY
 

Detailed Description

Definition at line 40 of file Water.h.

Constructor & Destructor Documentation

◆ Water()

Water::Water ( Ogre::Vector3  terrn_size)

Definition at line 38 of file Water.cpp.

+ Here is the call graph for this function:

◆ ~Water()

Water::~Water ( )

Definition at line 84 of file Water.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ CalcWavesHeight()

float Water::CalcWavesHeight ( Ogre::Vector3  pos)
overridevirtual

Implements RoR::IWater.

Definition at line 505 of file Water.cpp.

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

◆ CalcWavesVelocity()

Vector3 Water::CalcWavesVelocity ( Ogre::Vector3  pos)
overridevirtual

Implements RoR::IWater.

Definition at line 552 of file Water.cpp.

+ Here is the call graph for this function:

◆ ClearForcedCameraTransform()

void Water::ClearForcedCameraTransform ( )
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 625 of file Water.cpp.

◆ FrameStepWater()

void Water::FrameStepWater ( float  dt)
overridevirtual

Implements RoR::IWater.

Definition at line 609 of file Water.cpp.

+ Here is the call graph for this function:

◆ GetStaticWaterHeight()

float Water::GetStaticWaterHeight ( )
overridevirtual

Returns static water level configured in 'terrn2'.

Implements RoR::IWater.

Definition at line 484 of file Water.cpp.

◆ GetWaveHeight()

float Water::GetWaveHeight ( Ogre::Vector3  pos)
private

Definition at line 633 of file Water.cpp.

+ Here is the caller graph for this function:

◆ IsCameraUnderWater()

bool Water::IsCameraUnderWater ( )
private

Definition at line 392 of file Water.cpp.

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

◆ IsUnderWater()

bool Water::IsUnderWater ( Ogre::Vector3  pos)
overridevirtual

Implements RoR::IWater.

Definition at line 535 of file Water.cpp.

+ Here is the call graph for this function:

◆ PrepareWater()

void Water::PrepareWater ( )
private

Definition at line 162 of file Water.cpp.

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

◆ SetForcedCameraTransform()

void Water::SetForcedCameraTransform ( Ogre::Radian  fovy,
Ogre::Vector3  pos,
Ogre::Quaternion  rot 
)
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 617 of file Water.cpp.

◆ SetReflectionPlaneHeight()

void Water::SetReflectionPlaneHeight ( float  centerheight)
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 345 of file Water.cpp.

+ Here is the call graph for this function:

◆ SetStaticWaterHeight()

void Water::SetStaticWaterHeight ( float  value)
overridevirtual

Implements RoR::IWater.

Definition at line 489 of file Water.cpp.

◆ SetWaterBottomHeight()

void Water::SetWaterBottomHeight ( float  value)
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 500 of file Water.cpp.

◆ SetWaterVisible()

void Water::SetWaterVisible ( bool  value)
overridevirtual

Implements RoR::IWater.

Definition at line 334 of file Water.cpp.

◆ SetWavesHeight()

void Water::SetWavesHeight ( float  value)
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 495 of file Water.cpp.

◆ ShowWave()

void Water::ShowWave ( Ogre::Vector3  refpos)
private

Definition at line 354 of file Water.cpp.

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

◆ UpdateReflectionPlane()

void Water::UpdateReflectionPlane ( float  h)
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 578 of file Water.cpp.

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

◆ UpdateWater()

void Water::UpdateWater ( )
overridevirtual

Implements RoR::IWater.

Definition at line 397 of file Water.cpp.

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

◆ WaterPrepareShutdown()

void Water::WaterPrepareShutdown ( )
overridevirtual

Reimplemented from RoR::IWater.

Definition at line 476 of file Water.cpp.

Field Documentation

◆ m_bottom_height

float RoR::Water::m_bottom_height = 0.f
private

Definition at line 107 of file Water.h.

◆ m_bottom_plane

Ogre::Plane RoR::Water::m_bottom_plane
private

Definition at line 133 of file Water.h.

◆ m_bottomplane_node

Ogre::SceneNode* RoR::Water::m_bottomplane_node = nullptr
private

Definition at line 132 of file Water.h.

◆ m_cam_forced

bool RoR::Water::m_cam_forced = false
private

Definition at line 137 of file Water.h.

◆ m_cam_forced_fovy

Ogre::Radian RoR::Water::m_cam_forced_fovy = Ogre::Radian(0.f)
private

Definition at line 138 of file Water.h.

◆ m_cam_forced_orientation

Ogre::Quaternion RoR::Water::m_cam_forced_orientation = Ogre::Quaternion::IDENTITY
private

Definition at line 140 of file Water.h.

◆ m_cam_forced_position

Ogre::Vector3 RoR::Water::m_cam_forced_position = Ogre::Vector3::ZERO
private

Definition at line 139 of file Water.h.

◆ m_frame_counter

int RoR::Water::m_frame_counter = 0
private

Definition at line 110 of file Water.h.

◆ m_map_size

Ogre::Vector3 RoR::Water::m_map_size = Ogre::Vector3::ZERO
private

Definition at line 112 of file Water.h.

◆ m_max_ampl

float RoR::Water::m_max_ampl = 0.f
private

Definition at line 108 of file Water.h.

◆ m_reflect_cam

Ogre::Camera* RoR::Water::m_reflect_cam = nullptr
private

Definition at line 124 of file Water.h.

◆ m_reflect_listener

ReflectionListener RoR::Water::m_reflect_listener
private

Definition at line 122 of file Water.h.

◆ m_reflect_plane

Ogre::Plane RoR::Water::m_reflect_plane
private

Definition at line 120 of file Water.h.

◆ m_reflect_rtt_target

Ogre::RenderTexture* RoR::Water::m_reflect_rtt_target = nullptr
private

Definition at line 127 of file Water.h.

◆ m_reflect_rtt_texture

Ogre::TexturePtr RoR::Water::m_reflect_rtt_texture
private

Definition at line 129 of file Water.h.

◆ m_reflect_rtt_viewport

Ogre::Viewport* RoR::Water::m_reflect_rtt_viewport = nullptr
private

Definition at line 131 of file Water.h.

◆ m_refract_cam

Ogre::Camera* RoR::Water::m_refract_cam = nullptr
private

Definition at line 125 of file Water.h.

◆ m_refract_listener

RefractionListener RoR::Water::m_refract_listener
private

Definition at line 123 of file Water.h.

◆ m_refract_plane

Ogre::Plane RoR::Water::m_refract_plane
private

Definition at line 121 of file Water.h.

◆ m_refract_rtt_target

Ogre::RenderTexture* RoR::Water::m_refract_rtt_target = nullptr
private

Definition at line 126 of file Water.h.

◆ m_refract_rtt_texture

Ogre::TexturePtr RoR::Water::m_refract_rtt_texture
private

Definition at line 128 of file Water.h.

◆ m_refract_rtt_viewport

Ogre::Viewport* RoR::Water::m_refract_rtt_viewport = nullptr
private

Definition at line 130 of file Water.h.

◆ m_sim_time_counter

float RoR::Water::m_sim_time_counter = 0.f
private

Elapsed simulation time in seconds.

Definition at line 111 of file Water.h.

◆ m_water_height

float RoR::Water::m_water_height = 0.f
private

Definition at line 105 of file Water.h.

◆ m_water_plane

Ogre::Plane RoR::Water::m_water_plane
private

Definition at line 113 of file Water.h.

◆ m_water_visible

bool RoR::Water::m_water_visible = true
private

Definition at line 104 of file Water.h.

◆ m_waterplane_entity

Ogre::Entity* RoR::Water::m_waterplane_entity = nullptr
private

Definition at line 115 of file Water.h.

◆ m_waterplane_force_update_pos

bool RoR::Water::m_waterplane_force_update_pos = false
private

Definition at line 119 of file Water.h.

◆ m_waterplane_mesh

Ogre::MeshPtr RoR::Water::m_waterplane_mesh
private

Definition at line 114 of file Water.h.

◆ m_waterplane_mesh_scale

float RoR::Water::m_waterplane_mesh_scale = 1.f
private

Definition at line 109 of file Water.h.

◆ m_waterplane_node

Ogre::SceneNode* RoR::Water::m_waterplane_node = nullptr
private

Definition at line 116 of file Water.h.

◆ m_waterplane_vert_buf

Ogre::HardwareVertexBufferSharedPtr RoR::Water::m_waterplane_vert_buf
private

Definition at line 117 of file Water.h.

◆ m_waterplane_vert_buf_local

float* RoR::Water::m_waterplane_vert_buf_local = nullptr
private

Definition at line 118 of file Water.h.

◆ m_waves_height

float RoR::Water::m_waves_height = 0.f
private

Definition at line 106 of file Water.h.

◆ m_wavetrain_defs

std::vector<WaveTrain> RoR::Water::m_wavetrain_defs
private

Definition at line 134 of file Water.h.


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