Zone.pkg 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $#include "Zone.h"
  2. /// %Component that describes global rendering properties
  3. class Zone : public Drawable
  4. {
  5. public:
  6. /// Set local-space bounding box. Will be used as an oriented bounding box to test whether objects or the camera are inside.
  7. void SetBoundingBox(const BoundingBox& box);
  8. /// Set ambient color
  9. void SetAmbientColor(const Color& color);
  10. /// Set fog color.
  11. void SetFogColor(const Color& color);
  12. /// Set fog start distance.
  13. void SetFogStart(float start);
  14. /// Set fog end distance.
  15. void SetFogEnd(float end);
  16. /// Set zone priority. If an object or camera is inside several zones, the one with highest priority is used.
  17. void SetPriority(int priority);
  18. /// Set override mode. If camera is inside an override zone, it will also be used for all drawables.
  19. void SetOverride(bool enable);
  20. /// Set ambient gradient mode. In gradient mode ambient color is interpolated from neighbor zones.
  21. void SetAmbientGradient(bool enable);
  22. /// Return bounding box.
  23. const BoundingBox& GetBoundingBox() const { return boundingBox_; }
  24. /// Return inverse world transform.
  25. const Matrix3x4& GetInverseWorldTransform() const;
  26. /// Return zone's own ambient color, disregarding gradient mode.
  27. const Color& GetAmbientColor() const { return ambientColor_; }
  28. /// Return ambient start color. Not safe to call from worker threads due to possible octree query.
  29. const Color& GetAmbientStartColor();
  30. /// Return ambient end color. Not safe to call from worker threads due to possible octree query.
  31. const Color& GetAmbientEndColor();
  32. /// Return fog color.
  33. const Color& GetFogColor() const { return fogColor_; }
  34. /// Return fog start distance.
  35. float GetFogStart() const { return fogStart_; }
  36. /// Return fog end distance.
  37. float GetFogEnd() const { return fogEnd_; }
  38. /// Return zone priority.
  39. int GetPriority() const { return priority_; }
  40. /// Return override mode.
  41. bool GetOverride() const { return override_; }
  42. /// Return whether ambient gradient mode is enabled.
  43. bool GetAmbientGradient() const { return ambientGradient_; }
  44. /// Check whether a point is inside.
  45. bool IsInside(const Vector3& point) const;
  46. };