00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "Teddy/SpaceGame/ObjectManager.h"
00027 #include "Teddy/SpaceGame/CollisionGroup.h"
00028 #include "Teddy/SpaceGame/RoamAlgorithm.h"
00029 #include "Teddy/SpaceGame/RoamInstance.h"
00030 #include "Teddy/SpaceGame/RoamSphere.h"
00031 #include "Teddy/Graphics/View.h"
00032 #include "Teddy/Graphics/Features.h"
00033 #include "Teddy/Materials/Material.h"
00034 #include "Teddy/Scenes/Scene.h"
00035 using namespace Teddy::Scenes;
00036 using namespace Teddy::Materials;
00037
00038
00039 namespace Teddy {
00040 namespace SpaceGame {
00041
00042
00044 void ObjectManager::addROAM(){
00045 #if 0
00046 Material *mat;
00047
00048 mat = new Material( "Roam material",
00049 RENDER_MODE_FILL,
00050 RENDER_LIGHTING_SIMPLE,
00051 RENDER_OPTION_CULL_FACE_M |
00052 RENDER_OPTION_DEPTH_TEST_M |
00053 RENDER_OPTION_AMBIENT_M |
00054 RENDER_OPTION_DIFFUSE_M |
00055 RENDER_OPTION_SPECULAR_M |
00056 RENDER_OPTION_EMISSION_M |
00057 RENDER_OPTION_SHINYNESS_M |
00058 RENDER_OPTION_NORMALIZE_M |
00059
00060 RENDER_OPTION_SMOOTH_M
00061 );
00062 mat->setShininess( 8.0f );
00063 mat->setAmbient ( Color(0.1f,0.1f,0.1f) );
00064 mat->setDiffuse ( Color(0.5f,0.5f,0.5f) );
00065 mat->setSpecular ( Color(0.3f,0.3f,0.3f) );
00066
00067
00068 roam_update = true;
00069 roam_const = 0.000006f;
00070 RoamAlgorithm *roam_algo = new RoamAlgorithm();
00071 RoamSphere *roam = new RoamSphere();
00072 roam_algo->init(19082000, 2000, 600.0f, 0, 32 );
00073 roam->init( roam_algo );
00074 roam->setClipRadius( 2000+600.0f );
00075
00076 RoamInstance *mi_roam = new RoamInstance(
00077 "Roam Bubble",
00078 roam
00079 );
00080 mi_roam->setPosition( 0, 0, -2000 -600 -400 );
00081 mi_roam->setMaterial( mat );
00082
00083 scene->addInstance( mi_roam );
00084 view->display();
00085
00086
00087 #endif
00088 }
00089
00090
00091 };
00092 };
00093