Rally X
ELEN3009 Project by Justin Wernick and David Schneider
Public Member Functions | Private Member Functions
CollisionDetector Class Reference

Object for handling collisions between GameObjects. More...

#include <CollisionDetector.h>

List of all members.

Public Member Functions

void checkCollisions (list< PlayerCar > &players, list< EnemyCar > &enemies, list< Checkpoint > &checkpoints, list< Rock > &rocks, list< Smokescreen > &smokescreens)
 Checks for collisions between all relevant pairs of objects, and calls the relevant collision function if one is found.

Private Member Functions

void collision (PlayerCar &player, Checkpoint &checkpoint)
 Collision between a PlayerCar and a Checkpoint.
void collision (PlayerCar &player, EnemyCar &enemy)
 Collision between a PlayerCar and an EnemyCar.
void collision (PlayerCar &player, Rock &rock)
 Collision between a PlayerCar and a Rock.
void collision (EnemyCar &enemy, Smokescreen &smokescreen)
 Collision between an EnemyCar and a Smokescreen.

Detailed Description

Object for handling collisions between GameObjects.

Collisions between all relevant objects are checked and the appropriate methods on the GameObjects are called when a collision occurs.

Author:
Justin Wernick
David Schneider

Definition at line 22 of file CollisionDetector.h.


Member Function Documentation

void CollisionDetector::checkCollisions ( list< PlayerCar > &  players,
list< EnemyCar > &  enemies,
list< Checkpoint > &  checkpoints,
list< Rock > &  rocks,
list< Smokescreen > &  smokescreens 
)

Checks for collisions between all relevant pairs of objects, and calls the relevant collision function if one is found.

A collision occurs if the distance between two object's x values is less than 1, and the distance between their y values is also less than 1.

Parameters:
[in,out]playersList of PlayerCars, that can collide with EnemieCars, Checkpoints, or Rocks.
[in,out]enemiesList of EnemyCars, that can collide with PlayerCars, or Smokescreens.
[in,out]checkpointsList of Checkpoints, that can collide with PlayerCars.
[in,out]rocksList of Rocks, that can collide with PlayerCars.
[in,out]smokescreensList of Smokescreens, that can collide with EnemyCars.

Definition at line 3 of file CollisionDetector.cpp.

void CollisionDetector::collision ( PlayerCar player,
Checkpoint checkpoint 
) [private]

Collision between a PlayerCar and a Checkpoint.

Parameters:
[in,out]playerPlayerCar involved in the collision.
[in,out]checkpointCheckpoint involved in the collision.

Definition at line 44 of file CollisionDetector.cpp.

void CollisionDetector::collision ( PlayerCar player,
EnemyCar enemy 
) [private]

Collision between a PlayerCar and an EnemyCar.

Parameters:
[in,out]playerPlayerCar involved in the collision.
[in,out]enemyEnemyCar involved in the collision.

Definition at line 55 of file CollisionDetector.cpp.

void CollisionDetector::collision ( PlayerCar player,
Rock rock 
) [private]

Collision between a PlayerCar and a Rock.

Parameters:
[in,out]playerPlayerCar involved in the collision.
[in,out]rockRock involved in the collision.

Definition at line 50 of file CollisionDetector.cpp.

void CollisionDetector::collision ( EnemyCar enemy,
Smokescreen smokescreen 
) [private]

Collision between an EnemyCar and a Smokescreen.

Parameters:
[in,out]enemyEnemyCar involved in the collision.
[in,out]smokescreenSmokescreen involved in the collision.

Definition at line 61 of file CollisionDetector.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator