PolyGenericScene.h 2.0 KB

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