class PathWalker
{
public:
- PathWalker(const Path* path);
+ PathWalker(const Path* path, bool running = true);
virtual ~PathWalker();
/**
*/
virtual Vector advance(float elapsed_time);
+ /** advance until at given node, then stop */
+ void goto_node(int node_no);
+
+ /** start advancing automatically */
+ void start_moving();
+
+ /** stop advancing automatically */
+ void stop_moving();
+
const Path* path;
private:
void advance_node();
void goback_node();
-
+
+ /**
+ * set to false to immediately stop advancing
+ */
+ bool running;
+
size_t current_node_nr;
size_t next_node_nr;
- Vector last_pos;
+ /**
+ * stop advancing automatically when this node is reached
+ */
+ int stop_at_node_nr;
/**
* the position between the current node and the next node as fraction