19#ifndef HEADER_TRACK_SECTOR_HPP
20#define HEADER_TRACK_SECTOR_HPP
22#include "utils/vec3.hpp"
55 Vec3 m_estimated_valid_track_coords;
57 Vec3 m_latest_valid_track_coords;
62 int m_last_triggered_checkline;
68 void update(
const Vec3 &xyz,
bool ignore_vertical =
false);
74 if (account_for_checklines && strict)
75 return m_latest_valid_track_coords.getZ();
76 else if (account_for_checklines)
77 return m_estimated_valid_track_coords.getZ();
91 void setLastTriggeredCheckline(
int i) { m_last_triggered_checkline = i; }
93 int getLastTriggeredCheckline()
const
94 {
return m_last_triggered_checkline; }
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
This object keeps track of which sector an object is on.
Definition: track_sector.hpp:39
float getRelativeDistanceToCenter() const
Returns the relative distance of the corresponding kart from the center, i.e.
Definition: track_sector.cpp:166
void rescue()
Sets current and last valid graph node to the rescue location.
Definition: track_sector.cpp:144
bool m_on_road
True if the object is on the road (driveline), or not.
Definition: track_sector.hpp:60
float getDistanceFromStart(bool account_for_checklines, bool strict=false) const
Returns how far the the object is from the start line.
Definition: track_sector.hpp:72
void saveState(BareNetworkString *buffer) const
Only basket ball is used for rewind for TrackSector so save the minimum.
Definition: track_sector.cpp:182
float getDistanceToCenter() const
Returns the distance to the centre driveline.
Definition: track_sector.hpp:83
void saveCompleteState(BareNetworkString *bns)
Save completely for spectating in linear race.
Definition: track_sector.cpp:199
void update(const Vec3 &xyz, bool ignore_vertical=false)
Updates the current graph node index, and the track coordinates for the specified point.
Definition: track_sector.cpp:54
TrackSector()
Initialises the object, and sets the current graph node to be undefined.
Definition: track_sector.cpp:34
int m_current_graph_node
The graph node the object is on.
Definition: track_sector.hpp:42
int m_last_valid_graph_node
The index of the last valid graph node.
Definition: track_sector.hpp:48
bool isOnRoad() const
Returns if this object is on the road (driveline).
Definition: track_sector.hpp:89
Vec3 m_current_track_coords
The coordinates of this object on the track, i.e.
Definition: track_sector.hpp:53
int m_estimated_valid_graph_node
The index of the estimated valid graph node.
Definition: track_sector.hpp:45
int getCurrentGraphNode() const
Returns the current graph node.
Definition: track_sector.hpp:86
Definition: track.hpp:114
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35