19 #ifndef HEADER_SUPERTUX_OBJECT_PATH_HPP 20 #define HEADER_SUPERTUX_OBJECT_PATH_HPP 26 #include "math/vector.hpp" 27 #include "math/easing.hpp" 28 #include "util/gettext.hpp" 45 WalkMode string_to_walk_mode(
const std::string& mode_string);
46 std::string walk_mode_to_string(WalkMode walk_mode);
70 bezier_before(0.0f, 0.0f),
71 bezier_after(0.0f, 0.0f),
77 Path& get_parent()
const {
return *parent; }
87 Vector get_base()
const;
90 int get_nearest_node_idx(
const Vector& reference_point)
const;
93 int get_farthest_node_idx(
const Vector& reference_point)
const;
96 void move_by(
const Vector& shift);
102 bool is_valid()
const;
104 const std::vector<Node>& get_nodes()
const {
return m_nodes; }
106 PathGameObject& get_gameobject()
const {
return m_parent_gameobject; }
112 std::vector<Node> m_nodes;
120 void on_flip(
float height);
124 Path& operator=(
const Path&) =
delete;
Vector bezier_after
the position of the bezier handle towards the following node
Definition: path.hpp:60
Definition: object_option.hpp:77
float speed
speed (in px/seconds); editor use only
Definition: path.hpp:62
Vector bezier_before
the position of the bezier handle towards the preceding node
Definition: path.hpp:59
EasingMode easing
speed variations during travel (constant speed, start slow and go progressively quicker, etc.)
Definition: path.hpp:63
Helper class that stores an individual node of a Path.
Definition: path.hpp:52
bool m_adapt_speed
Whether or not to adapt the speed to bezier curves, cancelling the code that forces traveling bezier ...
Definition: path.hpp:116
Definition: reader_mapping.hpp:32
Vector position
the position of this node
Definition: path.hpp:58
Definition: path_gameobject.hpp:32
Definition: writer.cpp:23
float time
time (in seconds) to get from this node to next node
Definition: path.hpp:61