#include <Track.h>
Public Member Functions | |
Track (std::istream &stream, const Theme &theme, bool editor=false) | |
Intialise by loading data from a stream, sharing an already loaded theme. | |
Track (const Theme &theme, bool editor=false) | |
Make an empty track. | |
virtual | ~Track () |
const Path & | get_path () const |
Get a the path without modification. | |
Path & | get_path () |
Get the path so it can be changed. | |
const Theme & | get_theme () const |
boost::shared_ptr< btCollisionShape > | get_collision_shape () const |
Return the collision shape for the entire track. | |
boost::shared_ptr< btCollisionShape > | get_floor_shape () const |
Return the collision shape for the part of the track you can drive on. | |
const MeshFaces & | get_ai_mesh () const |
Return a mesh of the faces the ai drives on. | |
const MeshFaces::Graph & | get_ai_graph () const |
Get a graph showing connections between faces that AI can drive on. | |
void | update_ai_mesh () |
Recalculate the surface that the AI can drive on, and its connectivity graph. | |
btScalar | get_lap_length () const |
Return the length of the lap. | |
void | set_filename (std::string filename) |
Set the filename to record in replay files. | |
std::string | get_filename () const |
Get the filename previously set by set_filename. | |
const Lighting & | get_lighting () const |
void | set_lighting (const Lighting &lighting) |
Protected Member Functions | |
void | scan_theme () |
In editor mode, scan the meshes in the theme and set them to display wireframe. | |
void | scan_ai_graph () |
Find position coordinates for the AI mesh. | |
Protected Attributes | |
const unsigned int | file_version |
The vesion used to load the file. | |
const Theme & | theme |
The theme of the track. | |
Path | path |
The path the course follows. | |
bool | editor |
If the track should act like in the editor. | |
std::string | filename |
MeshFaces | m_ai_mesh |
Mesh used for AI navigation. | |
MeshFaces::Graph | m_ai_graph |
Graph for AI navigation mesh. | |
btScalar | m_lap_length |
Length of shortest path around the track. | |
Lighting | m_lighting |
The lighting setup of the track. | |
Friends | |
std::ostream & | operator<< (std::ostream &destination, const Track &track) |
write a track to a stream, so it can be loaded with Track(stream) |
A track has a Track::Theme and Paths to drive on.
Definition at line 34 of file Track.h.
Track::Track::Track | ( | std::istream & | stream, | |
const Theme & | theme, | |||
bool | editor = false | |||
) |
Intialise by loading data from a stream, sharing an already loaded theme.
stream | The stream to pull data from. It must point to a track. It will be advanced until the end of the track. | |
theme | The theme the track was made for. | |
editor | When set to true, causes the track to act more helpful to the editor. For example, by default tracks are rendered in wireframe. |
Track::Track::Track | ( | const Theme & | theme, | |
bool | editor = false | |||
) |
Make an empty track.
virtual Track::Track::~Track | ( | ) | [virtual] |
const MeshFaces::Graph& Track::Track::get_ai_graph | ( | ) | const |
Get a graph showing connections between faces that AI can drive on.
Call update_ai_mesh() first.
const MeshFaces& Track::Track::get_ai_mesh | ( | ) | const |
Return a mesh of the faces the ai drives on.
Faces from different sources that line up will be joined together, allowing the mesh to be used as a navigatable surface. If you have changed the track, the ai mesh does not update automatically. Call update_ai_mesh() to update all references to the ai mesh. Precondition: update_ai_mesh() has been called since the last edit. Postcondition: get_ai_mesh() reflects the surface the AI should consider.
boost::shared_ptr<btCollisionShape> Track::Track::get_collision_shape | ( | ) | const |
Return the collision shape for the entire track.
std::string Track::Track::get_filename | ( | ) | const |
Get the filename previously set by set_filename.
boost::shared_ptr<btCollisionShape> Track::Track::get_floor_shape | ( | ) | const |
Return the collision shape for the part of the track you can drive on.
btScalar Track::Track::get_lap_length | ( | ) | const |
Return the length of the lap.
Requires update_ai_mesh() was called since the last change to the track.
const Lighting& Track::Track::get_lighting | ( | ) | const |
Path & Track::Track::get_path | ( | ) |
const Path& Track::Track::get_path | ( | ) | const |
Get a the path without modification.
const Theme& Track::Track::get_theme | ( | ) | const |
void Track::Track::scan_ai_graph | ( | ) | [protected] |
Find position coordinates for the AI mesh.
Requires that m_ai_mesh is up to date, but invalidates m_ai_graph. Abuses u texture coordinate to mean how far through the lap a point is. Also sets the m_lap_length.
void Track::Track::scan_theme | ( | ) | [protected] |
In editor mode, scan the meshes in the theme and set them to display wireframe.
void Track::Track::set_filename | ( | std::string | filename | ) |
Set the filename to record in replay files.
void Track::Track::set_lighting | ( | const Lighting & | lighting | ) |
void Track::Track::update_ai_mesh | ( | ) |
Recalculate the surface that the AI can drive on, and its connectivity graph.
std::ostream & Track::Track::operator<< | ( | std::ostream & | destination, | |
const Track & | track | |||
) | [friend] |
write a track to a stream, so it can be loaded with Track(stream)
destination | The stream to write to. If the stream is read back from the position it was in before this function call using Track::Track(stream) | |
track | The track to write to a file. |
bool Track::Track::editor [protected] |
const unsigned int Track::Track::file_version [protected] |
std::string Track::Track::filename [protected] |
MeshFaces::Graph Track::Track::m_ai_graph [protected] |
MeshFaces Track::Track::m_ai_mesh [protected] |
btScalar Track::Track::m_lap_length [protected] |
Lighting Track::Track::m_lighting [protected] |
Path Track::Track::path [protected] |
const Theme& Track::Track::theme [protected] |
Generated at Mon Sep 6 00:41:19 2010 by Doxygen version 1.4.7 for Racer version svn335.