Robotran C Documentation
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
OglWorldRenderer Class Reference

Implementation of MbsWorldRenderer class that render a MbsWorld3D using Open GL. More...

#include <OglWorldRenderer.hh>

Inheritance diagram for OglWorldRenderer:
MbsWorldRenderer

Public Member Functions

 OglWorldRenderer (MbsWorld3D *world_3d, int shader_flag)
 Constructor. More...
 
virtual void Init ()
 Execute the necessary code to initialize the renderer Here: initialize Open GL context. More...
 
virtual void Update (std::vector< MbsShape3D * > model_list)
 Execute the necessary code to render this world: Update the append filter and output the vtu file for current time step. More...
 
virtual MbsShapeRenderergetNewShapeRenderer ()
 Create and return a new renderer for shape (similar to a factory production method) More...
 
virtual void AddViewPointRenderer (MbsViewPointRenderer *rdr)
 
virtual void AddDepthTexture (int new_depth_x_width, int new_depth_y_width)
 add a depth texture More...
 
virtual void SetBackgroundColor (glm::vec3 const &col)
 Set the backgroun of the Open GL view to the specified color. More...
 
int GetNbDepthTextures () const
 get the number of depth textures More...
 
GLuint GetDepthTexture (int i) const
 get a depth texture More...
 
GLuint GetFrameBuffer (int i) const
 get a frame buffer More...
 
int GetDepthXWidth (int i) const
 get the depth texture width along the X axis (in pixels) More...
 
int GetDepthYWidth (int i) const
 get the depth texture width along the Y axis (in pixels) More...
 

Public Attributes

std::vector< MbsViewPointRenderer * > vp_renderer_vec
 Viewpoint renderer vector: contain all the view point renderers. More...
 

Protected Attributes

std::string vertex_file
 
std::string fragment_file
 
MbsWorld3D * world_3d
 3D world More...
 
glm::vec3 background_color
 
bool is_init
 
int shader_flag
 flag for shaders More...
 

Private Member Functions

void SetShader ()
 

Private Attributes

std::string main_vert_sh
 main vertex shader path More...
 
std::string main_frag_sh
 main fragment shader path More...
 
std::vector< GLuint > frameBuffer
 frame buffer More...
 
std::vector< GLuint > depthTexture
 depth textures More...
 
std::vector< int > depth_x_width
 X width of the shadow map depth textures (in pixels) More...
 
std::vector< int > depth_y_width
 X width of the shadow map depth textures (in pixels) More...
 

Detailed Description

Implementation of MbsWorldRenderer class that render a MbsWorld3D using Open GL.

Constructor & Destructor Documentation

◆ OglWorldRenderer()

OglWorldRenderer ( MbsWorld3D *  world_3d,
int  shader_flag 
)

Constructor.

Construct a new OglWorldRender.

Parameters
[in]world_3dthe MbsWorld3D that must be rendered by this new object
[in]shader_flagthe shader option (for lights, shades, ...)

Member Function Documentation

◆ AddDepthTexture()

void AddDepthTexture ( int  new_depth_x_width,
int  new_depth_y_width 
)
virtual

add a depth texture

Parameters
[in]new_depth_x_widthX width of the shadow map depth textures (in pixels)
[in]new_depth_y_widthY width of the shadow map depth textures (in pixels)

Implements MbsWorldRenderer.

◆ AddViewPointRenderer()

void AddViewPointRenderer ( MbsViewPointRenderer rdr)
virtual

Implements MbsWorldRenderer.

◆ GetDepthTexture()

GLuint GetDepthTexture ( int  i) const
inline

get a depth texture

◆ GetDepthXWidth()

int GetDepthXWidth ( int  i) const
inline

get the depth texture width along the X axis (in pixels)

◆ GetDepthYWidth()

int GetDepthYWidth ( int  i) const
inline

get the depth texture width along the Y axis (in pixels)

◆ GetFrameBuffer()

GLuint GetFrameBuffer ( int  i) const
inline

get a frame buffer

◆ GetNbDepthTextures()

int GetNbDepthTextures ( ) const
inline

get the number of depth textures

◆ getNewShapeRenderer()

MbsShapeRenderer * getNewShapeRenderer ( )
virtual

Create and return a new renderer for shape (similar to a factory production method)

Create and return a new OglShapeRenderer.

Implements MbsWorldRenderer.

◆ Init()

void Init ( )
virtual

Execute the necessary code to initialize the renderer Here: initialize Open GL context.

Initialize the renderer.

Performs the initilization steps of Open GL

Implements MbsWorldRenderer.

◆ SetBackgroundColor()

void SetBackgroundColor ( glm::vec3 const &  col)
virtual

Set the backgroun of the Open GL view to the specified color.

Parameters
[in]colthe new color for the background

Implements MbsWorldRenderer.

◆ SetShader()

void SetShader ( )
private

◆ Update()

void Update ( std::vector< MbsShape3D * >  model_list)
virtual

Execute the necessary code to render this world: Update the append filter and output the vtu file for current time step.

Update the 3D view.

Call the renderer of the MbsShape3D in the MbsWorld3D associated to this renderer.

Implements MbsWorldRenderer.

Member Data Documentation

◆ background_color

glm::vec3 background_color
protected

◆ depth_x_width

std::vector<int> depth_x_width
private

X width of the shadow map depth textures (in pixels)

◆ depth_y_width

std::vector<int> depth_y_width
private

X width of the shadow map depth textures (in pixels)

◆ depthTexture

std::vector<GLuint> depthTexture
private

depth textures

◆ fragment_file

std::string fragment_file
protected

◆ frameBuffer

std::vector<GLuint> frameBuffer
private

frame buffer

◆ is_init

bool is_init
protected

◆ main_frag_sh

std::string main_frag_sh
private

main fragment shader path

◆ main_vert_sh

std::string main_vert_sh
private

main vertex shader path

◆ shader_flag

int shader_flag
protected

flag for shaders

◆ vertex_file

std::string vertex_file
protected

◆ vp_renderer_vec

std::vector<MbsViewPointRenderer*> vp_renderer_vec

Viewpoint renderer vector: contain all the view point renderers.

◆ world_3d

MbsWorld3D* world_3d
protected

3D world


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