Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Public Attributes | List of all members
vtLastMouse Class Reference

#include <Engine.h>

Inheritance diagram for vtLastMouse:
vtEngine vtEnabledBase FlatFlyer GlobePicker TerrainPicker vtFlyer vtTinFlyer vtTrackball vtOrthoFlyer vtTerrainFlyer GrabFlyer QuakeFlyer VFlyer vtPanoFlyer

Public Member Functions

void OnMouse (vtMouseEvent &event)
 Virtual handler, to catch mouse events, can be overridden by your engine class.
 
void GetNormalizedMouseCoords (float &mx, float &my)
 
- Public Member Functions inherited from vtEngine
osg::Referenced * GetTarget (uint which=0)
 
void AddTarget (osg::Referenced *ptr)
 
void SetTarget (osg::Referenced *ptr)
 
void RemoveTarget (osg::Referenced *ptr)
 
uint NumTargets ()
 Return the number of targets for this engine.
 
void setName (const char *str)
 
const char * getName ()
 
virtual void OnKey (int key, int flags)
 Virtual handler, to catch keyboard events, can be overridden by your engine class.
 
virtual void OnWindowSize (int width, int height)
 Virtual handler, to catch resize events, can be overridden by your engine class.
 
virtual void Eval ()
 
void SetWindow (vtWindow *pWin)
 
vtWindowGetWindow ()
 
void AddChild (vtEngine *pEngine)
 
void RemoveChild (vtEngine *pEngine)
 
vtEngineGetChild (uint i)
 
uint NumChildren ()
 
void AddChildrenToList (vtArray< vtEngine * > &list, bool bEnabledOnly)
 
- Public Member Functions inherited from vtEnabledBase
virtual void SetEnabled (bool bOn)
 
bool GetEnabled ()
 

Public Attributes

int m_buttons
 
IPoint2 m_pos
 
int m_flags
 

Additional Inherited Members

- Protected Attributes inherited from vtEngine
vtArray< osg::Referenced * > m_Targets
 
std::vector< vtEnginePtr > m_Children
 
vtString m_strName
 
vtWindowm_pWindow
 

Detailed Description

This simple engine extends the base class vtEngine with the ability to remember the last state of the mouse. This is useful for engines which simply need to know mouse state (cursor position and button state). They can simply subclass from vtLastMouse and use the inherited fields rather than having to catch mouse events.

Member Function Documentation

void vtLastMouse::GetNormalizedMouseCoords ( float &  mx,
float &  my 
)

Returns the mouse coordinates in the window, normalized such that X and Y range from -1 to 1 (left to right, top to bottom across the window.

Member Data Documentation

int vtLastMouse::m_buttons

The state of the mouse buttons

int vtLastMouse::m_flags

Last known state of the modifier flags

IPoint2 vtLastMouse::m_pos

The location of the mouse cursor


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