SuperTuxKart
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Track Class Reference

Classes

class  TrackMode
 A simple class to keep information about a track mode. More...
 

Public Member Functions

void handleAnimatedTextures (scene::ISceneNode *node, const XMLNode &xml)
 Handles animated textures. More...
 
 Track (const std::string &filename)
 
 ~Track ()
 Destructor, removes quad data structures etc. More...
 
void cleanup ()
 Removes the physical body from the world. More...
 
void removeCachedData ()
 Removes all cached data structures. More...
 
void startMusic () const
 Select and set the music for this track (doesn't actually start it yet).
 
void createPhysicsModel (unsigned int main_track_count)
 Convert the track tree into its physics equivalents. More...
 
void updateGraphics (float dt)
 This updates all only graphical elements. More...
 
void update (int ticks)
 Update, called once per physics time step. More...
 
void reset ()
 Prepates the track for a new race. More...
 
void itemCommand (const XMLNode *node)
 Handle creation and placement of an item. More...
 
Vec3 flagCommand (const XMLNode *node)
 
core::stringw getName () const
 Returns the name of the track, which is e.g. More...
 
core::stringw getSortName () const
 Returns the name of the track used to sort the tracks alphabetically. More...
 
bool isInGroup (const std::string &group_name)
 Returns true if this track belongs to the specified track group. More...
 
const core::vector3df & getSunRotation ()
 Returns the rotation of the sun. More...
 
void setAmbientColor (const video::SColor &color, unsigned int k)
 Sets the current ambient color for a kart with index k. More...
 
void handleExplosion (const Vec3 &pos, const PhysicalObject *mp, bool secondary_hits=true) const
 Handles an explosion, i.e. More...
 
void loadTrackModel (bool reverse_track=false, unsigned int mode_id=0)
 This function load the actual scene, i.e. More...
 
bool findGround (AbstractKart *kart)
 Determines if the kart is over ground. More...
 
std::vector< std::vector< float > > buildHeightMap ()
 
void drawMiniMap (const core::rect< s32 > &dest_rect) const
 
void updateMiniMapScale ()
 
bool isArena () const
 Returns true if this track has an arena mode. More...
 
bool isCTF () const
 
bool isRaceTrack () const
 Returns true if this track is a racing track. More...
 
bool hasEasterEggs () const
 Returns true if this track has easter eggs. More...
 
bool reverseAvailable () const
 Returns true if this race can be driven in reverse. More...
 
bool hasNavMesh () const
 Returns true if this track navmesh. More...
 
void loadObjects (const XMLNode *root, const std::string &path, ModelDefinitionLoader &lod_loader, bool create_lod_definitions, scene::ISceneNode *parent, TrackObject *parent_library)
 
bool isSoccer () const
 
void addMusic (MusicInformation *mi)
 
float getGravity () const
 
int getVersion () const
 Returns the version of the .track file. More...
 
float getTrackLength () const
 Returns the length of the main driveline. More...
 
const std::string & getIdent () const
 Returns a unique identifier for this track (the directory name). More...
 
const std::vector< std::string > & getGroups () const
 Returns all groups this track belongs to. More...
 
const std::string & getFilename () const
 Returns the filename of this track. More...
 
const core::stringw & getDesigner () const
 Returns the name of the designer. More...
 
const std::string & getScreenshotFile () const
 Returns an absolute path to the screenshot file of this track.
 
const bool getIsDuringDay () const
 Returns if the track is during day time.
 
const btTransform & getStartTransform (unsigned int index) const
 Returns the start coordinates for a kart with a given index. More...
 
void shuffleStartTransforms ()
 Shuffles the start transformations.
 
void getAABB (const Vec3 **min, const Vec3 **max) const
 Sets pointer to the aabb of this track. More...
 
float getAngle (int n) const
 Returns 'a' angle for quad n. More...
 
void mapPoint2MiniMap (const Vec3 &xyz, Vec3 *draw_at) const
 Returns the 2d coordinates of a point when drawn on the mini map texture. More...
 
std::string getTrackFile (const std::string &s) const
 Returns the full path of a given file inside this track directory. More...
 
unsigned int getNumberOfModes () const
 Returns the number of modes available for this track. More...
 
unsigned int getNumOfCompletedChallenges ()
 Returns number of completed challenges. More...
 
const std::string & getModeName (unsigned int i) const
 Returns the name of the i-th. More...
 
const video::SColor & getDefaultAmbientColor () const
 Returns the default ambient color. More...
 
float getCameraFar () const
 Returns the far value for cameras. More...
 
const TriangleMeshgetPtrTriangleMesh () const
 Returns the triangle mesh for this track. More...
 
const TriangleMeshgetTriangleMesh () const
 
const TriangleMeshgetGFXEffectMesh () const
 Returns the graphical effect mesh for this track. More...
 
unsigned int getMaxArenaPlayers () const
 Get the max players supported for this track, for arena only. More...
 
unsigned int getNumberOfStartPositions () const
 Get the number of start positions defined in the scene file. More...
 
bool getWeatherLightning ()
 
const std::string & getWeatherSound ()
 
ParticleKindgetSkyParticles ()
 
void forceFogDisabled (bool v)
 Override track fog value to force disabled.
 
bool isFogEnabled () const
 Returns if fog is currently enabled. More...
 
float getFogStart () const
 
void setFogStart (float start)
 
float getFogEnd () const
 
void setFogEnd (float end)
 
float getFogStartHeight () const
 
float getFogEndHeight () const
 
float getFogMax () const
 
void setFogMax (float max)
 
video::SColor getFogColor () const
 
void setFogColor (video::SColor &color)
 
video::SColor getSunColor () const
 
bool isInternal () const
 Whether this is an "internal" track. More...
 
bool isAutoRescueEnabled () const
 Returns true if auto rescue is enabled. More...
 
bool isPushBackEnabled () const
 True if push back of karts towards the track should be enabled. More...
 
bool smoothNormals () const
 Returns true if the normals of this track can be smoothed. More...
 
TrackObjectManagergetTrackObjectManager () const
 Returns the track object manager. More...
 
const std::vector< OverworldChallenge > & getChallengeList () const
 Get list of challenges placed on that world. More...
 
const std::vector< Subtitle > & getSubtitles () const
 
bool hasClouds () const
 
bool hasBloom () const
 
float getBloomThreshold () const
 
core::vector3df getColorLevelIn () const
 Return the color levels for color correction shader.
 
core::vector2df getColorLevelOut () const
 
bool hasGodRays () const
 
core::vector3df getGodRaysPosition () const
 
float getGodRaysOpacity () const
 
video::SColor getGodRaysColor () const
 
bool hasShadows () const
 
void addNode (scene::ISceneNode *node)
 
void addPhysicsOnlyNode (scene::ISceneNode *node)
 
float getDisplacementSpeed () const
 
int getPhysicalObjectUID ()
 
const int getDefaultNumberOfLaps () const
 
const int getActualNumberOfLap () const
 
void setActualNumberOfLaps (unsigned int laps)
 
bool operator< (const Track &other) const
 A < comparison of tracks. More...
 
void addCachedMesh (scene::IMesh *mesh)
 Adds mesh to cleanup list.
 
void addMetaLibrary (TrackObject *parent, TrackObject *meta_library)
 Adds the parent of the meta library for correction later.
 
const btTransform & getRedFlag () const
 
const btTransform & getBlueFlag () const
 
bool isAddon () const
 
void convertTrackToBullet (scene::ISceneNode *node)
 Convert the graohics track into its physics equivalents. More...
 

Static Public Member Functions

static TrackgetCurrentTrack ()
 Static function to get the current track. More...
 
static void uploadNodeVertexBuffer (scene::ISceneNode *node)
 Static helper function to pre-upload vertex buffer in spm. More...
 

Static Public Attributes

static bool m_dont_load_navmesh = false
 Flag to avoid loading navmeshes (useful to speedup debugging: e.g. More...
 
static const float NOHIT = -99999.9f
 

Private Types

enum  { SKY_NONE, SKY_BOX, SKY_DOME, SKY_COLOR }
 The type of sky to be used for the track. More...
 

Private Member Functions

void loadTrackInfo ()
 
void loadDriveGraph (unsigned int mode_id, const bool reverse)
 Loads the drive graph, i.e. More...
 
void loadArenaGraph (const XMLNode &node)
 Loads the quad graph for arena, i.e. More...
 
btQuaternion getArenaStartRotation (const Vec3 &xyz, float heading)
 
bool loadMainTrack (const XMLNode &node)
 Loads the main track model (i.e. More...
 
void loadMinimap ()
 
void createWater (const XMLNode &node)
 Creates a water node. More...
 
void getMusicInformation (std::vector< std::string > &filenames, std::vector< MusicInformation * > &m_music)
 Loads all music information for the specified files (which is taken from the track.xml file). More...
 
void loadCurves (const XMLNode &node)
 Loads all curves from the XML node.
 
void handleSky (const XMLNode &root, const std::string &filename)
 Handles a sky-dome or sky-box. More...
 
void freeCachedMeshVertexBuffer ()
 

Private Attributes

float m_gravity
 
float m_friction
 Friction to be used for the track. More...
 
std::string m_ident
 
std::string m_screenshot
 
bool m_is_day
 
std::vector< MusicInformation * > m_music
 
std::vector< OverworldChallengem_challenges
 Will only be used on overworld.
 
std::vector< Subtitlem_subtitles
 
AlignedArray< btTransform > m_start_transforms
 Start transforms of karts (either the default, or the ones taken from the scene file). More...
 
std::string m_item_style
 
std::string m_description
 
core::stringw m_designer
 
bool m_startup_run
 
std::string m_filename
 The full filename of the config (xml) file. More...
 
std::string m_root
 The base dir of all files of this track. More...
 
std::vector< std::string > m_groups
 
std::vector< scene::ISceneNode * > m_all_nodes
 The list of all nodes. More...
 
std::vector< scene::ISceneNode * > m_static_physics_only_nodes
 The list of all nodes that are to be converted into physics, but not to be drawn (e.g. More...
 
std::vector< scene::ISceneNode * > m_object_physics_only_nodes
 Same concept but for track objects. More...
 
std::vector< scene::IMesh * > m_all_cached_meshes
 The list of all meshes that are loaded from disk, which means that those meshes are being cached by irrlicht, and need to be freed. More...
 
std::vector< scene::IMesh * > m_detached_cached_meshes
 m_all_cached_meshes assumes meshes are attached to a scene node. More...
 
std::vector< video::ITexture * > m_all_cached_textures
 A list of all textures loaded by the track, so that they can be removed from the cache at cleanup time. More...
 
bool m_materials_loaded
 True if the materials.xml file is already loaded. More...
 
bool m_cache_track
 True if this track (textures and track data) should be cached. More...
 
PtrVector< ParticleEmitterm_all_emitters
 
scene::ISceneNode * m_sun
 
TriangleMeshm_track_mesh
 Used to collect the triangles for the bullet mesh. More...
 
TriangleMeshm_gfx_effect_mesh
 Used to collect the triangles which do not have a physical representation, but are needed for some raycast effects. More...
 
Vec3 m_aabb_min
 Minimum coordinates of this track. More...
 
Vec3 m_aabb_max
 Maximum coordinates of this track. More...
 
btTransform m_red_flag
 
btTransform m_blue_flag
 
bool m_is_arena
 True if this track is an arena. More...
 
bool m_is_ctf
 
unsigned int m_max_arena_players
 Max players supported by an arena. More...
 
bool m_has_easter_eggs
 True if this track has easter eggs. More...
 
bool m_has_navmesh
 True if this track has navmesh. More...
 
bool m_is_soccer
 True if this track is a soccer arena. More...
 
bool m_is_cutscene
 
int m_version
 The version of this track. More...
 
float m_camera_far
 Far value for cameras for this track. More...
 
bool m_internal
 Whether this is an "internal" track. More...
 
bool m_reverse_available
 Whether this track should be available in reverse version.
 
bool m_enable_auto_rescue
 If true a player kart will automatically be rescued if it is e.g. More...
 
bool m_enable_push_back
 If true any collision of a kart with the track will push the kart towards the nearest driveline. More...
 
enum Track:: { ... }  m_sky_type
 The type of sky to be used for the track. More...
 
float m_sky_dx
 sky rotation speed
 
float m_sky_dy
 
std::vector< video::ITexture * > m_sky_textures
 A list of the textures for the sky to use. More...
 
std::vector< video::ITexture * > m_spherical_harmonics_textures
 
irr::video::SColor m_sky_color
 Used if m_sky_type is SKY_COLOR only.
 
std::vector< MovingTexture * > m_animated_textures
 The list of all animated textures. More...
 
TrackObjectManagerm_track_object_manager
 Manager for all track objects. More...
 
int m_sky_hori_segments
 If a sky dome is used, the number of horizontal segments the sphere should be divided in. More...
 
int m_sky_vert_segments
 If a sky dome is used, the number of vertical segments the sphere should be divided in. More...
 
float m_sky_sphere_percent
 If a sky dome is used, percentage of the sphere to be used. More...
 
float m_sky_texture_percent
 If a sky dome is used, percentage of the texture to be used. More...
 
ParticleKindm_sky_particles
 Particles emitted from the sky (wheather)
 
bool m_weather_lightning
 Use a special built-in wheather.
 
std::string m_weather_sound
 
std::vector< TrackModem_all_modes
 List of all modes for a track. More...
 
std::string m_name
 Name of the track to display. More...
 
core::stringw m_sort_name
 The name used in sorting the track. More...
 
bool m_use_fog
 True if the track uses fog. More...
 
bool m_force_disable_fog
 Can be set to force fog off (e.g. More...
 
bool m_smooth_normals
 True if this track supports using smoothed normals. More...
 
bool m_is_addon
 
float m_fog_max
 
float m_fog_start
 
float m_fog_end
 
float m_fog_height_start
 
float m_fog_height_end
 
core::vector3df m_sun_position
 
video::SColor m_ambient_color
 The current ambient color for each kart. More...
 
video::SColor m_default_ambient_color
 
video::SColor m_sun_specular_color
 
video::SColor m_sun_diffuse_color
 
video::SColor m_fog_color
 
RenderTargetm_render_target
 The render target for the mini map, which is displayed in the race gui. More...
 
float m_minimap_x_scale
 
float m_minimap_y_scale
 
bool m_clouds
 
bool m_bloom
 
float m_bloom_threshold
 
bool m_godrays
 
core::vector3df m_godrays_position
 
float m_godrays_opacity
 
video::SColor m_godrays_color
 
bool m_shadows
 
float m_displacement_speed
 
int m_physical_object_uid
 
bool m_minimap_invert_x_z
 
core::vector3df m_color_inlevel
 The levels for color correction m_color_inlevel(black, gamma, white) m_color_outlevel(black, white)
 
core::vector2df m_color_outlevel
 
std::vector< BezierCurve * > m_all_curves
 List of all bezier curves in the track - for e.g. More...
 
std::vector< std::pair< TrackObject *, TrackObject * > > m_meta_library
 
int m_default_number_of_laps
 The number of laps the track will be raced in a random GP. More...
 
int m_actual_number_of_laps
 The number of laps that is predefined in a track info dialog. More...
 

Static Private Attributes

static Trackm_current_track = NULL
 If a race is in progress, this stores the active track object. More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

The type of sky to be used for the track.

Constructor & Destructor Documentation

◆ ~Track()

Track::~Track ( )

Destructor, removes quad data structures etc.

Member Function Documentation

◆ cleanup()

void Track::cleanup ( )

Removes the physical body from the world.

Called at the end of a race.

◆ convertTrackToBullet()

void Track::convertTrackToBullet ( scene::ISceneNode *  node)

Convert the graohics track into its physics equivalents.

Parameters
meshThe mesh to convert.
nodeThe scene node.

◆ createPhysicsModel()

void Track::createPhysicsModel ( unsigned int  main_track_count)

Convert the track tree into its physics equivalents.

Parameters
main_track_countThe number of meshes that are already converted when the main track was converted. Only the additional meshes added later still need to be converted.

◆ createWater()

void Track::createWater ( const XMLNode node)
private

Creates a water node.

OBSOLETE, kept for backwards compat only

Parameters
nodeThe XML node containing the specifications for the water node.

◆ findGround()

bool Track::findGround ( AbstractKart kart)

Determines if the kart is over ground.

Used in setting the starting positions of all the karts.

Parameters
kThe kart to project downward.
Returns
True of the kart is on terrain.

◆ getAABB()

void Track::getAABB ( const Vec3 **  min,
const Vec3 **  max 
) const
inline

Sets pointer to the aabb of this track.

◆ getAngle()

float Track::getAngle ( int  n) const

Returns 'a' angle for quad n.

This angle is used to position a kart after a rescue, and to detect wrong directions. This function will always return the angle towards the first successor, i.e. the angle in the direction of the default way on the track.

Parameters
nNumber of the quad for which the angle is asked.

◆ getCameraFar()

float Track::getCameraFar ( ) const
inline

Returns the far value for cameras.

◆ getChallengeList()

const std::vector<OverworldChallenge>& Track::getChallengeList ( ) const
inline

Get list of challenges placed on that world.

Works only for overworld.

◆ getCurrentTrack()

static Track* Track::getCurrentTrack ( )
inlinestatic

Static function to get the current track.

NULL if no current track is defined (i.e. no race is active atm)

◆ getDefaultAmbientColor()

const video::SColor& Track::getDefaultAmbientColor ( ) const
inline

Returns the default ambient color.

◆ getDesigner()

const core::stringw& Track::getDesigner ( ) const
inline

Returns the name of the designer.

◆ getFilename()

const std::string& Track::getFilename ( ) const
inline

Returns the filename of this track.

◆ getGFXEffectMesh()

const TriangleMesh& Track::getGFXEffectMesh ( ) const
inline

Returns the graphical effect mesh for this track.

◆ getGroups()

const std::vector<std::string>& Track::getGroups ( ) const
inline

Returns all groups this track belongs to.

◆ getIdent()

const std::string& Track::getIdent ( ) const
inline

Returns a unique identifier for this track (the directory name).

◆ getMaxArenaPlayers()

unsigned int Track::getMaxArenaPlayers ( ) const
inline

Get the max players supported for this track, for arena only.

◆ getModeName()

const std::string& Track::getModeName ( unsigned int  i) const
inline

Returns the name of the i-th.

mode.

◆ getMusicInformation()

void Track::getMusicInformation ( std::vector< std::string > &  filenames,
std::vector< MusicInformation * > &  music 
)
private

Loads all music information for the specified files (which is taken from the track.xml file).

Parameters
filenamesList of filenames to load.
musicOn return contains the music information object for the specified files.

◆ getName()

core::stringw Track::getName ( ) const

Returns the name of the track, which is e.g.

displayed on the screen.

◆ getNumberOfModes()

unsigned int Track::getNumberOfModes ( ) const
inline

Returns the number of modes available for this track.

◆ getNumberOfStartPositions()

unsigned int Track::getNumberOfStartPositions ( ) const
inline

Get the number of start positions defined in the scene file.

◆ getNumOfCompletedChallenges()

unsigned int Track::getNumOfCompletedChallenges ( )

Returns number of completed challenges.

◆ getPtrTriangleMesh()

const TriangleMesh* Track::getPtrTriangleMesh ( ) const
inline

Returns the triangle mesh for this track.

◆ getSortName()

core::stringw Track::getSortName ( ) const

Returns the name of the track used to sort the tracks alphabetically.

This can be used to e.g. sort 'The Island' as 'Island,The'; or to replace certain language-specific characters (e.g. German 'ae' with 'a') The sort name can be specified by setting the name of a track to: "normal name|sort name"

◆ getStartTransform()

const btTransform& Track::getStartTransform ( unsigned int  index) const
inline

Returns the start coordinates for a kart with a given index.

Parameters
indexIndex of kart ranging from 0 to kart_num-1.

◆ getSunRotation()

const core::vector3df & Track::getSunRotation ( )

Returns the rotation of the sun.

◆ getTrackFile()

std::string Track::getTrackFile ( const std::string &  s) const
inline

Returns the full path of a given file inside this track directory.

◆ getTrackLength()

float Track::getTrackLength ( ) const

Returns the length of the main driveline.

◆ getTrackObjectManager()

TrackObjectManager* Track::getTrackObjectManager ( ) const
inline

Returns the track object manager.

◆ getVersion()

int Track::getVersion ( ) const
inline

Returns the version of the .track file.

◆ handleAnimatedTextures()

void Track::handleAnimatedTextures ( scene::ISceneNode *  node,
const XMLNode xml 
)

Handles animated textures.

Parameters
nodeThe scene node for which animated textures are handled.
xmlThe node containing the data for the animated notion.

◆ handleExplosion()

void Track::handleExplosion ( const Vec3 pos,
const PhysicalObject obj,
bool  secondary_hits = true 
) const

Handles an explosion, i.e.

it makes sure that all physical objects are affected accordingly.

Parameters
posPosition of the explosion.
objIf the hit was a physical object, this object will be affected more. Otherwise this is NULL.
secondary_hitsTrue if items that are not directly hit should also be affected.

◆ handleSky()

void Track::handleSky ( const XMLNode xml_node,
const std::string &  filename 
)
private

Handles a sky-dome or sky-box.

It takes the xml node with the corresponding data for the sky and stores the corresponding data in the corresponding data structures.

Parameters
xml_nodeXML node with the sky data.
filenameName of the file which is read, only used to print meaningful error messages.

◆ hasEasterEggs()

bool Track::hasEasterEggs ( ) const
inline

Returns true if this track has easter eggs.

◆ hasNavMesh()

bool Track::hasNavMesh ( ) const
inline

Returns true if this track navmesh.

◆ isArena()

bool Track::isArena ( ) const
inline

Returns true if this track has an arena mode.

◆ isAutoRescueEnabled()

bool Track::isAutoRescueEnabled ( ) const
inline

Returns true if auto rescue is enabled.

◆ isFogEnabled()

bool Track::isFogEnabled ( ) const
inline

Returns if fog is currently enabled.

It can be disabled per track, or temporary be disabled (e.g. for rendering mini map).

◆ isInGroup()

bool Track::isInGroup ( const std::string &  group_name)

Returns true if this track belongs to the specified track group.

Parameters
group_nameGroup name to test for.

◆ isInternal()

bool Track::isInternal ( ) const
inline

Whether this is an "internal" track.

If so it won't be offered in the track selection screen.

◆ isPushBackEnabled()

bool Track::isPushBackEnabled ( ) const
inline

True if push back of karts towards the track should be enabled.

◆ isRaceTrack()

bool Track::isRaceTrack ( ) const
inline

Returns true if this track is a racing track.

This means it is not an internal track (like cut scenes), arena, or soccer field.

◆ itemCommand()

void Track::itemCommand ( const XMLNode node)

Handle creation and placement of an item.

Parameters
xyzThe position of the item.
typeThe item type.
dropTrue if the item Z position should be determined based on the track topology.

◆ loadArenaGraph()

void Track::loadArenaGraph ( const XMLNode node)
private

Loads the quad graph for arena, i.e.

the definition of all quads, and the way they are connected to each other. Input file name is hardcoded for now

◆ loadDriveGraph()

void Track::loadDriveGraph ( unsigned int  mode_id,
const bool  reverse 
)
private

Loads the drive graph, i.e.

the definition of all quads, and the way they are connected to each other.

◆ loadMainTrack()

bool Track::loadMainTrack ( const XMLNode root)
private

Loads the main track model (i.e.

all other objects contained in the scene might use raycast on this track model to determine the actual height of the terrain.

◆ loadTrackModel()

void Track::loadTrackModel ( bool  reverse_track = false,
unsigned int  mode_id = 0 
)

This function load the actual scene, i.e.

all parts of the track, animations, items, ... It is called from world during initialisation. Track is the first model to be loaded, so at this stage the root scene node is empty.

Parameters
parentThe actual world.
reverse_trackTrue if the track should be run in reverse.
mode_idWhich of the modes of a track to use. This determines which scene, quad, and graph file to load.

◆ mapPoint2MiniMap()

void Track::mapPoint2MiniMap ( const Vec3 xyz,
Vec3 draw_at 
) const

Returns the 2d coordinates of a point when drawn on the mini map texture.

Parameters
xyzCoordinates of the point to map.
draw_atThe coordinates in pixel on the mini map of the point, only the first two coordinates will be used.

◆ operator<()

bool Track::operator< ( const Track other) const

A < comparison of tracks.

This is used to sort the tracks when displaying them in the gui.

◆ removeCachedData()

void Track::removeCachedData ( )

Removes all cached data structures.

This is called before the resolution is changed.

◆ reset()

void Track::reset ( )

Prepates the track for a new race.

This function must be called after all karts are created, since the check objects allocate data structures depending on the number of karts.

◆ reverseAvailable()

bool Track::reverseAvailable ( ) const
inline

Returns true if this race can be driven in reverse.

◆ setAmbientColor()

void Track::setAmbientColor ( const video::SColor &  color,
unsigned int  k 
)

Sets the current ambient color for a kart with index k.

◆ smoothNormals()

bool Track::smoothNormals ( ) const
inline

Returns true if the normals of this track can be smoothed.

◆ update()

void Track::update ( int  ticks)

Update, called once per physics time step.

Parameters
dtTimestep.

◆ updateGraphics()

void Track::updateGraphics ( float  dt)

This updates all only graphical elements.

It is only called once per rendered frame, not once per time step. float dt Time since last rame.

◆ uploadNodeVertexBuffer()

void Track::uploadNodeVertexBuffer ( scene::ISceneNode *  node)
static

Static helper function to pre-upload vertex buffer in spm.

Member Data Documentation

◆ m_aabb_max

Vec3 Track::m_aabb_max
private

Maximum coordinates of this track.

◆ m_aabb_min

Vec3 Track::m_aabb_min
private

Minimum coordinates of this track.

◆ m_actual_number_of_laps

int Track::m_actual_number_of_laps
private

The number of laps that is predefined in a track info dialog.

◆ m_all_cached_meshes

std::vector<scene::IMesh*> Track::m_all_cached_meshes
private

The list of all meshes that are loaded from disk, which means that those meshes are being cached by irrlicht, and need to be freed.

◆ m_all_cached_textures

std::vector<video::ITexture*> Track::m_all_cached_textures
private

A list of all textures loaded by the track, so that they can be removed from the cache at cleanup time.

◆ m_all_curves

std::vector<BezierCurve*> Track::m_all_curves
private

List of all bezier curves in the track - for e.g.

camera, ...

◆ m_all_modes

std::vector<TrackMode> Track::m_all_modes
private

List of all modes for a track.

◆ m_all_nodes

std::vector<scene::ISceneNode*> Track::m_all_nodes
private

The list of all nodes.

◆ m_ambient_color

video::SColor Track::m_ambient_color
private

The current ambient color for each kart.

◆ m_animated_textures

std::vector<MovingTexture*> Track::m_animated_textures
private

The list of all animated textures.

◆ m_cache_track

bool Track::m_cache_track
private

True if this track (textures and track data) should be cached.

Used for the overworld.

◆ m_camera_far

float Track::m_camera_far
private

Far value for cameras for this track.

◆ m_current_track

Track * Track::m_current_track = NULL
staticprivate

If a race is in progress, this stores the active track object.

NULL otherwise.

◆ m_default_number_of_laps

int Track::m_default_number_of_laps
private

The number of laps the track will be raced in a random GP.

m_actual_number_of_laps is initialised with this value.

◆ m_detached_cached_meshes

std::vector<scene::IMesh*> Track::m_detached_cached_meshes
private

m_all_cached_meshes assumes meshes are attached to a scene node.

This one assumes the mesh is NOT connected to any node.

◆ m_dont_load_navmesh

bool Track::m_dont_load_navmesh = false
static

Flag to avoid loading navmeshes (useful to speedup debugging: e.g.

the temple navmesh distance matric computation takes around 12 minutes(!) in debug mode to be computed.

◆ m_enable_auto_rescue

bool Track::m_enable_auto_rescue
private

If true a player kart will automatically be rescued if it is e.g.

on a side, ....

◆ m_enable_push_back

bool Track::m_enable_push_back
private

If true any collision of a kart with the track will push the kart towards the nearest driveline.

While this is (mostly) nice in tracks where a kart is pushed back towards the road, it doesn't work well on overworld, where karts have been pushed out of 'bubbles' .

◆ m_filename

std::string Track::m_filename
private

The full filename of the config (xml) file.

◆ m_force_disable_fog

bool Track::m_force_disable_fog
private

Can be set to force fog off (e.g.

for rendering minimap).

◆ m_friction

float Track::m_friction
private

Friction to be used for the track.

◆ m_gfx_effect_mesh

TriangleMesh* Track::m_gfx_effect_mesh
private

Used to collect the triangles which do not have a physical representation, but are needed for some raycast effects.

An example is a water surface: the karts ignore this (i.e. allowing the kart to drive in/partly under water), but the actual surface position is needed for the water splash effect.

◆ m_has_easter_eggs

bool Track::m_has_easter_eggs
private

True if this track has easter eggs.

◆ m_has_navmesh

bool Track::m_has_navmesh
private

True if this track has navmesh.

◆ m_internal

bool Track::m_internal
private

Whether this is an "internal" track.

If so it won't be offered in the track seelction screen

◆ m_is_arena

bool Track::m_is_arena
private

True if this track is an arena.

◆ m_is_soccer

bool Track::m_is_soccer
private

True if this track is a soccer arena.

◆ m_materials_loaded

bool Track::m_materials_loaded
private

True if the materials.xml file is already loaded.

This is used for the overworld to keep its textures loaded.

◆ m_max_arena_players

unsigned int Track::m_max_arena_players
private

Max players supported by an arena.

◆ m_name

std::string Track::m_name
private

Name of the track to display.

◆ m_object_physics_only_nodes

std::vector<scene::ISceneNode*> Track::m_object_physics_only_nodes
private

Same concept but for track objects.

stored separately due to different memory management.

◆ m_render_target

RenderTarget* Track::m_render_target
private

The render target for the mini map, which is displayed in the race gui.

◆ m_root

std::string Track::m_root
private

The base dir of all files of this track.

◆ m_sky_hori_segments

int Track::m_sky_hori_segments
private

If a sky dome is used, the number of horizontal segments the sphere should be divided in.

◆ m_sky_sphere_percent

float Track::m_sky_sphere_percent
private

If a sky dome is used, percentage of the sphere to be used.

◆ m_sky_texture_percent

float Track::m_sky_texture_percent
private

If a sky dome is used, percentage of the texture to be used.

◆ m_sky_textures

std::vector<video::ITexture*> Track::m_sky_textures
private

A list of the textures for the sky to use.

It contains one texture in case of a dome, and 6 textures for a box.

◆ m_sky_type

enum { ... } Track::m_sky_type

The type of sky to be used for the track.

◆ m_sky_vert_segments

int Track::m_sky_vert_segments
private

If a sky dome is used, the number of vertical segments the sphere should be divided in.

◆ m_smooth_normals

bool Track::m_smooth_normals
private

True if this track supports using smoothed normals.

◆ m_sort_name

core::stringw Track::m_sort_name
private

The name used in sorting the track.

◆ m_start_transforms

AlignedArray<btTransform> Track::m_start_transforms
private

Start transforms of karts (either the default, or the ones taken from the scene file).

◆ m_static_physics_only_nodes

std::vector<scene::ISceneNode*> Track::m_static_physics_only_nodes
private

The list of all nodes that are to be converted into physics, but not to be drawn (e.g.

invisible walls).

◆ m_track_mesh

TriangleMesh* Track::m_track_mesh
private

Used to collect the triangles for the bullet mesh.

◆ m_track_object_manager

TrackObjectManager* Track::m_track_object_manager
private

Manager for all track objects.

◆ m_use_fog

bool Track::m_use_fog
private

True if the track uses fog.

◆ m_version

int Track::m_version
private

The version of this track.

A certain STK version will only support certain track versions.


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