PolyScene.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * PolyScene.h
  3. * TAU
  4. *
  5. * Created by Ivan Safrin on 3/18/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package Scene
  10. #pragma once
  11. #include "PolyGlobals.h"
  12. #include "PolyRenderer.h"
  13. #include "PolySceneEntity.h"
  14. #include "PolyCamera.h"
  15. #include "PolySceneLight.h"
  16. #include <vector>
  17. using std::vector;
  18. namespace Polycode {
  19. class Camera;
  20. class SceneLight;
  21. class _PolyExport Scene : public EventDispatcher {
  22. public:
  23. Scene();
  24. virtual ~Scene();
  25. virtual void Render() = 0;
  26. virtual void RenderDepthOnly(Camera *targetCamera) = 0;
  27. void addEntity(SceneEntity *entity);
  28. void removeEntity(SceneEntity *entity);
  29. Camera *getDefaultCamera();
  30. void enableLighting(bool enable);
  31. void enableFog(bool enable);
  32. void setFogProperties(int fogMode, Color color, float density, float startDepth, float endDepth);
  33. virtual void Update();
  34. void setVirtual(bool val);
  35. bool isVirtual();
  36. bool isEnabled();
  37. void setEnabled(bool enabled);
  38. int getNumEntities() { return entities.size(); }
  39. SceneEntity *getEntity(int index) { return entities[index]; }
  40. SceneEntity *getEntityAtCursor(float x, float y);
  41. protected:
  42. bool isSceneVirtual;
  43. bool enabled;
  44. Camera *defaultCamera;
  45. vector <SceneEntity*> entities;
  46. bool lightingEnabled;
  47. bool fogEnabled;
  48. int fogMode;
  49. Color fogColor;
  50. float fogDensity;
  51. float fogStartDepth;
  52. float fogEndDepth;
  53. };
  54. }