absence_thelab

view 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
line source
1 #include "tunnelpart.h"
3 TunnelPart::TunnelPart(GraphicsContext *gc) {
4 this->gc = gc;
6 SceneLoader::SetNormalFileSaving(true);
7 SceneLoader::SetDataPath("data/textures/");
8 SceneLoader::LoadScene("data/geometry/tunnel.3ds", &scene);
10 CamPath = scene->GetCurve("Line01");
11 TargPath = scene->GetCurve("Line02");
13 CamPath->SetArcParametrization(true);
14 TargPath->SetArcParametrization(true);
16 cam = scene->GetCamera("Camera02");
17 cam->SetCameraPath(CamPath, TargPath, 0, 30000);
18 }
20 TunnelPart::~TunnelPart() {
21 delete scene;
22 }
24 void TunnelPart::MainLoop() {
25 dword msec = timer.GetMilliSec();
26 float t = msec / 1000.0f;
28 gc->Clear(0);
29 gc->ClearZBufferStencil(1.0f, 0);
31 cam->FollowPath(msec);
33 scene->Render();
34 }