RotateVertexDelta.cpp

Go to the documentation of this file.
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 "RotateVertexDelta.h"
00013 #include "../Track.h"
00014 
00015 namespace Document
00016 {
00017 
00018 VertexAngleFinder::VertexAngleFinder(std::size_t vertex_id)
00019     :   vertex_id(vertex_id)
00020 {
00021 }
00022 
00023 void VertexAngleFinder::read(const Track::Track & track, btQuaternion & angle)
00024 {
00025     angle = track.get_path().get_node(vertex_id).get_angle();
00026 }
00027 
00028 void VertexAngleFinder::write(Track::Track & track, const btQuaternion & new_angle)
00029 {
00030     Track::Path & path = track.get_path();
00031     Track::Path::Graph::vertex_descriptor vertex_descriptor = path.get_node_descriptor(vertex_id);
00032     Track::PathVertex & vertex = path.graph[vertex_descriptor];
00033     vertex.set_angle(new_angle);
00034     path.update_connected_edges(vertex_descriptor);
00035 }
00036 
00037 }

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.