Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vl::GhostCameraManipulator Class Reference

The GhostCameraManipulator class is an UIEventListener that controls the position and orientation of a Camera. More...

#include <GhostCameraManipulator.hpp>

Inheritance diagram for vl::GhostCameraManipulator:
vl::UIEventListener vl::Object

List of all members.

Public Member Functions

 GhostCameraManipulator ()
 Constructor.
virtual void mouseMoveEvent (int x, int y)
 Event generated when the mouse moves.
void enableEvent (bool enabled)
 Event generated whenever setEnabled() is called.
virtual void updateEvent ()
 Event generated when the bound OpenGLContext does not have any other message to process and OpenGLContext::continuousUpdate() is set to true or somebody calls OpenGLContext::update().
virtual void initEvent ()
 Event generated when the bound OpenGLContext bocomes initialized or when the event listener is bound to an initialized OpenGLContext.
virtual void destroyEvent ()
 Event generated right before the bound OpenGLContext is destroyed.
virtual void addedListenerEvent (OpenGLContext *)
 Event generated whenever a listener is bound to an OpenGLContext context.
virtual void removedListenerEvent (OpenGLContext *)
 Event generated whenever a listener is unbound from an OpenGLContext context.
virtual void mouseUpEvent (EMouseButton, int, int)
 Event generated when one of the mouse buttons is released.
virtual void mouseDownEvent (EMouseButton, int, int)
 Event generated when one of the mouse buttons is pressed.
virtual void mouseWheelEvent (int)
 Event generated when the mouse wheel rotated.
virtual void keyPressEvent (unsigned short, EKey)
 Event generated when a key is pressed.
virtual void keyReleaseEvent (unsigned short, EKey)
 Event generated when a key is released.
virtual void resizeEvent (int, int)
 Event generated when the bound OpenGLContext is resized.
virtual void fileDroppedEvent (const std::vector< String > &)
 Event generated when one or more files are dropped on the bound OpenGLContext's area.
virtual void visibilityEvent (bool)
 Event generated when the bound OpenGLContext is shown or hidden.
void setCamera (Camera *camera)
 The camera to be manipulated.
Cameracamera ()
 The camera to be manipulated.
const Cameracamera () const
 The camera to be manipulated.
void setKeysForward (EKey key, EKey modifier=Key_None)
 Key bindings to move forward (default = Key_W).
void setKeysBackward (EKey key, EKey modifier=Key_None)
 Key bindings to move backward (default = Key_S).
void setKeysLeft (EKey key, EKey modifier=Key_None)
 Key bindings to move left (default = Key_A).
void setKeysRight (EKey key, EKey modifier=Key_None)
 Key bindings to move right (default = Key_D).
void setKeysUp (EKey key, EKey modifier=Key_None)
 Key bindings to move up (default = Key_W + Key_Shift).
void setKeysDown (EKey key, EKey modifier=Key_None)
 Key bindings to move down (default = Key_S + Key_Shift).
void setRotationSpeed (real speed)
 The camera rotation speed (default = 0.5).
real rotationSpeed () const
 The camera rotation speed (default = 0.5).
void setMovementSpeed (real speed)
 The camera translation speed (default = 50).
real movementSpeed () const
 The camera translation speed (default = 50).

Protected Member Functions

void setPosition (vec3 position)
const vec3position () const
void setXDegrees (real degree)
real xDegrees ()
void setYDegrees (real degree)
real yDegrees ()

Protected Attributes

ref< CameramCamera
vec3 mPosition
real mLastTime
real mRotationSpeed
real mMovementSpeed
real mXDegrees
real mYDegrees
EKey mKeysForward [2]
EKey mKeysBackward [2]
EKey mKeysUp [2]
EKey mKeysDown [2]
EKey mKeysLeft [2]
EKey mKeysRight [2]

Detailed Description

The GhostCameraManipulator class is an UIEventListener that controls the position and orientation of a Camera.

Using the GhostCameraManipulator class the user can freely fly around in the scene as if it was a ghost. Default key bindings:

Definition at line 55 of file GhostCameraManipulator.hpp.


Constructor & Destructor Documentation

GhostCameraManipulator::GhostCameraManipulator (  )

Member Function Documentation

void GhostCameraManipulator::mouseMoveEvent ( int  x,
int  y 
) [virtual]
void GhostCameraManipulator::enableEvent ( bool  enabled ) [virtual]
void GhostCameraManipulator::updateEvent (  ) [virtual]
virtual void vl::GhostCameraManipulator::initEvent (  ) [inline, virtual]

Event generated when the bound OpenGLContext bocomes initialized or when the event listener is bound to an initialized OpenGLContext.

Implements vl::UIEventListener.

Definition at line 71 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::destroyEvent (  ) [inline, virtual]

Event generated right before the bound OpenGLContext is destroyed.

Implements vl::UIEventListener.

Definition at line 73 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::addedListenerEvent ( OpenGLContext  ) [inline, virtual]

Event generated whenever a listener is bound to an OpenGLContext context.

Implements vl::UIEventListener.

Definition at line 75 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::removedListenerEvent ( OpenGLContext  ) [inline, virtual]

Event generated whenever a listener is unbound from an OpenGLContext context.

Implements vl::UIEventListener.

Definition at line 77 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::mouseUpEvent ( EMouseButton  button,
int  x,
int  y 
) [inline, virtual]

Event generated when one of the mouse buttons is released.

Implements vl::UIEventListener.

Definition at line 79 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::mouseDownEvent ( EMouseButton  button,
int  x,
int  y 
) [inline, virtual]

Event generated when one of the mouse buttons is pressed.

Implements vl::UIEventListener.

Definition at line 81 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::mouseWheelEvent ( int  n ) [inline, virtual]

Event generated when the mouse wheel rotated.

Implements vl::UIEventListener.

Definition at line 83 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::keyPressEvent ( unsigned  unicode_ch,
EKey  key 
) [inline, virtual]

Event generated when a key is pressed.

Implements vl::UIEventListener.

Definition at line 85 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::keyReleaseEvent ( unsigned  unicode_ch,
EKey  key 
) [inline, virtual]

Event generated when a key is released.

Implements vl::UIEventListener.

Definition at line 87 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::resizeEvent ( int  x,
int  y 
) [inline, virtual]

Event generated when the bound OpenGLContext is resized.

Implements vl::UIEventListener.

Definition at line 89 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::fileDroppedEvent ( const std::vector< String > &  files ) [inline, virtual]

Event generated when one or more files are dropped on the bound OpenGLContext's area.

Implements vl::UIEventListener.

Definition at line 91 of file GhostCameraManipulator.hpp.

virtual void vl::GhostCameraManipulator::visibilityEvent ( bool  visible ) [inline, virtual]

Event generated when the bound OpenGLContext is shown or hidden.

Implements vl::UIEventListener.

Definition at line 93 of file GhostCameraManipulator.hpp.

void GhostCameraManipulator::setCamera ( Camera camera )

The camera to be manipulated.

Definition at line 127 of file GhostCameraManipulator.cpp.

References camera(), and mCamera.

Camera * GhostCameraManipulator::camera (  )

The camera to be manipulated.

Definition at line 129 of file GhostCameraManipulator.cpp.

References vl::ref< T >::get(), and mCamera.

Referenced by enableEvent(), mouseMoveEvent(), setCamera(), and updateEvent().

const Camera * GhostCameraManipulator::camera (  ) const

The camera to be manipulated.

Definition at line 130 of file GhostCameraManipulator.cpp.

References vl::ref< T >::get(), and mCamera.

void vl::GhostCameraManipulator::setKeysForward ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move forward (default = Key_W).

Definition at line 107 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setKeysBackward ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move backward (default = Key_S).

Definition at line 110 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setKeysLeft ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move left (default = Key_A).

Definition at line 113 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setKeysRight ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move right (default = Key_D).

Definition at line 116 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setKeysUp ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move up (default = Key_W + Key_Shift).

Definition at line 119 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setKeysDown ( EKey  key,
EKey  modifier = Key_None 
) [inline]

Key bindings to move down (default = Key_S + Key_Shift).

Definition at line 122 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator().

void vl::GhostCameraManipulator::setRotationSpeed ( real  speed ) [inline]

The camera rotation speed (default = 0.5).

Definition at line 125 of file GhostCameraManipulator.hpp.

real vl::GhostCameraManipulator::rotationSpeed (  ) const [inline]

The camera rotation speed (default = 0.5).

Definition at line 128 of file GhostCameraManipulator.hpp.

void vl::GhostCameraManipulator::setMovementSpeed ( real  speed ) [inline]

The camera translation speed (default = 50).

Definition at line 131 of file GhostCameraManipulator.hpp.

real vl::GhostCameraManipulator::movementSpeed (  ) const [inline]

The camera translation speed (default = 50).

Definition at line 134 of file GhostCameraManipulator.hpp.

void vl::GhostCameraManipulator::setPosition ( vec3  position ) [inline, protected]

Definition at line 137 of file GhostCameraManipulator.hpp.

Referenced by enableEvent().

const vec3& vl::GhostCameraManipulator::position (  ) const [inline, protected]

Definition at line 139 of file GhostCameraManipulator.hpp.

void vl::GhostCameraManipulator::setXDegrees ( real  degree ) [inline, protected]

Definition at line 141 of file GhostCameraManipulator.hpp.

Referenced by enableEvent().

real vl::GhostCameraManipulator::xDegrees (  ) [inline, protected]

Definition at line 143 of file GhostCameraManipulator.hpp.

void vl::GhostCameraManipulator::setYDegrees ( real  degree ) [inline, protected]

Definition at line 145 of file GhostCameraManipulator.hpp.

Referenced by enableEvent().

real vl::GhostCameraManipulator::yDegrees (  ) [inline, protected]

Definition at line 147 of file GhostCameraManipulator.hpp.


Member Data Documentation

Definition at line 150 of file GhostCameraManipulator.hpp.

Referenced by camera(), and setCamera().

Definition at line 151 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), and updateEvent().

Definition at line 152 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), and updateEvent().

Definition at line 153 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), and mouseMoveEvent().

Definition at line 154 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), and updateEvent().

Definition at line 155 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), mouseMoveEvent(), and updateEvent().

Definition at line 156 of file GhostCameraManipulator.hpp.

Referenced by GhostCameraManipulator(), mouseMoveEvent(), and updateEvent().

Definition at line 157 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().

Definition at line 158 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().

Definition at line 159 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().

Definition at line 160 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().

Definition at line 161 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().

Definition at line 162 of file GhostCameraManipulator.hpp.

Referenced by updateEvent().


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.