- Timestamp:
- 12/10/08 15:57:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp
r3219 r3220 17 17 18 18 19 WalkThroughRecorder::~WalkThroughRecorder() 20 { 21 mFile.close(); 22 } 23 24 19 25 void WalkThroughRecorder::WriteFrame(Camera *cam) 20 26 { … … 28 34 { 29 35 ifstream file(filename.c_str()); 30 FrameInfo info;31 int i=0;32 36 33 std::string token; 37 if (file.is_open()) 38 { 39 FrameInfo info; 40 int i=0; 34 41 35 while(std::getline(file, token)) 42 std::string token; 43 44 while(std::getline(file, token)) 45 { 46 std::stringstream line(token); 47 48 line >> info; 49 mFrameInfos.push_back(info); 50 } 51 } 52 else 36 53 { 37 std::stringstream line(token); 54 cerr << "problem: cannot open file " << filename << endl; 55 } 38 56 39 line >> info; 40 mFrameInfos.push_back(info); 41 } 57 file.close(); 42 58 } 43 59 … … 45 61 bool WalkThroughPlayer::ReadNextFrame(Camera *cam) 46 62 { 63 if (mFrameInfos.empty()) 64 return false; 65 47 66 cam->SetDirection(mFrameInfos[mFrame].mDirection); 48 67 cam->SetPosition(mFrameInfos[mFrame].mPosition);
Note: See TracChangeset
for help on using the changeset viewer.