2 // Copyright (C) 2005 Philipp <balinor@pnxs.de>
3 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
4 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef HEADER_SUPERTUX_OBJECT_PATH_HPP
20 #define HEADER_SUPERTUX_OBJECT_PATH_HPP
24 #include "math/vector.hpp"
25 #include "util/reader_fwd.hpp"
26 #include "util/writer_fwd.hpp"
34 void read(const Reader& reader);
36 Vector get_base() const;
39 * Helper class that stores an individual node of a Path
44 Vector position; /**< the position of this node */
45 float time; /**< time (in seconds) to get from this node to next node */
53 std::vector<Node> nodes;
56 * returns Node index nearest to reference_point or -1 if not applicable
58 int get_nearest_node_no(Vector reference_point) const;
61 * returns Node index farthest from reference_point or -1 if not applicable
63 int get_farthest_node_no(Vector reference_point) const;
66 friend class PathWalker;
69 // moves from first to last path node and stops
71 // moves from first to last node then in reverse order back to first
73 // moves from last node back to the first node