Skybox.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "../Graphics/StaticModel.h"
  5. namespace Urho3D
  6. {
  7. /// Static model component with fixed position in relation to the camera.
  8. class URHO3D_API Skybox : public StaticModel
  9. {
  10. URHO3D_OBJECT(Skybox, StaticModel);
  11. public:
  12. /// Construct.
  13. explicit Skybox(Context* context);
  14. /// Destruct.
  15. ~Skybox() override;
  16. /// Register object factory. StaticModel must be registered first.
  17. /// @nobind
  18. static void RegisterObject(Context* context);
  19. /// Process octree raycast. May be called from a worker thread.
  20. void ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryResult>& results) override;
  21. /// Calculate distance and prepare batches for rendering. May be called from worker thread(s), possibly re-entrantly.
  22. void UpdateBatches(const FrameInfo& frame) override;
  23. protected:
  24. /// Recalculate the world-space bounding box.
  25. void OnWorldBoundingBoxUpdate() override;
  26. /// Custom world transform per camera.
  27. HashMap<Camera*, Matrix3x4> customWorldTransforms_;
  28. /// Last frame counter for knowing when to erase the custom world transforms of previous frame.
  29. unsigned lastFrame_;
  30. };
  31. }