Spinner.h 856 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <Atomic/Engine/Application.h>
  3. namespace Atomic
  4. {
  5. class Node;
  6. class Scene;
  7. class UIView;
  8. }
  9. using namespace Atomic;
  10. //
  11. // for eye candy-ization only
  12. //
  13. #include <Atomic/Scene/LogicComponent.h>
  14. /// Custom logic component for rotating a scene node. From Urho3D samples
  15. class Rotator : public LogicComponent
  16. {
  17. ATOMIC_OBJECT(Rotator, LogicComponent);
  18. public:
  19. Rotator(Context* context); /// Construct.
  20. void SetRotationSpeed(const Vector3& speedxyz); /// Set rotation speed about the Euler axes. Will be scaled with scene update time step.
  21. virtual void Update(float timeStep); /// Handle scene update. Called by LogicComponent base class.
  22. const Vector3& GetRotationSpeed() const
  23. {
  24. return rotationSpeed_; /// Return rotation speed.
  25. }
  26. private:
  27. Vector3 rotationSpeed_; /// Rotation speed.
  28. };