eXperiment robotics framework

glCamera Class Reference
[World Camera]

A camera to view the world. More...

#include <erf/erf_camera.hpp>>

Collaboration diagram for glCamera:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 glCamera ()
 camera constructor.
 ~glCamera ()
 camera destructor.
 glCamera (WindowGL *w)
 camera constructor.
int event (int e)
 the event receiver.
void reset ()
 reset every variable.
void resetClick (GLint xp, GLint yp)
 reset the previous click. used for start dragging or zooming.
void setZoom (GLdouble yp)
 increase or decrease the zoom.
void setPan (GLint xp, GLint yp)
 set the panning.
void setOrigin (GLdouble xt, GLdouble yt, GLdouble zt)
 sets the look from point. this is only used in perpective coordinates.
void setTarget (GLdouble xt, GLdouble yt, GLdouble zt)
 sets the lookat target.
void setViewtype (GLshort v)
 sets the current viewtype.
void switchViewtype ()
 switch viewtypes.
void display ()
 do the rendering. go through each plugin that is associated to the associated window.
GLuint pickObject (GLint x, GLint y, vector< Hit > &hitVect, GLint selection_width=5, GLint selection_height=5)
 do for picking of objects in the world.

Public Attributes

GLdouble origin [3]
 lookat origin and target.
GLdouble target [3]
WindowGLwindowGL
 the associated windowGL.
GLdouble tx
 variables that represent screen drag. Used to calculate panning in perspective.
GLdouble ty
GLdouble zoom_perspective
 zoom of viewtype.
GLdouble zoom_plant
GLshort viewtype
 the type of view Plant or Perspective.
GLdouble curr_click [2]
 previous and current clicks on the window.
GLdouble prev_click [2]

Friends

std::ostream & operator<< (std::ostream &os, const glCamera &c)
 output the camera information to std.


Detailed Description

A camera to view the world.

Todo:
opencv local camera, that also plays images and movies.

Definition at line 54 of file erf_camera.hpp.


Constructor & Destructor Documentation

glCamera::glCamera (  ) 

camera constructor.

glCamera::~glCamera (  ) 

camera destructor.

glCamera::glCamera ( WindowGL w  ) 

camera constructor.

Parameters:
w a pointer to a WindowGL window.


Member Function Documentation

int glCamera::event ( int  e  ) 

the event receiver.

Returns:
true if the event was handled, false otherwise.

void glCamera::reset (  ) 

reset every variable.

void glCamera::resetClick ( GLint  xp,
GLint  yp 
)

reset the previous click. used for start dragging or zooming.

void glCamera::setZoom ( GLdouble  yp  ) 

increase or decrease the zoom.

void glCamera::setPan ( GLint  xp,
GLint  yp 
)

set the panning.

in perspective mode this revolves around the center point. in plant mode this switches the center point. the input parameters are an offset in pixels (in the camera is perpective) and in world coordinates(m) if the camera is in plant mode.

void glCamera::setOrigin ( GLdouble  xt,
GLdouble  yt,
GLdouble  zt 
)

sets the look from point. this is only used in perpective coordinates.

void glCamera::setTarget ( GLdouble  xt,
GLdouble  yt,
GLdouble  zt 
)

sets the lookat target.

void glCamera::setViewtype ( GLshort  v  ) 

sets the current viewtype.

void glCamera::switchViewtype (  ) 

switch viewtypes.

void glCamera::display (  ) 

do the rendering. go through each plugin that is associated to the associated window.

GLuint glCamera::pickObject ( GLint  x,
GLint  y,
vector< Hit > &  hitVect,
GLint  selection_width = 5,
GLint  selection_height = 5 
)

do for picking of objects in the world.

Returns:
the glname (an unsigned integer) of the closest object. also fills hitVect with hits (the glnames and world coordinates of the clicked objects). use the selection_width and selection_height to do selection rectangles.
Parameters:
x clicked point in window, x coordinate.
y clicked point in window, y coordinate.
hitVect vector of Hit that is filled.
selection_width number of pixels of tolerance around x pixel; defaults to 5.
selection_height number of pixels of tolerance around y pixel; defaults to 5.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const glCamera c 
) [friend]

output the camera information to std.


Member Data Documentation

GLdouble glCamera::origin[3]

lookat origin and target.

Definition at line 61 of file erf_camera.hpp.

GLdouble glCamera::target[3]

Definition at line 61 of file erf_camera.hpp.

the associated windowGL.

Definition at line 63 of file erf_camera.hpp.

GLdouble glCamera::tx

variables that represent screen drag. Used to calculate panning in perspective.

Definition at line 65 of file erf_camera.hpp.

GLdouble glCamera::ty

Definition at line 65 of file erf_camera.hpp.

zoom of viewtype.

Definition at line 67 of file erf_camera.hpp.

Definition at line 67 of file erf_camera.hpp.

the type of view Plant or Perspective.

Definition at line 69 of file erf_camera.hpp.

GLdouble glCamera::curr_click[2]

previous and current clicks on the window.

Definition at line 71 of file erf_camera.hpp.

GLdouble glCamera::prev_click[2]

Definition at line 71 of file erf_camera.hpp.


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

The miarn project - written by Joao Xavier