From a556b45abf18f1bd509daaf63b66b7d55e9fd291 Mon Sep 17 00:00:00 2001 From: jjesswan Date: Mon, 22 Apr 2024 21:56:26 -0400 Subject: add engine version --- engine-ocean/Game/Components/transformcomponent.h | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 engine-ocean/Game/Components/transformcomponent.h (limited to 'engine-ocean/Game/Components/transformcomponent.h') diff --git a/engine-ocean/Game/Components/transformcomponent.h b/engine-ocean/Game/Components/transformcomponent.h new file mode 100644 index 0000000..7b6a5c2 --- /dev/null +++ b/engine-ocean/Game/Components/transformcomponent.h @@ -0,0 +1,54 @@ +#ifndef TRANSFORMCOMPONENT_H +#define TRANSFORMCOMPONENT_H + +#include "Game/Systems/aisystem.h" +#include "Graphics/global.h" +#include +#include "Component.h" + +class TransformComponent : public Component +{ +public: + TransformComponent(std::shared_ptr mt, + std::string entity_id, + std::map& m_global_blackboard, + bool isAI = false); + + void translate(const glm::vec3 &delta); + void setPos(const glm::vec3 &new_pos); + void setScale(const glm::vec3 &scale); + std::shared_ptr getMT(); + std::vector> getAllMT(); + glm::vec3 getScale(); + //glm::vec3 getRotation(); + void setRotation(float angle, glm::vec3 axis); + float getYRotationAngle(); + + + + + bool hasMultipleMT(); + glm::vec3 getPos(); + + // used for collisions + glm::vec3 old_pos; + glm::vec3 estimated_final_pos; + bool onGround = false; + bool movingLaterally = false; + float gravity = -25.f; + float yVelocity = 0.f; + + + +private: + std::shared_ptr m_model_transform; + std::vector> m_all_model_transforms; + bool multipleMT = false; + std::map& m_global_blackboard; + std::string m_entity_id; + bool isAIObject = false; + + +}; + +#endif // TRANSFORMCOMPONENT_H -- cgit v1.2.3-70-g09d2