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 #include "SegmentConnection.h" 00012 #include <Debug.h> 00013 00014 namespace Track 00015 { 00016 00017 SegmentConnection::SegmentConnection(unsigned int cross_section_id, 00018 btTransform transform) 00019 : cross_section_id(cross_section_id) 00020 , transform(transform) 00021 { 00022 } 00023 00024 SegmentConnection::SegmentConnection(std::istream & source) 00025 { 00026 // get id. 00027 source >> cross_section_id; 00028 00029 btScalar x, y, z, w; 00030 // get origin 00031 source >> x >> y >> z; 00032 transform.setOrigin(btVector3(x, y, z)); 00033 // get rotation 00034 source >> x >> y >> z >> w; 00035 DEBUG_MESSAGE("Segment connection quaternion: (" << x << ", " << y << ", " << ", " << z << ", " << w << ")"); 00036 transform.setRotation(btQuaternion(x, y, z, w)); 00037 } 00038 00039 SegmentConnection::~SegmentConnection() 00040 { 00041 } 00042 00043 unsigned int SegmentConnection::get_cross_section_id() const 00044 { 00045 return cross_section_id; 00046 } 00047 00048 const btTransform & SegmentConnection::get_transform() const 00049 { 00050 return transform; 00051 } 00052 00053 }
Generated at Mon Sep 6 00:41:12 2010 by Doxygen version 1.4.7 for Racer version svn335.