BabylonLight.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #pragma once
  2. #include "BabylonVertex.h"
  3. #include <limits>
  4. #include "BabylonNode.h"
  5. #include "BabylonAnimation.h"
  6. #include <memory>
  7. #include <string>
  8. #undef max
  9. class BabylonShadowGenerator
  10. {
  11. public:
  12. int mapSize;
  13. float bias;
  14. std::wstring lightId;
  15. bool useVarianceShadowMap;
  16. bool usePoissonSampling;
  17. bool useBlurVarianceShadowMap;
  18. float blurScale;
  19. float blurBoxOffset;
  20. std::vector<std::wstring> renderList;
  21. BabylonShadowGenerator(FbxNode* lightNode);
  22. BabylonShadowGenerator(const BabylonShadowGenerator&) = default;
  23. BabylonShadowGenerator(BabylonShadowGenerator&& moved);
  24. web::json::value toJson();
  25. };
  26. class BabylonLight
  27. {
  28. public:
  29. const int type_omni = 0;
  30. const int type_Spot = 2;
  31. const int type_direct = 1;
  32. const int type_ambient = 3;
  33. std::wstring name;
  34. std::wstring id;
  35. std::wstring parentId;
  36. babylon_vector3 position;
  37. babylon_vector3 direction;
  38. int type = 0;
  39. babylon_vector3 diffuse;
  40. babylon_vector3 specular;
  41. float intensity = 1;
  42. float range = std::numeric_limits<float>::max();
  43. float exponent = 0;
  44. float angle = 0;
  45. babylon_vector3 groundColor;
  46. bool castShadows;
  47. std::vector<std::wstring> includedOnlyMeshesIds;
  48. std::vector<std::wstring> excludedMeshesIds;
  49. std::shared_ptr<BabylonShadowGenerator> shadowGenerator;
  50. std::vector<std::shared_ptr < BabylonAnimation<babylon_vector3>>> animations;
  51. web::json::value toJson() const;
  52. BabylonLight();
  53. BabylonLight(BabylonNode& babnode);
  54. BabylonLight(const BabylonLight&) = default;
  55. BabylonLight(BabylonLight&& moved);
  56. ~BabylonLight();
  57. };