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

ObjectManager.h

Go to the documentation of this file.
00001 
00002 /*
00003     TEDDY - General graphics application library
00004     Copyright (C) 1999, 2000, 2001  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: ObjectManager.h,v 1.1 2002/01/08 20:47:05 tksuoran Exp $
00022 */
00023 
00024 
00025 #ifndef TEST_EVENTS__OBJECT_MANAGER_H
00026 #define TEST_EVENTS__OBJECT_MANAGER_H
00027 
00028 
00029 //  Forward declarations
00030 namespace Teddy {
00031  namespace Materials          { class Light;         };
00032  namespace Models             { class ModelInstance; };
00033  namespace Scenes             { class Camera;        };
00034  namespace Scenes             { class Scene;         };
00035  namespace SysSupport         { class Clock;         };
00036 };
00037 using namespace Teddy::Materials;
00038 using namespace Teddy::Models;
00039 using namespace Teddy::Scenes;
00040 using namespace Teddy::SysSupport;
00041 
00042 
00043 namespace Teddy     {
00044 namespace SpaceGame {
00045 
00046 
00047 class CollisionGroup;
00048 class PlayerShip;
00049 class Root;
00050 class ShipCamera;
00051 class ShipType;
00052 
00053 
00058 class ObjectManager {
00059 public:
00060     ObjectManager( Root *root );
00061 
00062     void        updateObjects  ();
00063     void        addObjects     ();
00064     void        addLights      ( int num  =1, const bool animate=false );
00065     void        addGrid        ( int xcount, int zcount, int xspace, int zspace );
00066     void        addPrimitives  ();
00067     void        loadLWO        ();
00068     void        addFFE         ();
00069     void        addROAM        ();
00070     void        addRigidBodies ();
00071 
00072     void        rayCollision   ( ModelInstance *mi );
00073 
00074     Camera     *getCamera      ();
00075     void        setActiveCamera( Camera *c );
00076 
00077     Scene      *getScene       ();
00078     PlayerShip *getPlayerShip  ();
00079     ShipCamera *getShipCamera  ();
00080 
00081     void instanceRotate       ( const int x, const int y );  // mouse move delta
00082     void instanceScale        ( const int x, const int y );  // mouse move delta
00083     void instanceTranslateXZ  ( const int x, const int y );  // mouse move delta
00084     void instanceTranslateYZ  ( const int x, const int y );  // mouse move delta
00085     void selectInstance       ( const int x, const int y );
00086 
00087 protected:
00088     Root           *root;
00089     Scene          *scene;            
00090     Camera         *camera;           
00091     Camera         *camera2;          
00092     Camera         *active_camera;    
00093     ShipCamera     *player_camera;    
00094     ModelInstance  *instance;         
00095     CollisionGroup *solar_bodies_cg;  
00096     ShipType       *ship_type;        
00097     PlayerShip     *player_ship;      
00098 };
00099 
00100 
00101 };  //  namespace SpaceGame
00102 };  //  namespace Teddy
00103 
00104 
00105 #endif  //  TEST_EVENTS__OBJECT_MANAGER_H
00106