17 #ifndef HEADER_SUPERTUX_OBJECT_PATH_WALKER_HPP 18 #define HEADER_SUPERTUX_OBJECT_PATH_WALKER_HPP 23 #include "math/sizef.hpp" 24 #include "object/path.hpp" 25 #include "util/uid.hpp" 39 Vector get_pos(
const Sizef& size,
const Vector& pos)
const;
54 Vector get_pos(
const Sizef& object_size,
const Handle& handle)
const;
60 void jump_to_node(
int node_idx,
bool instantaneous =
false);
74 Path* get_path()
const;
83 size_t m_current_node_nr;
84 size_t m_next_node_nr;
87 int m_stop_at_node_nr;
94 float m_walking_speed;
A walker that travels along a path.
Definition: path_walker.hpp:31
bool m_running
set to false to immediately stop advancing
Definition: path_walker.hpp:80
Definition: object_option.hpp:77
Helper class that allows to displace a handle on an object.
Definition: path_walker.hpp:35
void start_moving()
start advancing automatically
Definition: path_walker.cpp:170
void jump_to_node(int node_idx, bool instantaneous=false)
teleport instantly to given node
Definition: path_walker.cpp:150
Vector m_pixel_offset
The secondary displacement, in absolute size (pixels)
Definition: path_walker.hpp:43
bool is_running() const
returns true if PathWalker is currently moving
Definition: path_walker.hpp:69
void goto_node(int node_idx)
advance until at given node, then stop
Definition: path_walker.cpp:139
void stop_moving()
stop advancing automatically
Definition: path_walker.cpp:177
void update(float dt_sec)
advances the path walker on the path and returns its new position
Definition: path_walker.cpp:77
Vector m_scalar_pos
The scale of the object the handle should be displaced to ((0,0) = top left, (1,1) = bottom right) ...
Definition: path_walker.hpp:42