SimpleEngine/include/simpleengine/ecs/component/rotating_component.h

31 lines
671 B
C
Raw Normal View History

2022-09-23 04:54:18 +00:00
#pragma once
#include <glm/glm.hpp>
namespace simpleengine::ecs {
2022-09-23 04:54:18 +00:00
/**
* @brief A component that will rotate the transform every frame.
*
*/
class RotatingComponent {
public:
float rate;
glm::vec3 rotation_axis;
RotatingComponent() : rate(10.f), rotation_axis(glm::vec3(0, 1, 0)) {
}
RotatingComponent(float rate) : rate(rate), rotation_axis(glm::vec3(0, 1, 0)) {
}
RotatingComponent(glm::vec3 rotation_axis) : rotation_axis(rotation_axis) {
}
RotatingComponent(float rate, glm::vec3 rotation_axis) : rate(rate), rotation_axis(rotation_axis) {
}
};
}