| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- // Copyright (c) 2008-2023 the Urho3D project
- // License: MIT
- #pragma once
- #include "Sample.h"
- namespace Urho3D
- {
- class Node;
- class Scene;
- }
- /// Static 3D scene example.
- /// This sample demonstrates:
- /// - Creating a 3D scene with static content
- /// - Displaying the scene using the Renderer subsystem
- /// - Handling keyboard and mouse input to move a freelook camera
- class StaticScene : public Sample
- {
- URHO3D_OBJECT(StaticScene, Sample);
- public:
- /// Construct.
- explicit StaticScene(Context* context);
- /// Setup after engine initialization and before running the main loop.
- void Start() override;
- private:
- /// Construct the scene content.
- void CreateScene();
- /// Construct an instruction text to the UI.
- void CreateInstructions();
- /// Set up a viewport for displaying the scene.
- void SetupViewport();
- /// Read input and moves the camera.
- void MoveCamera(float timeStep);
- /// Subscribe to application-wide logic update events.
- void SubscribeToEvents();
- /// Handle the logic update event.
- void HandleUpdate(StringHash eventType, VariantMap& eventData);
- };
|