absence_thelab
annotate src/tunnelpart.cpp @ 0:1cffe3409164
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 23 Oct 2014 01:46:07 +0300 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 #include "tunnelpart.h" |
nuclear@0 | 2 |
nuclear@0 | 3 TunnelPart::TunnelPart(GraphicsContext *gc) { |
nuclear@0 | 4 this->gc = gc; |
nuclear@0 | 5 |
nuclear@0 | 6 SceneLoader::SetNormalFileSaving(true); |
nuclear@0 | 7 SceneLoader::SetDataPath("data/textures/"); |
nuclear@0 | 8 SceneLoader::LoadScene("data/geometry/tunnel.3ds", &scene); |
nuclear@0 | 9 |
nuclear@0 | 10 CamPath = scene->GetCurve("Line01"); |
nuclear@0 | 11 TargPath = scene->GetCurve("Line02"); |
nuclear@0 | 12 |
nuclear@0 | 13 CamPath->SetArcParametrization(true); |
nuclear@0 | 14 TargPath->SetArcParametrization(true); |
nuclear@0 | 15 |
nuclear@0 | 16 cam = scene->GetCamera("Camera02"); |
nuclear@0 | 17 cam->SetCameraPath(CamPath, TargPath, 0, 30000); |
nuclear@0 | 18 } |
nuclear@0 | 19 |
nuclear@0 | 20 TunnelPart::~TunnelPart() { |
nuclear@0 | 21 delete scene; |
nuclear@0 | 22 } |
nuclear@0 | 23 |
nuclear@0 | 24 void TunnelPart::MainLoop() { |
nuclear@0 | 25 dword msec = timer.GetMilliSec(); |
nuclear@0 | 26 float t = msec / 1000.0f; |
nuclear@0 | 27 |
nuclear@0 | 28 gc->Clear(0); |
nuclear@0 | 29 gc->ClearZBufferStencil(1.0f, 0); |
nuclear@0 | 30 |
nuclear@0 | 31 cam->FollowPath(msec); |
nuclear@0 | 32 |
nuclear@0 | 33 scene->Render(); |
nuclear@0 | 34 } |