From f3c161481b1ddc8830c0408fb6c442aad2557119 Mon Sep 17 00:00:00 2001 From: kj16609 Date: Thu, 27 Feb 2025 12:07:56 -0500 Subject: [PATCH] Remove alternative fix attempt --- src/engine/primitives/TransformComponent.cpp | 27 -------------- src/engine/primitives/TransformComponent.hpp | 38 -------------------- 2 files changed, 65 deletions(-) diff --git a/src/engine/primitives/TransformComponent.cpp b/src/engine/primitives/TransformComponent.cpp index 873d57b..4bb2792 100644 --- a/src/engine/primitives/TransformComponent.cpp +++ b/src/engine/primitives/TransformComponent.cpp @@ -47,31 +47,4 @@ namespace fgl::engine template struct TransformComponent< CoordinateSpace::World >; template struct TransformComponent< CoordinateSpace::Model >; - namespace v2 - { - TransformComponent::TransformComponent() : - m_position( 0.0f, 0.0f, 0.0f ), - m_scale( 1.0, 1.0, 1.0 ), - m_rotation() - {} - - Matrix TransformComponent::mat() const - { - glm::mat3 rotation_mat { m_rotation.mat() }; - rotation_mat[ 0 ] = rotation_mat[ 0 ] * m_scale.x; - rotation_mat[ 1 ] = rotation_mat[ 1 ] * m_scale.y; - rotation_mat[ 2 ] = rotation_mat[ 2 ] * m_scale.z; - - const glm::mat4 mat { { rotation_mat[ 0 ], 0.0f }, - { rotation_mat[ 1 ], 0.0f }, - { rotation_mat[ 2 ], 0.0f }, - { m_position.vec(), 1.0f } }; - - const Matrix matrix { mat }; - - return matrix; - } - - } // namespace v2 - } // namespace fgl::engine diff --git a/src/engine/primitives/TransformComponent.hpp b/src/engine/primitives/TransformComponent.hpp index 130b4ee..c5204a5 100644 --- a/src/engine/primitives/TransformComponent.hpp +++ b/src/engine/primitives/TransformComponent.hpp @@ -13,44 +13,6 @@ namespace fgl::engine { - namespace v2 - { - struct Coordinate : public glm::vec3 - { - public: - - glm::vec3 vec() const { return static_cast< glm::vec3 >( *this ); } - - Coordinate() = delete; - - Coordinate( const float x, const float y, const float z ) : glm::vec3( x, y, z ) {} - }; - - struct Matrix : public glm::mat4 - { - public: - - Matrix() = delete; - - explicit Matrix( const float value ) : glm::mat4( value ) {} - - explicit Matrix( const glm::mat4& matrix ) : glm::mat4( matrix ) {} - }; - - class TransformComponent - { - Coordinate m_position; - Scale m_scale; - QuatRotation m_rotation; - - public: - - TransformComponent(); - - Matrix mat() const; - }; - } // namespace v2 - template < MatrixType > class Matrix;