AngelScriptIntegration.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 with script integration.
  11. /// This sample demonstrates:
  12. /// - Initializing the AngelScript scripting subsystem
  13. /// - Creating a 3D scene and using a script object to animate the objects
  14. class AngelScriptIntegration : public Sample
  15. {
  16. URHO3D_OBJECT(AngelScriptIntegration, Sample);
  17. public:
  18. /// Construct.
  19. explicit AngelScriptIntegration(Context* context);
  20. /// Setup after engine initialization and before running the main loop.
  21. void Start() override;
  22. private:
  23. /// Construct the scene content.
  24. void CreateScene();
  25. /// Construct an instruction text to the UI.
  26. void CreateInstructions();
  27. /// Set up a viewport for displaying the scene.
  28. void SetupViewport();
  29. /// Subscribe to application-wide logic update events.
  30. void SubscribeToEvents();
  31. /// Read input and moves the camera.
  32. void MoveCamera(float timeStep);
  33. /// Handle the logic update event.
  34. void HandleUpdate(StringHash eventType, VariantMap& eventData);
  35. };