Brunot
Loading...
Searching...
No Matches
ChangeRotationAction.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18#pragma once
19#include "Actions/Action.h"
20#include "Component/Transform.h"
21
26{
27public:
28
29#pragma region static_functions
30
31#pragma endregion
32
36 ~ChangeRotationAction() override = default;
37 ChangeRotationAction(ChangeRotationAction&& other) noexcept = default;
38 auto operator=(ChangeRotationAction&& other) noexcept -> ChangeRotationAction& = default;
39
40 ChangeRotationAction(float setEndingRotation);
41 ChangeRotationAction(float setEndingRotation, float duration);
42 ChangeRotationAction(float setEndingRotation, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
43
44 auto setRotation(float newRotation) -> void;
45 auto setIsLocal(bool setLocal) -> void;
46
47#pragma region overridden_functions
48
49
50 auto init() -> void override;
51 auto execute() -> void override;
52 auto end() -> void override;
53
54 auto ActionShowMenu() -> void override;
55 auto render() const -> void override;
56
57
58#pragma endregion
59
60#pragma region ChangeRotationAction_functions
61
62#pragma endregion
63
64private:
65
66#pragma region member_variables
67
68 Transform* transform = nullptr;
69
70 float startingRotation = 1.f;
72
73 bool isLocal = false;
74
75#pragma endregion
76
77#pragma region helper_functions
78
79#pragma endregion
80
81#pragma region static_variables
82
83#pragma endregion
84
85};
A class that changes a variable over a set duration.
float initialDelay
Delay that acts between the action being created and the action initializing.
Definition Action.h:262
float endingDelay
Delay that acts after the action has finished updating but before it has ended.
Definition Action.h:264
Action()=default
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition ChangeRotationAction.cpp:78
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition ChangeRotationAction.cpp:73
auto operator=(ChangeRotationAction &&other) noexcept -> ChangeRotationAction &=default
~ChangeRotationAction() override=default
auto operator=(const ChangeRotationAction &) -> ChangeRotationAction &=default
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition ChangeRotationAction.cpp:69
auto setIsLocal(bool setLocal) -> void
Definition ChangeRotationAction.cpp:49
float endingRotation
Definition ChangeRotationAction.h:71
Transform * transform
Definition ChangeRotationAction.h:68
bool isLocal
Definition ChangeRotationAction.h:73
ChangeRotationAction()=default
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition ChangeRotationAction.cpp:54
ChangeRotationAction(ChangeRotationAction &&other) noexcept=default
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition ChangeRotationAction.cpp:64
auto setRotation(float newRotation) -> void
Definition ChangeRotationAction.cpp:44
float startingRotation
Definition ChangeRotationAction.h:70
ChangeRotationAction(const ChangeRotationAction &)=default
Definition Transform.h:28
Definition Bezier.h:30