// Copyright (c) 2008-2023 the Urho3D project // License: MIT #pragma once #include "Sample.h" namespace Urho3D { class Node; class Scene; class ConstraintRope2D; } /// Physics2D rope sample. /// This sample demonstrates: /// - Create revolute constraint /// - Create roop constraint /// - Displaying physics debug geometry class Urho2DPhysicsRope : public Sample { URHO3D_OBJECT(Urho2DPhysicsRope, Sample); public: /// Construct. explicit Urho2DPhysicsRope(Context* context); /// Setup after engine initialization and before running the main loop. void Start() override; protected: /// Return XML patch instructions for screen joystick layout for a specific sample app, if any. String GetScreenJoystickPatchString() const override { return "" " " " Zoom In" " " " " " " " " " " " " " " " Zoom Out" " " " " " " " " " " " " ""; } 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); };