GroupCullingScene.cpp

00001 #include "GroupCullingScene.h"
00002 
00003 #include "TestScene.h"
00004 #include "TerminalObject.h"
00005 #include "GroupObject.h"
00006 #include "Torus.h"
00007 
00008 
00009 void GroupCullingScene::Init ()
00010 {
00011         RawObject * torus;
00012         torus = new Torus (1.0f, 4.0f, 16, 16);
00013         torus->SetColor (0.2f, 0.4f, 0.8f, 0.0f);
00014 
00015         GroupObject * old_group;
00016         GroupObject * new_group;
00017         TerminalObject * terminal;
00018 
00019         old_group = NULL;
00020         new_group = NULL;
00021 
00022         // create a group of 'moving' objects
00023         for (int index = 0; index < 5; index++)
00024         {
00025                 old_group = new_group;
00026 
00027                 terminal = new TerminalObject (torus);
00028                 new_group = new GroupObject ();
00029                 new_group->AddChild (terminal);
00030                 new_group->position->StartPath (0, 0.0f, 20.0f, 0.0f, 20.0f, 0.0f, 20.0f);
00031                 new_group->position->SetDuration (30000);
00032                 new_group->position->SetGlobalTransition (PP_LINEAR, 0.0f);
00033                 new_group->position->CompletePath (0.0f, 20.0f, 0.0f, 20.0f, 0.0f, 20.0f);
00034 
00035                 if (old_group != NULL)
00036                 {new_group->AddChild (old_group);}
00037         }
00038 
00039         new_group->CalculateRelativePositions ();
00040         AddObject (new_group);
00041 
00042 
00043         // set up camera
00044         camera = new Camera ();
00045         camera->SetAttributes (45, 1.333, 10.0, 200.0);
00046         camera->position->StartPath (0, 50.0f, 20.0f, 30.0f, 0.0f, 0.0f, 160.0f);
00047         camera->position->SetDuration (30000);
00048         camera->position->SetGlobalTransition (PP_LINEAR, 0.0f);
00049         camera->position->CompletePath (100.0f, 0.0f, 30.0f, 1080.0f, 0.0f, 120.0f);
00050 }

Generated on Sun Jul 2 13:20:39 2006 for Demo by  doxygen 1.4.6-NO