Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Ogre::Cursor Class Reference

The Cursor is an non-visual object that contains a the XYZ values that are modified by a InputReader. More...

#include <OgreCursor.h>

Inheritance diagram for Ogre::Cursor:

Ogre::MouseMotionTarget Ogre::MouseTarget Ogre::PositionTarget Ogre::PositionTarget Ogre::EventTarget Ogre::EventTarget List of all members.

Public Member Functions

 Cursor ()
virtual ~Cursor ()
void addToX (Real val)
 add relative amount to X

void addToY (Real val)
 add relative amount to Y

void addToZ (Real val)
 add relative amount to Z

void processEvent (InputEvent *e)
 process the mouse events that are for any listeners to the cursor

Real getX () const
 get the current X position of the cursor 0 left, 1 right

Real getY () const
 get the current Y position of the cursor 0 top, 1 bottom

Real getZ () const
 get the current Z position of the cursor 0 none, 1 full

Real getRelX () const
 get relative X cursor movement

Real getRelY () const
 get relative Y cursor movement

Real getRelZ () const
 get relative Z cursor movement

Real getLeft (void) const
 Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right).

Real getTop (void) const
 Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom).

PositionTargetgetPositionTargetParent () const
 The parent of the cursor is NULL as it's position is absolute in the window.

virtual bool isKeyEnabled () const
Real getScale (void) const
 Gets the current cursor movement scaling factor.

void setScale (Real scale)
 Sets the current cursor movement scaling factor.

void processMouseMotionEvent (MouseEvent *e)
void addMouseMotionListener (MouseMotionListener *l)
void removeMouseMotionListener (MouseMotionListener *l)
void processMouseEvent (MouseEvent *e)
void addMouseListener (MouseListener *l)
void removeMouseListener (MouseListener *l)
bool isMouseWithin () const

Protected Member Functions

Real limit (Real val, Real low, Real high)
 inline function to clip a value to its low and high limits


Protected Attributes

Real mMouseX
 Cursor position.

Real mMouseY
 Cursor position.

Real mMouseZ
 Cursor position.

Real mRelX
 relative cursor position

Real mRelY
 relative cursor position

Real mRelZ
 relative cursor position

Real mXLowLimit
 Cursor limits 0-1.

Real mXHighLimit
 Cursor limits 0-1.

Real mYLowLimit
 Cursor limits 0-1.

Real mYHighLimit
 Cursor limits 0-1.

Real mZLowLimit
 Cursor limits 0-1.

Real mZHighLimit
 Cursor limits 0-1.

Real mScale
 Scale the cursor movements.

std::set< MouseMotionListener * > mMouseMotionListeners
std::set< MouseListener * > mMouseListeners
bool mMouseWithin

Detailed Description

The Cursor is an non-visual object that contains a the XYZ values that are modified by a InputReader.

Remarks:
An InputReader creates and contains a Cursor object that it uses when it is set to buffered input (using the EventQueue).
To get a graphical representation of the cursor, a CursorGuiElement is used, which is a MouseMotionListener to the Cursor.

Definition at line 60 of file OgreCursor.h.


Constructor & Destructor Documentation

Ogre::Cursor::Cursor  ) 
 

virtual Ogre::Cursor::~Cursor  )  [virtual]
 


Member Function Documentation

void Ogre::MouseTarget::addMouseListener MouseListener l  )  [inherited]
 

void Ogre::MouseMotionTarget::addMouseMotionListener MouseMotionListener l  )  [inherited]
 

void Ogre::Cursor::addToX Real  val  ) 
 

add relative amount to X

void Ogre::Cursor::addToY Real  val  ) 
 

add relative amount to Y

void Ogre::Cursor::addToZ Real  val  ) 
 

add relative amount to Z

Real Ogre::Cursor::getLeft void   )  const [virtual]
 

Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right).

Implements Ogre::PositionTarget.

PositionTarget* Ogre::Cursor::getPositionTargetParent  )  const [virtual]
 

The parent of the cursor is NULL as it's position is absolute in the window.

Implements Ogre::PositionTarget.

Real Ogre::Cursor::getRelX  )  const
 

get relative X cursor movement

Definition at line 106 of file OgreCursor.h.

References Ogre::Real.

Real Ogre::Cursor::getRelY  )  const
 

get relative Y cursor movement

Definition at line 109 of file OgreCursor.h.

References Ogre::Real.

Real Ogre::Cursor::getRelZ  )  const
 

get relative Z cursor movement

Definition at line 112 of file OgreCursor.h.

References Ogre::Real.

Real Ogre::Cursor::getScale void   )  const
 

Gets the current cursor movement scaling factor.

Definition at line 130 of file OgreCursor.h.

References Ogre::Real.

Real Ogre::Cursor::getTop void   )  const [virtual]
 

Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom).

Implements Ogre::PositionTarget.

Real Ogre::Cursor::getX  )  const
 

get the current X position of the cursor 0 left, 1 right

Real Ogre::Cursor::getY  )  const
 

get the current Y position of the cursor 0 top, 1 bottom

Real Ogre::Cursor::getZ  )  const
 

get the current Z position of the cursor 0 none, 1 full

virtual bool Ogre::Cursor::isKeyEnabled  )  const [virtual]
 

Implements Ogre::PositionTarget.

Definition at line 126 of file OgreCursor.h.

bool Ogre::MouseTarget::isMouseWithin  )  const [inherited]
 

Real Ogre::Cursor::limit Real  val,
Real  low,
Real  high
[protected]
 

inline function to clip a value to its low and high limits

Definition at line 77 of file OgreCursor.h.

References Ogre::Real.

void Ogre::Cursor::processEvent InputEvent e  )  [virtual]
 

process the mouse events that are for any listeners to the cursor

Implements Ogre::EventTarget.

void Ogre::MouseTarget::processMouseEvent MouseEvent e  )  [inherited]
 

void Ogre::MouseMotionTarget::processMouseMotionEvent MouseEvent e  )  [inherited]
 

void Ogre::MouseTarget::removeMouseListener MouseListener l  )  [inherited]
 

void Ogre::MouseMotionTarget::removeMouseMotionListener MouseMotionListener l  )  [inherited]
 

void Ogre::Cursor::setScale Real  scale  ) 
 

Sets the current cursor movement scaling factor.

Definition at line 132 of file OgreCursor.h.

References Ogre::Real.


Member Data Documentation

std::set<MouseListener*> Ogre::MouseTarget::mMouseListeners [protected, inherited]
 

Definition at line 58 of file OgreMouseTarget.h.

std::set<MouseMotionListener*> Ogre::MouseMotionTarget::mMouseMotionListeners [protected, inherited]
 

Definition at line 58 of file OgreMouseMotionTarget.h.

bool Ogre::MouseTarget::mMouseWithin [protected, inherited]
 

Definition at line 61 of file OgreMouseTarget.h.

Real Ogre::Cursor::mMouseX [protected]
 

Cursor position.

Definition at line 64 of file OgreCursor.h.

Real Ogre::Cursor::mMouseY [protected]
 

Cursor position.

Definition at line 64 of file OgreCursor.h.

Real Ogre::Cursor::mMouseZ [protected]
 

Cursor position.

Definition at line 64 of file OgreCursor.h.

Real Ogre::Cursor::mRelX [protected]
 

relative cursor position

Definition at line 67 of file OgreCursor.h.

Real Ogre::Cursor::mRelY [protected]
 

relative cursor position

Definition at line 67 of file OgreCursor.h.

Real Ogre::Cursor::mRelZ [protected]
 

relative cursor position

Definition at line 67 of file OgreCursor.h.

Real Ogre::Cursor::mScale [protected]
 

Scale the cursor movements.

Initially set at 1 (no scaling). The scaling effects all axis, XYZ

Definition at line 74 of file OgreCursor.h.

Real Ogre::Cursor::mXHighLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.

Real Ogre::Cursor::mXLowLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.

Real Ogre::Cursor::mYHighLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.

Real Ogre::Cursor::mYLowLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.

Real Ogre::Cursor::mZHighLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.

Real Ogre::Cursor::mZLowLimit [protected]
 

Cursor limits 0-1.

Definition at line 70 of file OgreCursor.h.


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

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:00:18 2006