SuperTuxKart
track.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 //
3 // Copyright (C) 2004-2015 Steve Baker <sjbaker1@airmail.net>
4 // Copyright (C) 2009-2015 Joerg Henrichs, Steve Baker
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 3
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 #ifndef HEADER_TRACK_HPP
21 #define HEADER_TRACK_HPP
22 
29 #include <algorithm>
30 #include <array>
31 #include <atomic>
32 #include <memory>
33 #include <string>
34 #include <vector>
35 
36 #include <irrString.h>
37 #include <rect.h>
38 #include <SColor.h>
39 
40 namespace irr
41 {
42  namespace scene
43  {
44  class IMesh; class ISceneNode;
45  }
46  namespace video
47  {
48  class IImage; class ITexture;
49  }
50 }
51 
52 using namespace irr;
53 
54 #include "LinearMath/btTransform.h"
55 
56 #include "utils/aligned_array.hpp"
57 #include "utils/log.hpp"
58 #include "utils/random_generator.hpp"
59 #include "utils/vec3.hpp"
60 #include "utils/stk_process.hpp"
61 
62 class AbstractKart;
63 class AnimationManager;
64 class BezierCurve;
65 class CheckManager;
66 class ItemManager;
68 class MovingTexture;
69 class MusicInformation;
70 class ParticleKind;
71 class PhysicalObject;
72 class RenderTarget;
73 class TrackObject;
74 class TrackObjectManager;
75 class TriangleMesh;
76 class XMLNode;
77 
78 const int HEIGHT_MAP_RESOLUTION = 256;
79 
80 // TODO: eventually remove this and fully replace with scripting
82 {
83 public:
84  core::vector3df m_position;
85  std::string m_challenge_id;
86 
87  OverworldChallenge(core::vector3df position, std::string challenge_id)
88  {
89  m_position = position;
90  m_challenge_id = challenge_id;
91  }
92 };
93 
94 
95 struct Subtitle
96 {
97  int m_from, m_to;
98  core::stringw m_text;
99 
100  Subtitle(int from, int to, core::stringw text)
101  {
102  m_from = from;
103  m_to = to;
104  m_text = text;
105  }
106  int getFrom() const { return m_from; }
107  int getTo() const { return m_to; }
108  const core::stringw& getText() const { return m_text; }
109 };
110 
114 class Track
115 {
116 private:
117 
120  static std::atomic<Track*> m_current_track[PT_COUNT];
121 
122 #ifdef DEBUG
123  unsigned int m_magic_number;
124 #endif
125 
126  /* Gravity to be used for this track. */
127  float m_gravity;
128 
130  float m_friction;
131 
132  std::string m_ident;
133  std::string m_screenshot;
134  bool m_is_day;
135  std::vector<MusicInformation*> m_music;
136  unsigned m_music_idx;
137 
139  std::vector<OverworldChallenge> m_challenges;
140 
141  std::vector<Subtitle> m_subtitles;
142 
145  AlignedArray<btTransform> m_start_transforms;
146 
147  std::string m_item_style;
148  std::string m_description;
149  core::stringw m_designer;
150 
151  /* For running the startup script */
152  bool m_startup_run;
154  std::string m_filename;
155 
157  std::string m_root;
158  std::vector<std::string> m_groups;
159 
161  std::vector<scene::ISceneNode*> m_all_nodes;
162 
165  std::vector<scene::ISceneNode*> m_static_physics_only_nodes;
166 
170  std::vector<scene::ISceneNode*> m_object_physics_only_nodes;
171 
174  std::vector<scene::IMesh*> m_all_cached_meshes;
175 
180  std::vector<scene::IMesh*> m_detached_cached_meshes;
181 
184  std::vector<video::ITexture*> m_all_cached_textures;
185 
189 
193 
194 
195 #ifdef DEBUG
200  std::vector<video::ITexture*> m_old_textures;
201 
206  std::vector<std::string> m_old_mesh_buffers;
207 #endif
208 
209  scene::ISceneNode *m_sun;
225  btTransform m_red_flag;
226  btTransform m_blue_flag;
229  bool m_is_ctf;
231  unsigned int m_max_arena_players;
238 
239  bool m_is_cutscene;
240 
244 
247 
252 
255 
259 
265 
267  enum {SKY_NONE, SKY_BOX,
268  SKY_COLOR} m_sky_type;
269 
271  float m_sky_dx, m_sky_dy;
272 
275  std::vector<void*> m_sky_textures;
276 
277  std::vector<void*> m_spherical_harmonics_textures;
278 
280  irr::video::SColor m_sky_color;
281 
283  std::vector<MovingTexture*> m_animated_textures;
284 
287 
291 
295 
298 
301 
304 
307  std::string m_weather_sound;
308 
310  class TrackMode
311  {
312  public:
313  std::string m_name;
314  std::string m_quad_name;
315  std::string m_graph_name;
316  std::string m_scene;
318 #ifdef DEBUG
319  unsigned int m_magic_number;
320 #endif
321 
323  TrackMode() : m_name("default"), m_quad_name("quads.xml"),
324  m_graph_name("graph.xml"), m_scene("scene.xml")
325  {
326 #ifdef DEBUG
327  m_magic_number = 0x46825179;
328 #endif
329  }
330 
331  ~TrackMode()
332  {
333 #ifdef DEBUG
334  assert(m_magic_number == 0x46825179);
335  m_magic_number = 0xDEADBEEF;
336 #endif
337  }
338 
339  }; // TrackMode
340 
342  std::vector<TrackMode> m_all_modes;
343 
345  std::string m_name;
346 
348  core::stringw m_sort_name;
349 
351  bool m_use_fog;
352 
355 
358 
359  bool m_is_addon;
360 
361  float m_fog_max;
362  float m_fog_start;
363  float m_fog_end;
364  float m_fog_height_start;
365  float m_fog_height_end;
366  core::vector3df m_sun_position;
368  video::SColor m_ambient_color;
369  video::SColor m_default_ambient_color;
370  video::SColor m_sun_specular_color;
371  video::SColor m_sun_diffuse_color;
372  video::SColor m_fog_color;
373 
376  CheckManager* m_check_manager;
377  std::shared_ptr<ItemManager> m_item_manager;
378  float m_minimap_x_scale;
379  float m_minimap_y_scale;
380 
381  bool m_bloom;
382  float m_bloom_threshold;
383 
384  bool m_godrays;
385  core::vector3df m_godrays_position;
386  float m_godrays_opacity;
387  video::SColor m_godrays_color;
388 
389  bool m_shadows;
390 
391  float m_displacement_speed;
392  int m_physical_object_uid;
393 
394  bool m_minimap_invert_x_z;
395 
399  core::vector3df m_color_inlevel;
400  core::vector2df m_color_outlevel;
401 
403  std::vector<BezierCurve*> m_all_curves;
404 
405  std::vector<std::pair<TrackObject*, TrackObject*> > m_meta_library;
406 
410 
413 
414  void loadTrackInfo();
415  void loadDriveGraph(unsigned int mode_id, const bool reverse);
416  void loadArenaGraph(const XMLNode &node);
417  btQuaternion getArenaStartRotation(const Vec3& xyz, float heading);
418  bool loadMainTrack(const XMLNode &node);
419  void loadMinimap();
420  void createWater(const XMLNode &node);
421  void getMusicInformation(std::vector<std::string>& filenames,
422  std::vector<MusicInformation*>& m_music );
423  void loadCurves(const XMLNode &node);
424  void handleSky(const XMLNode &root, const std::string &filename);
425  void freeCachedMeshVertexBuffer();
426  void copyFromMainProcess();
427  video::IImage* getSkyTexture(std::string path) const;
428  scene::IMesh* getClonedMesh(const std::string& filename) const;
429 public:
430 
434  {
435  ProcessType type = STKProcess::getType();
436  return m_current_track[type];
437  }
438  // ------------------------------------------------------------------------
439  Track* clone()
440  {
441  Track* child_track = new Track(*this);
442  child_track->copyFromMainProcess();
443  return child_track;
444  }
445  // ------------------------------------------------------------------------
446  void initChildTrack();
447  // ------------------------------------------------------------------------
448  static void cleanChildTrack();
449  // ------------------------------------------------------------------------
450  void handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml);
451 
455  static bool m_dont_load_navmesh;
456 
458  static void uploadNodeVertexBuffer(scene::ISceneNode *node);
459 
460  static const float NOHIT;
461 
462  Track (const std::string &filename);
463  ~Track ();
464  void cleanup ();
465  void removeCachedData ();
466  void startMusic () const;
467 
468  void createPhysicsModel(unsigned int main_track_count,
469  bool for_height_map);
470  void updateGraphics(float dt);
471  void update(int ticks);
472  void reset();
473  void itemCommand(const XMLNode *node);
474  Vec3 flagCommand(const XMLNode *node);
475  //-----------------------------------------------------------------------------
476  core::stringw getName() const;
477  //-----------------------------------------------------------------------------
478  core::stringw getSortName() const;
479  bool isInGroup(const std::string &group_name);
480  const core::vector3df& getSunRotation();
482  void setAmbientColor(const video::SColor &color,
483  unsigned int k);
484  void handleExplosion(const Vec3 &pos,
485  const PhysicalObject *mp,
486  bool secondary_hits=true) const;
487  void loadTrackModel (bool reverse_track = false,
488  unsigned int mode_id=0);
489  bool findGround(AbstractKart *kart);
490 
491  std::vector< std::vector<float> > buildHeightMap();
492  void drawMiniMap(const core::rect<s32>& dest_rect) const;
493  void updateMiniMapScale();
494  // ------------------------------------------------------------------------
496  bool isArena() const { return m_is_arena; }
497  // ------------------------------------------------------------------------
498  bool isCTF() const { return m_is_ctf; }
499  // ------------------------------------------------------------------------
502  bool isRaceTrack() const
503  {
504  return !m_internal && !m_is_arena && !m_is_soccer;
505  } // isRaceTrack
506  // ------------------------------------------------------------------------
508  bool hasEasterEggs() const { return m_has_easter_eggs; }
509  // ------------------------------------------------------------------------
511  bool reverseAvailable() const { return m_reverse_available; }
512  // ------------------------------------------------------------------------
514  bool hasNavMesh() const { return m_has_navmesh; }
515  // ------------------------------------------------------------------------
516  void loadObjects(const XMLNode* root, const std::string& path,
517  ModelDefinitionLoader& lod_loader, bool create_lod_definitions,
518  scene::ISceneNode* parent, TrackObject* parent_library);
519  // ------------------------------------------------------------------------
520  bool isSoccer () const { return m_is_soccer; }
521  // ------------------------------------------------------------------------
522  void addMusic (MusicInformation* mi)
523  {m_music.push_back(mi); }
524  // ------------------------------------------------------------------------
525  float getGravity () const {return m_gravity; }
526  // ------------------------------------------------------------------------
528  int getVersion () const {return m_version; }
529  // ------------------------------------------------------------------------
531  float getTrackLength () const;
532  // ------------------------------------------------------------------------
534  const std::string& getIdent () const {return m_ident; }
535  // ------------------------------------------------------------------------
537  const std::vector<std::string>&
538  getGroups () const {return m_groups; }
539  // ------------------------------------------------------------------------
541  const std::string& getFilename () const {return m_filename; }
542  // ------------------------------------------------------------------------
544  const core::stringw& getDesigner () const {return m_designer; }
545  // ------------------------------------------------------------------------
547  const std::string& getScreenshotFile () const {return m_screenshot; }
548  // ------------------------------------------------------------------------
550  const bool getIsDuringDay () const {return m_is_day; }
551  // ------------------------------------------------------------------------
553  const bool getMinimapInvert () const {return m_minimap_invert_x_z; }
554  // ------------------------------------------------------------------------
557  const btTransform& getStartTransform (unsigned int index) const
558  {
559  if (index >= m_start_transforms.size())
560  Log::fatal("Track", "No start position for kart %i.", index);
561  return m_start_transforms[index];
562  }
563  // ------------------------------------------------------------------------
567  {
568  std::shuffle(m_start_transforms.begin(), m_start_transforms.end(),
570  }
571  // ------------------------------------------------------------------------
573  void getAABB(const Vec3 **min, const Vec3 **max) const
574  { *min = &m_aabb_min; *max = &m_aabb_max; }
575  // ------------------------------------------------------------------------
582  float getAngle(int n) const;
583  // ------------------------------------------------------------------------
590  void mapPoint2MiniMap(const Vec3 &xyz, Vec3 *draw_at) const;
591  // ------------------------------------------------------------------------
593  std::string getTrackFile(const std::string &s) const
594  { return m_root+"/"+s; }
595  // ------------------------------------------------------------------------
597  unsigned int getNumberOfModes() const { return (unsigned int) m_all_modes.size(); }
598  // ------------------------------------------------------------------------
600  unsigned int getNumOfCompletedChallenges();
601  // ------------------------------------------------------------------------
603  const std::string &getModeName(unsigned int i) const
604  { return m_all_modes[i].m_name; }
605  // ------------------------------------------------------------------------
607  const video::SColor &getDefaultAmbientColor() const
608  { return m_default_ambient_color; }
609  // ------------------------------------------------------------------------
611  float getCameraFar() const { return m_camera_far; }
612  // ------------------------------------------------------------------------
614  const TriangleMesh *getPtrTriangleMesh() const { return m_track_mesh; }
615  const TriangleMesh& getTriangleMesh() const {return *m_track_mesh; }
616  // ------------------------------------------------------------------------
618  const TriangleMesh& getGFXEffectMesh() const {return *m_gfx_effect_mesh;}
619  // ------------------------------------------------------------------------
621  unsigned int getMaxArenaPlayers() const
622  { return m_max_arena_players; }
623  // ------------------------------------------------------------------------
625  unsigned int getNumberOfStartPositions() const
626  { return (unsigned int)m_start_transforms.size(); }
627  // ------------------------------------------------------------------------
628  bool getWeatherLightning() {return m_weather_lightning;}
629  // ------------------------------------------------------------------------
630  const std::string& getWeatherSound() {return m_weather_sound;}
631  // ------------------------------------------------------------------------
632  ParticleKind* getSkyParticles () { return m_sky_particles; }
633  // ------------------------------------------------------------------------
635  void forceFogDisabled(bool v) { m_force_disable_fog = v; }
636  //-------------------------------------------------------------------------
639  bool isFogEnabled() const
640  {
641  return !m_force_disable_fog && m_use_fog;
642  } // isFogEnabled
643 
644  // ------------------------------------------------------------------------
645  float getFogStart() const { return m_fog_start; }
646  // ------------------------------------------------------------------------
647  void setFogStart(float start) { m_fog_start = start; }
648  // ------------------------------------------------------------------------
649  float getFogEnd() const { return m_fog_end; }
650  // ------------------------------------------------------------------------
651  void setFogEnd(float end) { m_fog_end = end; }
652  // ------------------------------------------------------------------------
653  float getFogStartHeight() const { return m_fog_height_start; }
654  // ------------------------------------------------------------------------
655  float getFogEndHeight() const { return m_fog_height_end; }
656  // ------------------------------------------------------------------------
657  float getFogMax() const { return m_fog_max; }
658  // ------------------------------------------------------------------------
659  void setFogMax(float max) { m_fog_max = max; }
660  // ------------------------------------------------------------------------
661  video::SColor getFogColor() const { return m_fog_color; }
662  // ------------------------------------------------------------------------
663  void setFogColor(video::SColor& color) { m_fog_color = color; }
664  // ------------------------------------------------------------------------
665  video::SColor getSunColor() const { return m_sun_diffuse_color; }
666  // ------------------------------------------------------------------------
669  bool isInternal() const { return m_internal; }
670  // ------------------------------------------------------------------------
672  bool isAutoRescueEnabled() const { return m_enable_auto_rescue; }
673  // ------------------------------------------------------------------------
675  bool isPushBackEnabled() const { return m_enable_push_back; }
676  // ------------------------------------------------------------------------
678  bool smoothNormals() const { return m_smooth_normals; }
679  // ------------------------------------------------------------------------
682  {
683  return m_track_object_manager;
684  } // getTrackObjectManager
685 
686  // ------------------------------------------------------------------------
688  const std::vector<OverworldChallenge>& getChallengeList() const
689  { return m_challenges; }
690 
691  // ------------------------------------------------------------------------
692  const std::vector<Subtitle>& getSubtitles() const { return m_subtitles; }
693 
694  // ------------------------------------------------------------------------
695  bool hasBloom() const { return m_bloom; }
696 
697  // ------------------------------------------------------------------------
698  float getBloomThreshold() const { return m_bloom_threshold; }
699 
700  // ------------------------------------------------------------------------
702  core::vector3df getColorLevelIn() const { return m_color_inlevel; }
703  // ------------------------------------------------------------------------
704  core::vector2df getColorLevelOut() const { return m_color_outlevel; }
705  // ------------------------------------------------------------------------
706  bool hasGodRays() const { return m_godrays; }
707  // ------------------------------------------------------------------------
708  core::vector3df getGodRaysPosition() const { return m_godrays_position; }
709  // ------------------------------------------------------------------------
710  float getGodRaysOpacity() const { return m_godrays_opacity; }
711  // ------------------------------------------------------------------------
712  video::SColor getGodRaysColor() const { return m_godrays_color; }
713  // ------------------------------------------------------------------------
714  bool hasShadows() const { return m_shadows; }
715  // ------------------------------------------------------------------------
716  void addNode(scene::ISceneNode* node) { m_all_nodes.push_back(node); }
717  // ------------------------------------------------------------------------
718  void addPhysicsOnlyNode(scene::ISceneNode* node)
719  {
720  m_object_physics_only_nodes.push_back(node);
721  }
722  // ------------------------------------------------------------------------
723  float getDisplacementSpeed() const { return m_displacement_speed; }
724  // ------------------------------------------------------------------------
725  int getPhysicalObjectUID() { return m_physical_object_uid++; }
726  // ------------------------------------------------------------------------
727  const int getDefaultNumberOfLaps() const { return m_default_number_of_laps;}
728  // ------------------------------------------------------------------------
729  const int getActualNumberOfLap() const { return m_actual_number_of_laps; }
730  // ------------------------------------------------------------------------
731  void setActualNumberOfLaps(unsigned int laps)
732  { m_actual_number_of_laps = laps; }
733  // ------------------------------------------------------------------------
734  bool operator<(const Track &other) const;
735  // ------------------------------------------------------------------------
737  void addCachedMesh(scene::IMesh* mesh) { m_all_cached_meshes.push_back(mesh); }
738  // ------------------------------------------------------------------------
740  void addMetaLibrary(TrackObject* parent, TrackObject* meta_library)
741  { m_meta_library.emplace_back(parent, meta_library); }
742  // ------------------------------------------------------------------------
743  const btTransform& getRedFlag() const { return m_red_flag; }
744  // ------------------------------------------------------------------------
745  const btTransform& getBlueFlag() const { return m_blue_flag; }
746  // ------------------------------------------------------------------------
747  bool isAddon() const { return m_is_addon; }
748  // ------------------------------------------------------------------------
749  void convertTrackToBullet(scene::ISceneNode *node,
750  std::vector<std::array<btVector3, 3> >* occluder = NULL);
751  // ------------------------------------------------------------------------
752  CheckManager* getCheckManager() const { return m_check_manager; }
753  // ------------------------------------------------------------------------
754  ItemManager* getItemManager() const { return m_item_manager.get(); }
755  // ------------------------------------------------------------------------
756  bool isOnGround(const Vec3& xyz, const Vec3& down, Vec3* hit_point,
757  Vec3* normal, bool print_warning = true);
758  // ------------------------------------------------------------------------
759  MusicInformation* getTrackMusic() const
760  {
761  if (m_music_idx < m_music.size())
762  return m_music[m_music_idx];
763  return NULL;
764  }
765 }; // class Track
766 
767 #endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
A class to manage bezier curves and interpolation.
Definition: bezier_curve.hpp:34
Controls all checks structures of a track.
Definition: check_manager.hpp:40
Definition: item_manager.hpp:47
Utility class to load level-of-detail nodes and library nodes.
Definition: model_definition_loader.hpp:81
Handles animated textures (textures that move)
Definition: moving_texture.hpp:34
Wrapper around an instance of the Music interface Adds information like composer, song title,...
Definition: music_information.hpp:43
type of particles
Definition: particle_kind.hpp:42
Definition: physical_object.hpp:40
static std::mt19937 & getGenerator()
Return a reference to the thread-local generator.
Definition: random_generator.cpp:25
Definition: render_target.hpp:42
Definition: track_object_manager.hpp:39
This is a base object for any separate object on the track, which might also have a skeletal animatio...
Definition: track_object.hpp:56
A simple class to keep information about a track mode.
Definition: track.hpp:311
std::string m_quad_name
Name of the quad file to use.
Definition: track.hpp:314
std::string m_graph_name
Name of the graph file to use.
Definition: track.hpp:315
TrackMode()
Default constructor, sets default names for all fields.
Definition: track.hpp:323
std::string m_scene
Name of the scene file to use.
Definition: track.hpp:316
std::string m_name
Name / description of this mode.
Definition: track.hpp:313
Definition: track.hpp:115
int getVersion() const
Returns the version of the .track file.
Definition: track.hpp:528
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 i...
Definition: track.hpp:174
std::vector< BezierCurve * > m_all_curves
List of all bezier curves in the track - for e.g.
Definition: track.hpp:403
irr::video::SColor m_sky_color
Used if m_sky_type is SKY_COLOR only.
Definition: track.hpp:280
const core::stringw & getDesigner() const
Returns the name of the designer.
Definition: track.hpp:544
void setAmbientColor(const video::SColor &color, unsigned int k)
Sets the current ambient color for a kart with index k.
RenderTarget * m_render_target
The render target for the mini map, which is displayed in the race gui.
Definition: track.hpp:375
TriangleMesh * m_gfx_effect_mesh
Used to collect the triangles which do not have a physical representation, but are needed for some ra...
Definition: track.hpp:220
void getAABB(const Vec3 **min, const Vec3 **max) const
Sets pointer to the aabb of this track.
Definition: track.hpp:573
void shuffleStartTransforms()
Shuffles the start transformations.
Definition: track.hpp:566
TrackObjectManager * m_track_object_manager
Manager for all track objects.
Definition: track.hpp:286
int m_actual_number_of_laps
The number of laps that is predefined in a track info dialog.
Definition: track.hpp:412
unsigned int m_max_arena_players
Max players supported by an arena.
Definition: track.hpp:231
static Track * getCurrentTrack()
Static function to get the current track.
Definition: track.hpp:433
const TriangleMesh * getPtrTriangleMesh() const
Returns the triangle mesh for this track.
Definition: track.hpp:614
float m_sky_sphere_percent
If a sky dome is used, percentage of the sphere to be used.
Definition: track.hpp:297
bool reverseAvailable() const
Returns true if this race can be driven in reverse.
Definition: track.hpp:511
static bool m_dont_load_navmesh
Flag to avoid loading navmeshes (useful to speedup debugging: e.g.
Definition: track.hpp:455
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....
Definition: track.hpp:165
std::string getTrackFile(const std::string &s) const
Returns the full path of a given file inside this track directory.
Definition: track.hpp:593
void addMetaLibrary(TrackObject *parent, TrackObject *meta_library)
Adds the parent of the meta library for correction later.
Definition: track.hpp:740
bool m_force_disable_fog
Can be set to force fog off (e.g.
Definition: track.hpp:354
unsigned int getNumberOfStartPositions() const
Get the number of start positions defined in the scene file.
Definition: track.hpp:625
unsigned int getNumberOfModes() const
Returns the number of modes available for this track.
Definition: track.hpp:597
bool m_smooth_normals
True if this track supports using smoothed normals.
Definition: track.hpp:357
bool isPushBackEnabled() const
True if push back of karts towards the track should be enabled.
Definition: track.hpp:675
core::vector3df m_color_inlevel
The levels for color correction m_color_inlevel(black, gamma, white) m_color_outlevel(black,...
Definition: track.hpp:399
void forceFogDisabled(bool v)
Override track fog value to force disabled.
Definition: track.hpp:635
std::vector< MovingTexture * > m_animated_textures
The list of all animated textures.
Definition: track.hpp:283
bool smoothNormals() const
Returns true if the normals of this track can be smoothed.
Definition: track.hpp:678
bool m_cache_track
True if this track (textures and track data) should be cached.
Definition: track.hpp:192
Vec3 m_aabb_min
Minimum coordinates of this track.
Definition: track.hpp:222
bool isInternal() const
Whether this is an "internal" track.
Definition: track.hpp:669
int m_sky_vert_segments
If a sky dome is used, the number of vertical segments the sphere should be divided in.
Definition: track.hpp:294
bool m_enable_push_back
If true any collision of a kart with the track will push the kart towards the nearest driveline.
Definition: track.hpp:264
const video::SColor & getDefaultAmbientColor() const
Returns the default ambient color.
Definition: track.hpp:607
std::vector< TrackMode > m_all_modes
List of all modes for a track.
Definition: track.hpp:342
const bool getIsDuringDay() const
Returns if the track is during day time.
Definition: track.hpp:550
std::vector< scene::ISceneNode * > m_object_physics_only_nodes
Same concept but for track objects.
Definition: track.hpp:170
AlignedArray< btTransform > m_start_transforms
Start transforms of karts (either the default, or the ones taken from the scene file).
Definition: track.hpp:145
const TriangleMesh & getGFXEffectMesh() const
Returns the graphical effect mesh for this track.
Definition: track.hpp:618
TriangleMesh * m_track_mesh
Used to collect the triangles for the bullet mesh.
Definition: track.hpp:211
std::vector< void * > m_sky_textures
A list of the textures for the sky to use.
Definition: track.hpp:275
bool m_reverse_available
Whether this track should be available in reverse version.
Definition: track.hpp:254
float m_sky_dx
sky rotation speed
Definition: track.hpp:271
bool m_enable_auto_rescue
If true a player kart will automatically be rescued if it is e.g.
Definition: track.hpp:258
bool m_has_easter_eggs
True if this track has easter eggs.
Definition: track.hpp:233
core::stringw m_sort_name
The name used in sorting the track.
Definition: track.hpp:348
const std::string & getModeName(unsigned int i) const
Returns the name of the i-th.
Definition: track.hpp:603
const std::string & getScreenshotFile() const
Returns an absolute path to the screenshot file of this track.
Definition: track.hpp:547
const btTransform & getStartTransform(unsigned int index) const
Returns the start coordinates for a kart with a given index.
Definition: track.hpp:557
bool isRaceTrack() const
Returns true if this track is a racing track.
Definition: track.hpp:502
bool m_materials_loaded
True if the materials.xml file is already loaded.
Definition: track.hpp:188
ParticleKind * m_sky_particles
Particles emitted from the sky (wheather)
Definition: track.hpp:303
bool m_use_fog
True if the track uses fog.
Definition: track.hpp:351
bool m_internal
Whether this is an "internal" track.
Definition: track.hpp:251
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 tim...
Definition: track.hpp:184
std::vector< scene::ISceneNode * > m_all_nodes
The list of all nodes.
Definition: track.hpp:161
const std::string & getIdent() const
Returns a unique identifier for this track (the directory name).
Definition: track.hpp:534
int m_default_number_of_laps
The number of laps the track will be raced in a random GP.
Definition: track.hpp:409
bool isArena() const
Returns true if this track has an arena mode.
Definition: track.hpp:496
bool isFogEnabled() const
Returns if fog is currently enabled.
Definition: track.hpp:639
const std::vector< std::string > & getGroups() const
Returns all groups this track belongs to.
Definition: track.hpp:538
bool m_weather_lightning
Use a special built-in wheather.
Definition: track.hpp:306
const bool getMinimapInvert() const
Returns if invert minimap.
Definition: track.hpp:553
bool m_is_soccer
True if this track is a soccer arena.
Definition: track.hpp:237
std::string m_name
Name of the track to display.
Definition: track.hpp:345
const std::vector< OverworldChallenge > & getChallengeList() const
Get list of challenges placed on that world.
Definition: track.hpp:688
float m_sky_texture_percent
If a sky dome is used, percentage of the texture to be used.
Definition: track.hpp:300
core::vector3df getColorLevelIn() const
Return the color levels for color correction shader.
Definition: track.hpp:702
unsigned int getMaxArenaPlayers() const
Get the max players supported for this track, for arena only.
Definition: track.hpp:621
bool isAutoRescueEnabled() const
Returns true if auto rescue is enabled.
Definition: track.hpp:672
float getCameraFar() const
Returns the far value for cameras.
Definition: track.hpp:611
float m_friction
Friction to be used for the track.
Definition: track.hpp:130
int m_sky_hori_segments
If a sky dome is used, the number of horizontal segments the sphere should be divided in.
Definition: track.hpp:290
std::vector< OverworldChallenge > m_challenges
Will only be used on overworld.
Definition: track.hpp:139
void addCachedMesh(scene::IMesh *mesh)
Adds mesh to cleanup list.
Definition: track.hpp:737
float m_camera_far
Far value for cameras for this track.
Definition: track.hpp:246
std::string m_root
The base dir of all files of this track.
Definition: track.hpp:157
TriangleMesh * m_height_map_mesh
Used to collect the triangles for the height map mesh used for particle rendering.
Definition: track.hpp:214
bool hasNavMesh() const
Returns true if this track navmesh.
Definition: track.hpp:514
bool m_is_arena
True if this track is an arena.
Definition: track.hpp:228
TrackObjectManager * getTrackObjectManager() const
Returns the track object manager.
Definition: track.hpp:681
int m_version
The version of this track.
Definition: track.hpp:243
bool m_has_navmesh
True if this track has navmesh.
Definition: track.hpp:235
const std::string & getFilename() const
Returns the filename of this track.
Definition: track.hpp:541
Vec3 m_aabb_max
Maximum coordinates of this track.
Definition: track.hpp:224
video::SColor m_ambient_color
The current ambient color for each kart.
Definition: track.hpp:368
std::vector< scene::IMesh * > m_detached_cached_meshes
m_all_cached_meshes assumes meshes are attached to a scene node.
Definition: track.hpp:180
bool hasEasterEggs() const
Returns true if this track has easter eggs.
Definition: track.hpp:508
std::string m_filename
The full filename of the config (xml) file.
Definition: track.hpp:154
A special class to store a triangle mesh with a separate material per triangle.
Definition: triangle_mesh.hpp:35
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48
Definition: track.hpp:82
Definition: track.hpp:96