Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
PositionController Class Reference

PositionController Class check if the cube has a collision with obstacles. More...

#include <positioncontroller.h>

Inheritance diagram for PositionController:
Inheritance graph
Collaboration diagram for PositionController:
Collaboration graph

Signals

void collision ()
 Signal emitted when the cube has a collision with an obstacle.
 

Public Member Functions

 PositionController (Cube *_cube, Level *_level, QObject *_parent=0)
 Create a PositionController Objects. More...
 
 ~PositionController ()
 Destroy a PositionController Object.
 
void startChecking ()
 Start checking for collision.
 
void stopChecking ()
 Stop checking for collisions.
 

Private Slots

void checkCollision ()
 Check if the cube has a collision with an obstacle.
 

Private Member Functions

Vector3fpositionToCell (Vector3f *position)
 Returns the cell coordinates from absolute position. More...
 
GLvoid createObstacleCells ()
 Create the 3D Matrix of ObstacleCells.
 
void run ()
 Reimplementation of the run() function of the QThread class.
 
bool isInteger (float f)
 Check if a float is an integer. More...
 

Private Attributes

QObjectparent
 
Cubecube
 
Levellevel
 
GLint levelLength
 
GLint levelWidth
 
QTimer * checkPositionTimer
 
QVector< QVector< QVector
< bool > > > 
obstacleCells
 

Detailed Description

PositionController Class check if the cube has a collision with obstacles.

Version
1.0
Author
#34

Constructor & Destructor Documentation

PositionController::PositionController ( Cube _cube,
Level _level,
QObject _parent = 0 
)
explicit

Create a PositionController Objects.

Parameters
_cubeis the cube Object pointer.
_levelis the level Object pointer.
_parentis the parent Object pointer.

Here is the call graph for this function:

Member Function Documentation

bool PositionController::isInteger ( float  f)
private

Check if a float is an integer.

Parameters
fis the float.
Returns
true if is an integer.

Here is the caller graph for this function:

Vector3f * PositionController::positionToCell ( Vector3f position)
private

Returns the cell coordinates from absolute position.

Parameters
positionis the vector of absolute coordinates.
Returns
the cell coordinates from absolute position.

Here is the caller graph for this function:

Member Data Documentation

QTimer* PositionController::checkPositionTimer
private

QTimer controlling the checkCollision() calls.

Cube* PositionController::cube
private

It is the pointer to the Cube Object.

Level* PositionController::level
private

Is the pointer to the Level Object.

GLint PositionController::levelLength
private

It is the length of the Level.

GLint PositionController::levelWidth
private

It is the width of the Level.

QVector<QVector<QVector<bool> > > PositionController::obstacleCells
private

It is the 3d matrix rappresent obstacle cells

QObject* PositionController::parent
private

It is the parent of the PositionController.


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