Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::Effects::Picking Class Reference

Picks a 3D position from screen position. More...

#include <picking.hpp>

Inheritance diagram for Tucano::Effects::Picking:
Tucano::Effect

Public Member Functions

 Picking (void)
 Default constructor. More...
 
virtual void initialize (void)
 Load and initialize shaders. More...
 
virtual void render (Tucano::Mesh &mesh, const Tucano::Camera &camera)
 Render the mesh given a camera trackball. More...
 
Tucano::FramebuffergetFbo (void)
 Returns a pointer to the framebuffer object containg rendered world coords. More...
 
Eigen::Vector4f pick (const Eigen::Vector2i &pos)
 Returns the world coordinates of point projected on given pixel. More...
 
- Public Member Functions inherited from Tucano::Effect
 Effect (string shadersDir="shaders/")
 Default constructor. More...
 
virtual ShaderloadShader (string shader_name)
 Loads a shader by filename, initializes it, and inserts in shaders list. More...
 
virtual void loadShader (Shader &shader, string shader_name)
 
virtual ShaderloadShader (string shader_name, string vertex_name, string frag_name, string geom_name)
 Loads a shader by complete filenames (with extensions), initializes it, and inserts in shaders list. More...
 
void setShadersDir (string dir)
 
virtual void reloadShaders (void)
 Reloads all shaders needed for effect usage. More...
 

Private Attributes

Tucano::Shader worldcoords_shader
 shader to write world coords to projected pixel positions More...
 
Tucano::Framebuffer fbo
 Buffer to store projected coords. More...
 

Additional Inherited Members

- Protected Attributes inherited from Tucano::Effect
std::vector< Shader * > shaders_list
 Vector of pointers to shaders used in this effect, in case the user needs multiple pass rendering. More...
 
string shaders_dir
 Directory in which the shader files are stored. More...
 

Detailed Description

Picks a 3D position from screen position.

Constructor & Destructor Documentation

Tucano::Effects::Picking::Picking ( void  )
inline

Default constructor.

Member Function Documentation

Tucano::Framebuffer* Tucano::Effects::Picking::getFbo ( void  )
inline

Returns a pointer to the framebuffer object containg rendered world coords.

Returns
Pointer to FBO
virtual void Tucano::Effects::Picking::initialize ( void  )
inlinevirtual

Load and initialize shaders.

Implements Tucano::Effect.

Eigen::Vector4f Tucano::Effects::Picking::pick ( const Eigen::Vector2i &  pos)
inline

Returns the world coordinates of point projected on given pixel.

Parameters
posScreen position
Returns
world coordinates of projected point in given position
virtual void Tucano::Effects::Picking::render ( Tucano::Mesh mesh,
const Tucano::Camera camera 
)
inlinevirtual

Render the mesh given a camera trackball.

Parameters
meshGiven mesh
cameraGiven camera trackball

Member Data Documentation

Tucano::Framebuffer Tucano::Effects::Picking::fbo
private

Buffer to store projected coords.

Tucano::Shader Tucano::Effects::Picking::worldcoords_shader
private

shader to write world coords to projected pixel positions


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