Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

TransformerPan Class Reference

Implements the Transformer to compute the transformation Matrix as a translation left/right and up/down on the screen (along the X and, respectively, Y axis) from the current mouse position in the direction of the mouse movement. More...

#include <TransformerPan.h>

Inheritance diagram for TransformerPan:

Transformer List of all members.

Public Member Functions

 TransformerPan (int width, int height, float scale)
 Create a TransformerPan with the given dimensions and scaling factor.

void reshape (int width, int height)
 Update the TransformerPan dimensions.

void start (float x, float y)
 Starts a translation.

const Matrix end (float x, float y)
 Compute the translation matrix determined by the start of the transformation (m_startX, m_startY) and the current mouse position.


Private Attributes

float m_startX
 The mouse click starting coordinate.

float m_startY
 The mouse click starting coordinate.

float m_scale
 The scaling factor for the mouse movement.


Detailed Description

Implements the Transformer to compute the transformation Matrix as a translation left/right and up/down on the screen (along the X and, respectively, Y axis) from the current mouse position in the direction of the mouse movement.


Member Function Documentation

void TransformerPan::reshape int  width,
int  height
[virtual]
 

Update the TransformerPan dimensions.

This method does nothing.

Implements Transformer.

void TransformerPan::start float  x,
float  y
[virtual]
 

Starts a translation.

Sets up m_startX and m_startY to point to the current mouse click.

Implements Transformer.


Member Data Documentation

float TransformerPan::m_scale [private]
 

The scaling factor for the mouse movement.

The mouse movement distance (in window space) is scaled by this value in order to avoid creating translations which are too big or to small relative to the object coordinates.


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 23:40:58 2003 for Shadow by doxygen 1.3.2