absence_thelab

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/tunnelpart.cpp	Thu Oct 23 01:46:07 2014 +0300
     1.3 @@ -0,0 +1,34 @@
     1.4 +#include "tunnelpart.h"
     1.5 +
     1.6 +TunnelPart::TunnelPart(GraphicsContext *gc) {
     1.7 +	this->gc = gc;
     1.8 +
     1.9 +	SceneLoader::SetNormalFileSaving(true);
    1.10 +	SceneLoader::SetDataPath("data/textures/");
    1.11 +	SceneLoader::LoadScene("data/geometry/tunnel.3ds", &scene);
    1.12 +
    1.13 +	CamPath = scene->GetCurve("Line01");
    1.14 +	TargPath = scene->GetCurve("Line02");
    1.15 +
    1.16 +	CamPath->SetArcParametrization(true);
    1.17 +	TargPath->SetArcParametrization(true);
    1.18 +    
    1.19 +	cam = scene->GetCamera("Camera02");
    1.20 +	cam->SetCameraPath(CamPath, TargPath, 0, 30000);
    1.21 +}
    1.22 +
    1.23 +TunnelPart::~TunnelPart() {
    1.24 +	delete scene;
    1.25 +}
    1.26 +
    1.27 +void TunnelPart::MainLoop() {
    1.28 +	dword msec = timer.GetMilliSec();
    1.29 +	float t = msec / 1000.0f;
    1.30 +
    1.31 +	gc->Clear(0);
    1.32 +	gc->ClearZBufferStencil(1.0f, 0);
    1.33 +
    1.34 +	cam->FollowPath(msec);
    1.35 +
    1.36 +	scene->Render();
    1.37 +}
    1.38 \ No newline at end of file