#include <GameScene.h>
Inheritance diagram for Engine::GameScene:
Public Member Functions | |
GameScene (std::vector< std::pair< InputHandler::iterator, unsigned int > > input_devices, const Track::Track &track) | |
Create a game where the players use specified input devices. | |
virtual | ~GameScene () |
virtual void | take_input (InputReport &report) |
Take input from an input device. | |
virtual void | update_logic (unsigned int milliseconds_elapsed) |
Process any status changes that occur due to elapsed time. | |
virtual void | draw () |
Draw the scene using OpenGL commands. | |
virtual void | do_sound () |
Update the audio. | |
Physics::World & | get_world () |
Get the physics world used for the scene. | |
void | set_save_replay (bool value=true) |
Turn on or off replay saving. | |
Private Member Functions | |
void | draw_paused_screen () |
Draw the overlay that appears when the game is paused. | |
void | draw_for_player (unsigned int player, float aspect) |
Draw the window for the specified player. | |
void | draw_world (unsigned int player, float aspect) |
void | draw_hud (unsigned int player) |
void | draw_speedometer (unsigned int player) |
void | draw_lap_info (unsigned int player) |
void | draw_rank (unsigned int player) |
void | draw_disqualified (unsigned int player) |
Write 'Disqualified' in the middle of a player's viewport. | |
void | draw_finished (unsigned int player) |
Write 'Finished' in the middle of a player's viewport. | |
void | draw_reverse_sign (unsigned int player) |
Show the user they are facing the wrong way. | |
void | draw_countdown () |
Show the countdown at the begining of the race. | |
void | rank_cars () |
Set car_ranks. | |
void | unpause () |
Unpause the game and reset the pause menu. | |
Private Attributes | |
std::vector< std::pair< InputHandler::iterator, unsigned int > > | m_input_devices |
Input devices used for cars, in the same order as cars. | |
std::stringstream | m_replay_header |
Graphics::SkyBox | sky |
Graphics::SkyParticles | m_sky_particles |
Track::OcclusionTester | occlusion_tester |
std::vector< GameObjects::Car * > | cars |
std::vector< unsigned int > | m_humans |
Indices of the human players in cars and m_input_devices. | |
std::vector< bool > | car_skip |
For each human player, true if they tried to skip the pause before quitting. | |
std::vector< CarCamera * > | car_cameras |
Cameras for each human player's car. | |
btRigidBody * | track_body |
btRigidBody * | floor_body |
boost::shared_ptr< btCollisionShape > | track_shape |
boost::shared_ptr< btCollisionShape > | floor_shape |
const Track::Track & | track |
The course to play on. | |
Physics::World | world |
bool | save_replay |
Save replays when the scene is destroyed? | |
float | fps |
frequency of rendering in hertz. | |
std::vector< int > | car_ranks |
The ranking of the cars. | |
btVector3 | start_point |
The centre of the starting plane. | |
btVector3 | start_plane_normal |
A normalized vector in the direction perpendicular to the starting plane. | |
btScalar | start_plane_distance |
The signed distance between the origin and and the starting plane. | |
Track::Texture * | m_speedometer_texture |
The texture with the speedometer parts. | |
Track::Texture * | m_best_lap_texture |
The texture with the best lap icon. | |
Track::Texture * | m_finish_border_texture |
The texture for the border above and below the finish message. | |
Track::Texture * | m_finish_text_texture |
The texture that says "Finished". | |
Track::Texture * | m_disqualified_text_texture |
The texture that says "Disqualified". | |
Track::Texture * | m_reverse_texture |
The texture for the u-turn sign that appears when facing the wrong way. | |
Track::Texture * | m_countdown_texture |
The texture for the countdown at the start of the race. | |
int | countdown_timer |
Millisecond timer to the start of the race. | |
bool | paused |
True if the game is paused. | |
UI::PauseMenu | m_pause_menu |
The menu to display when paused. | |
bool | show_debug |
unsigned int | m_debug_list_name |
Display list for debug draw of the track. | |
unsigned int | m_debug_texture_name |
Texture name for the navigation texture used for debug draw. | |
Track::DrawableMesh | ai_mesh |
unsigned int | m_total_frames |
number of frames processed since the start of the game. | |
unsigned int | m_total_time |
number of milliseconds elapsed since the start of the game. |
Definition at line 32 of file GameScene.h.
Engine::GameScene::GameScene | ( | std::vector< std::pair< InputHandler::iterator, unsigned int > > | input_devices, | |
const Track::Track & | track | |||
) |
Create a game where the players use specified input devices.
input_devices | InputHandler iterators to the input devices, paired with the car model to use for each player. | |
track | The track to play on. |
Definition at line 42 of file GameScene.cpp.
Engine::GameScene::~GameScene | ( | ) | [virtual] |
Definition at line 216 of file GameScene.cpp.
void Engine::GameScene::do_sound | ( | ) | [virtual] |
void Engine::GameScene::draw | ( | ) | [virtual] |
Draw the scene using OpenGL commands.
Must go from any state to ready for a buffer swap.
Implements Engine::Scene.
Definition at line 388 of file GameScene.cpp.
void Engine::GameScene::draw_countdown | ( | ) | [private] |
void Engine::GameScene::draw_disqualified | ( | unsigned int | player | ) | [private] |
Write 'Disqualified' in the middle of a player's viewport.
Definition at line 865 of file GameScene.cpp.
void Engine::GameScene::draw_finished | ( | unsigned int | player | ) | [private] |
Write 'Finished' in the middle of a player's viewport.
Definition at line 888 of file GameScene.cpp.
void Engine::GameScene::draw_for_player | ( | unsigned int | player, | |
float | aspect | |||
) | [private] |
Draw the window for the specified player.
Viewport must be set up first.
player | the index in the car_cameras array to use. | |
aspect | The aspect ratio (width divided by height) of the viewport. |
Definition at line 591 of file GameScene.cpp.
void Engine::GameScene::draw_hud | ( | unsigned int | player | ) | [private] |
Definition at line 665 of file GameScene.cpp.
void Engine::GameScene::draw_lap_info | ( | unsigned int | player | ) | [private] |
Definition at line 759 of file GameScene.cpp.
void Engine::GameScene::draw_paused_screen | ( | ) | [private] |
Draw the overlay that appears when the game is paused.
Definition at line 558 of file GameScene.cpp.
void Engine::GameScene::draw_rank | ( | unsigned int | player | ) | [private] |
Definition at line 833 of file GameScene.cpp.
void Engine::GameScene::draw_reverse_sign | ( | unsigned int | player | ) | [private] |
void Engine::GameScene::draw_speedometer | ( | unsigned int | player | ) | [private] |
Definition at line 707 of file GameScene.cpp.
void Engine::GameScene::draw_world | ( | unsigned int | player, | |
float | aspect | |||
) | [private] |
Definition at line 617 of file GameScene.cpp.
Physics::World & Engine::GameScene::get_world | ( | ) |
void Engine::GameScene::rank_cars | ( | ) | [private] |
void Engine::GameScene::set_save_replay | ( | bool | value = true |
) |
Turn on or off replay saving.
Replay saving is turned on by default. When the scene is destroyed, the replay can be saved to a file called last replay.
value | true to save replays, false otherwise. |
Definition at line 1024 of file GameScene.cpp.
void Engine::GameScene::take_input | ( | InputReport & | report | ) | [virtual] |
Take input from an input device.
report | An input report, which may be freed immediately after the call returns. |
Implements Engine::Scene.
Definition at line 260 of file GameScene.cpp.
void Engine::GameScene::unpause | ( | ) | [private] |
void Engine::GameScene::update_logic | ( | unsigned int | milliseconds_elapsed | ) | [virtual] |
Process any status changes that occur due to elapsed time.
milliseconds_elapsed | time in milliseconds since last update_logic. |
Implements Engine::Scene.
Definition at line 318 of file GameScene.cpp.
Definition at line 177 of file GameScene.h.
std::vector<CarCamera *> Engine::GameScene::car_cameras [private] |
std::vector<int> Engine::GameScene::car_ranks [private] |
The ranking of the cars.
car_ranks[i] is the rank of the ith car. Rank 0 is first.
Definition at line 109 of file GameScene.h.
std::vector<bool> Engine::GameScene::car_skip [private] |
For each human player, true if they tried to skip the pause before quitting.
Definition at line 86 of file GameScene.h.
std::vector<GameObjects::Car *> Engine::GameScene::cars [private] |
Definition at line 82 of file GameScene.h.
int Engine::GameScene::countdown_timer [private] |
Millisecond timer to the start of the race.
>= 0 implies race has started.
Definition at line 161 of file GameScene.h.
btRigidBody* Engine::GameScene::floor_body [private] |
Definition at line 90 of file GameScene.h.
boost::shared_ptr<btCollisionShape> Engine::GameScene::floor_shape [private] |
Definition at line 92 of file GameScene.h.
float Engine::GameScene::fps [private] |
frequency of rendering in hertz.
Calcualted from time between last two frames.
Definition at line 104 of file GameScene.h.
unsigned int Engine::GameScene::m_debug_list_name [private] |
unsigned int Engine::GameScene::m_debug_texture_name [private] |
Texture name for the navigation texture used for debug draw.
Definition at line 176 of file GameScene.h.
The texture for the border above and below the finish message.
Definition at line 148 of file GameScene.h.
std::vector<unsigned int> Engine::GameScene::m_humans [private] |
Indices of the human players in cars and m_input_devices.
Definition at line 84 of file GameScene.h.
std::vector<std::pair<InputHandler::iterator, unsigned int> > Engine::GameScene::m_input_devices [private] |
UI::PauseMenu Engine::GameScene::m_pause_menu [private] |
std::stringstream Engine::GameScene::m_replay_header [private] |
Definition at line 78 of file GameScene.h.
The texture for the u-turn sign that appears when facing the wrong way.
Definition at line 154 of file GameScene.h.
Definition at line 80 of file GameScene.h.
unsigned int Engine::GameScene::m_total_frames [private] |
unsigned int Engine::GameScene::m_total_time [private] |
number of milliseconds elapsed since the start of the game.
Definition at line 182 of file GameScene.h.
Definition at line 81 of file GameScene.h.
bool Engine::GameScene::paused [private] |
bool Engine::GameScene::save_replay [private] |
bool Engine::GameScene::show_debug [private] |
Definition at line 170 of file GameScene.h.
Graphics::SkyBox Engine::GameScene::sky [private] |
Definition at line 79 of file GameScene.h.
btScalar Engine::GameScene::start_plane_distance [private] |
The signed distance between the origin and and the starting plane.
Definition at line 141 of file GameScene.h.
btVector3 Engine::GameScene::start_plane_normal [private] |
A normalized vector in the direction perpendicular to the starting plane.
Definition at line 139 of file GameScene.h.
btVector3 Engine::GameScene::start_point [private] |
const Track::Track& Engine::GameScene::track [private] |
btRigidBody* Engine::GameScene::track_body [private] |
Definition at line 89 of file GameScene.h.
boost::shared_ptr<btCollisionShape> Engine::GameScene::track_shape [private] |
Definition at line 91 of file GameScene.h.
Physics::World Engine::GameScene::world [private] |
Definition at line 97 of file GameScene.h.
Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.