00001 00005 /* Copyright © 2009 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 00012 #include "MoveNodeDelta.h" 00013 #include "../Track.h" 00014 00015 namespace Document 00016 { 00017 00018 NodePositionFinder::NodePositionFinder(std::size_t node_id) 00019 : node_id(node_id) 00020 { 00021 } 00022 00023 void NodePositionFinder::read(const Track::Track & track, btVector3 & new_position) 00024 { 00025 new_position = track.get_path().get_node(node_id).get_position(); 00026 } 00027 00028 void NodePositionFinder::write(Track::Track & track, const btVector3 & new_position) 00029 { 00030 Track::Path & path = track.get_path(); 00031 Track::Path::Graph::vertex_descriptor vertex_descriptor = path.get_node_descriptor(node_id); 00032 Track::PathVertex & vertex = path.graph[vertex_descriptor]; 00033 vertex.set_position(new_position); 00034 path.update_connected_edges(vertex_descriptor); 00035 } 00036 00037 }
Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.