PolyGenericScene.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * PolyGenericScene.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 3/18/08.
  6. * Copyright 2008 Ivan Safrin. All rights reserved.
  7. *
  8. */
  9. // @package Scene
  10. #pragma once
  11. #include "PolyString.h"
  12. #include "PolyLogger.h"
  13. #include "PolyGlobals.h"
  14. #include <vector>
  15. #include "PolyScene.h"
  16. #include "PolySceneMesh.h"
  17. #include "PolyScenePrimitive.h"
  18. #include "OSBasics.h"
  19. using std::vector;
  20. namespace Polycode {
  21. class _PolyExport GenericScene : public Scene {
  22. public:
  23. GenericScene();
  24. GenericScene(bool virtualScene);
  25. virtual ~GenericScene();
  26. void Render();
  27. void RenderDepthOnly(Camera *targetCamera);
  28. void addGrid(String gridTexture);
  29. static String readString(OSFILE *inFile);
  30. void loadScene(String fileName);
  31. void generateLightmaps(Number lightMapRes, Number lightMapQuality, int numRadPasses);
  32. void addLight(SceneLight *light);
  33. SceneLight *getNearestLight(Vector3 pos);
  34. void writeEntityMatrix(SceneEntity *entity, OSFILE *outFile);
  35. void writeString(String str, OSFILE *outFile);
  36. void saveScene(String fileName);
  37. int getNumStaticGeometry();
  38. SceneMesh *getStaticGeometry(int index);
  39. virtual void loadCollisionChild(SceneEntity *entity, bool autoCollide=false, int type=0){}
  40. int getNumLights();
  41. SceneLight *getLight(int index);
  42. SceneEntity *getCustomEntityByType(String type);
  43. vector<SceneEntity*> getCustomEntitiesByType(String type);
  44. static const unsigned int ENTITY_MESH = 0;
  45. static const unsigned int ENTITY_LIGHT = 1;
  46. static const unsigned int ENTITY_CAMERA = 2;
  47. static const unsigned int ENTITY_ENTITY = 3;
  48. static const unsigned int ENTITY_COLLMESH = 4;
  49. Color clearColor;
  50. Color ambientColor;
  51. Color fogColor;
  52. private:
  53. bool useClearColor;
  54. bool virtualScene;
  55. bool hasLightmaps;
  56. // LightmapPacker *packer;
  57. vector <SceneLight*> lights;
  58. vector <SceneMesh*> staticGeometry;
  59. vector <SceneMesh*> collisionGeometry;
  60. vector <SceneEntity*> customEntities;
  61. };
  62. }