#pragma once #include "scene.h" #include #include #include #include "UserContactReport.h" #include "UserTriggerReport.h" #include "UserNotify.h" #include "fmod.h" #include "Bullet.h" #include "Weapon.h" #define SPTR boost::shared_ptr class UserPlayer; class Terrain; class HUD; class Ocean; class SkyBox; class Player; class Goodie; class SoundNode; class GameScene : public Scene { public: GameScene(void); ~GameScene(void); virtual void initScene(GameManager &_manager); void loadGame(std::string filename); virtual void clearScene(); void setMaxEnemyCount(int maxEnemyCount); virtual void renderScene(float fElapsedTime); Terrain* getTerrain(); HUD* getHUD(); SkyBox *skybox; //Factory Stuff static const int NODE_TERRAIN = 128; static const int NODE_USERPLAYER = 256; static const int NODE_AIPLAYER = 512; static const int NODE_SIMPLEWEAPON = 1024; static const int NODE_SIMPLEBULLET = 2048; static const int NODE_SKYBOX = 4096; static const int NODE_GOODIE = 8192; static const int NODE_UNIVERSALWEAPON = 16384; static const int NODE_OCEAN = 32768; static const int NODE_HUD = 65536; virtual Node* createNode(int type); virtual Node* createNode(int type, Node &father); virtual Node* createNode(int type, bool addDefaultRenderer); virtual Node* createNode(int type, Node &father, bool addDefaultRenderer); virtual Node* createNode(int type, Node &father, bool addDefaultRenderer, bool isReference); //Game Related std::list > playerList; std::list > goodieList; std::list > bulletList; std::list >* getPlayerList(); std::list >* getGoodieList(); UserPlayer *player; //PhysicStuff void connectMaterialIds(int physicId, int xmlId); int getPhysicMaterialId(int xmlId); std::vector materialXMLVector; std::vector materialPhysicVector; //GoodieStuff float getRandomTime(float timeBase, float timeVariation); static const int TRIGGER_IMPACTPLAYER = 100; static const int TRIGGER_IMPACTTERRAIN = 101; static const int TRIGGER_IMPACTGOODIE = 102; static const int TRIGGER_IMPACTOTHER = 103; static const int TRIGGER_GOODIECATCH = 104; static const int TRIGGER_IMPACTFIRE = 105; static const int TRIGGER_IMPACTICE = 106; static const int TRIGGER_CREATEPLAYER = 107; static const int TRIGGER_CREATEMOREPLAYER= 108; virtual void cleanUpScene(); Bullet* cloneBulletFromReference(int type); Weapon* cloneWeaponFromReference(int type); float getTerrainHeight(Vector v); bool showFPS; //Reingehacktes zeug...rauslöschen /*void toggleRaytraceRenderer(); Node* glasNode; bool usingRaytracer; Renderer* simpleRenderer; Renderer* raytraceRenderer;*/ void setChallengeDescription(std::string _description, float _descDuration); bool aiPlayerFireEnable; friend class GameSceneLoader; bool alreadyUsed; void reduceHealthOnPlayers(Bullet* bullet); bool preparepaused; bool currentlypaused; void hasWon(); protected: SoundNode* sadSound; SoundNode* happySound; bool resultVisible; bool won; bool descSet; std::string description; std::string enemyModel; //Filename of the enemy for the AIPlayer creation! float descDuration; bool recalcTransformations; //To Froze Screen when loosing Terrain *terrain; HUD *hud; Ocean *ocean; int cameraFixedCount; int maxEnemyCount; Vector lookAtPoint; Vector viewPoint; Vector dLookAtPoint; Vector dViewPoint; Object3d *obj; float cnt; //Scene Description std::string gameName; float gameDuration; int gameMode; //Reference Lists std::vector > refWeaponVector; //List of all Weapons std::vector > refBulletVector; //List of all Bullets void updateGameFirst(); void updateGameSecond(); virtual void executeTrigger(SPTR trigger); UserContactReport userContactReport; UserTriggerReport userTriggerReport; UserNotify userNotify; //Backgroundmusic Stuff /*FSOUND_STREAM *bgMusicStream; int bgSoundChannel; float bgSoundVolume; void setBackgroundSound(std::string filename); void setBackgroundSoundVolume(float vol); void playBackgroundSound();*/ //virtual void updateSoundNodeVolume(); //fly around cam: bool flyCamEnabled; void initWin(); void initLose(); float resultShowingTimer; };