19#ifndef HEADER_CHECK_STRUCTURE_HPP
20#define HEADER_CHECK_STRUCTURE_HPP
24#include "utils/aligned_array.hpp"
25#include "utils/vec3.hpp"
68 enum CheckType {CT_NEW_LAP, CT_ACTIVATE, CT_TOGGLE, CT_CANNON,
69 CT_GOAL, CT_AMBIENT_SPHERE, CT_TRIGGER};
103 enum ChangeState {CS_DEACTIVATE, CS_ACTIVATE, CS_TOGGLE};
105 void changeStatus(
const std::vector<int> &indices,
int kart_index,
106 ChangeState change_state);
111 virtual void update(
float dt);
112 virtual void resetAfterKartMove(
unsigned int kart_index) {}
113 virtual void resetAfterRewind(
unsigned int kart_index) {}
114 virtual void changeDebugColor(
bool is_active) {}
124 virtual void trigger(
unsigned int kart_index);
138 virtual bool triggeringCheckline()
const {
return false; }
148 int getIndex()
const {
return m_index; }
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Controls all checks structures of a track.
Definition: check_manager.hpp:40
Virtual base class for a check structure.
Definition: check_structure.hpp:52
virtual void update(float dt)
Updates all check structures.
Definition: check_structure.cpp:111
void changeStatus(const std::vector< int > &indices, int kart_index, ChangeState change_state)
Changes the status (active/inactive) of all check structures contained in the index list indices.
Definition: check_structure.cpp:143
virtual CheckStructure * clone()=0
Clone to child process for server usage (atm no sound or scripting).
CheckStructure()
For CheckTrigger or CheckCylinder.
Definition: check_structure.cpp:78
CheckType
Different types of check structures: ACTIVATE: Activates another check structure (independent of the ...
Definition: check_structure.hpp:68
CheckType getType() const
Returns the type of this check structure.
Definition: check_structure.hpp:129
virtual void reset(const Track &track)
Initialises the 'previous positions' of all karts with the start position defined for this track.
Definition: check_structure.cpp:91
virtual void trigger(unsigned int kart_index)
Is called when this check structure is triggered.
Definition: check_structure.cpp:220
AlignedArray< Vec3 > m_previous_position
Stores the previous position of all karts.
Definition: check_structure.hpp:75
virtual bool isTriggered(const Vec3 &old_pos, const Vec3 &new_pos, int indx)=0
True if going from old_pos to new_pos crosses this checkline.
void addSuccessor(unsigned int i)
Adds the index of a successor check structure which will get triggered by this check structure.
Definition: check_structure.hpp:133
std::vector< int > m_check_structures_to_change_state
Contains the indices of the corresponding check structures that get their state changed (activated or...
Definition: check_structure.hpp:94
std::vector< int > m_same_group
A list of check lines that should be activated/switched when this lines is activated/switched.
Definition: check_structure.hpp:101
std::vector< bool > m_is_active
Stores if this check structure is active (for a given kart).
Definition: check_structure.hpp:77
CheckType m_check_type
The type of this checkline.
Definition: check_structure.hpp:90
unsigned int m_index
Stores the index of this check structure.
Definition: check_structure.hpp:84
bool m_active_at_reset
True if this check structure should be activated at a reset.
Definition: check_structure.hpp:80
Definition: track.hpp:114
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