AnimatingScene.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "Sample.h"
  5. namespace Urho3D
  6. {
  7. class Node;
  8. class Scene;
  9. }
  10. /// Animating 3D scene example.
  11. /// This sample demonstrates:
  12. /// - Creating a 3D scene and using a custom component to animate the objects
  13. /// - Controlling scene ambience with the Zone component
  14. /// - Attaching a light to an object (the camera)
  15. class AnimatingScene : public Sample
  16. {
  17. URHO3D_OBJECT(AnimatingScene, Sample);
  18. public:
  19. /// Construct.
  20. explicit AnimatingScene(Context* context);
  21. /// Setup after engine initialization and before running the main loop.
  22. void Start() override;
  23. private:
  24. /// Construct the scene content.
  25. void CreateScene();
  26. /// Construct an instruction text to the UI.
  27. void CreateInstructions();
  28. /// Set up a viewport for displaying the scene.
  29. void SetupViewport();
  30. /// Subscribe to application-wide logic update events.
  31. void SubscribeToEvents();
  32. /// Read input and moves the camera.
  33. void MoveCamera(float timeStep);
  34. /// Handle the logic update event.
  35. void HandleUpdate(StringHash eventType, VariantMap& eventData);
  36. };