diff --git a/sources/Component/Collision/CollisionComponent.hpp b/sources/Component/Collision/CollisionComponent.hpp index 77f5f429..02eaf4b9 100644 --- a/sources/Component/Collision/CollisionComponent.hpp +++ b/sources/Component/Collision/CollisionComponent.hpp @@ -15,6 +15,7 @@ namespace BBM { public: //! @brief Used to tell the collided axis + //! @note Usage: (collidedAxis (int given by callback)) & CollidedAxis::X enum CollidedAxis { X = 1, Y = 2, @@ -53,7 +54,7 @@ namespace BBM //! @brief Constructor of collider with no callback CollisionComponent(WAL::Entity &entity, Vector3f positionOffset, Vector3f bound); - //! @brief Constructor no callback, same boundSize for all axis + //! @brief Constructor no callback, same boundSize & positionOffset for all axis CollisionComponent(WAL::Entity &entity, float positionOffset, float boundSize); //! @brief Default copy constructor diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index 276afb29..30a1f21f 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -15,17 +15,9 @@ namespace BBM void MapGenerator::wallCollide(WAL::Entity &entity, const WAL::Entity &wall, int collidedAxis) { auto *mov = entity.tryGetComponent(); - auto posspec = entity.getComponent(); - auto posspecwall = wall.getComponent(); if (!mov) return; - - auto &pos = entity.getComponent(); - const auto &wallPos = wall.getComponent(); - auto diff = pos.position + mov->getVelocity() - wallPos.position; - //mov->_velocity = Vector3f(); - //return; if (collidedAxis & CollisionComponent::CollidedAxis::X) mov->_velocity.x = 0; if (collidedAxis & CollisionComponent::CollidedAxis::Y)