Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RoamObjects.cpp

Go to the documentation of this file.
00001 
00002 /*
00003     TSGL - Teddy Space Game Library
00004     Copyright (C) 2002 Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2.1 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     $Id: RoamObjects.cpp,v 1.1 2002/01/08 20:47:05 tksuoran Exp $
00022 */
00023 
00024 
00025 //#include "UniverseDevelopmentKit/CMaster.h"
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 //      RENDER_OPTION_BORDER_M     |
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 //  mat->setBorder   ( Color(0.0f,0.0f,0.0f) );
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 //  solar_bodies_cg->insert( mi_roam );
00087 #endif
00088 }
00089 
00090 
00091 };  //  namespace SpaceGame
00092 };  //  namespace Teddy
00093