mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-02 10:15:32 +00:00
using the utils function (BBM vector3 -> RAY vector3)
This commit is contained in:
+2
-1
@@ -25,12 +25,13 @@ set(SOURCES
|
||||
sources/Component/Drawable/Drawable2DComponent.hpp
|
||||
sources/System/Renderer/Renderer3DSystem.hpp
|
||||
sources/System/Renderer/Renderer2DSystem.hpp
|
||||
sources/Util/Utils.cpp
|
||||
)
|
||||
|
||||
add_executable(bomberman
|
||||
sources/main.cpp
|
||||
${SOURCES}
|
||||
sources/System/Renderer/RenderScreenSystem.hpp)
|
||||
sources/System/Renderer/RenderScreenSystem.hpp sources/Util/Utils.hpp)
|
||||
target_include_directories(bomberman PUBLIC sources)
|
||||
target_link_libraries(bomberman PUBLIC wal ray)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "Entity/Entity.hpp"
|
||||
#include "Component/Position/PositionComponent.hpp"
|
||||
#include "Component/Drawable/Drawable3DComponent.hpp"
|
||||
#include "Util/Utils.hpp"
|
||||
#include "Window.hpp"
|
||||
|
||||
namespace BBM
|
||||
@@ -35,7 +36,7 @@ namespace BBM
|
||||
auto &comp = entity.getComponent<Drawable3DComponent<T>>();
|
||||
auto &pos = entity.getComponent<PositionComponent>();
|
||||
|
||||
comp.member.setPosition({pos.getX(), pos.getY(), pos.getZ()});
|
||||
comp.member.setPosition(Utils::toRAY(pos.position));
|
||||
comp.member.drawOn(this->_window);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,12 @@
|
||||
|
||||
#include "Vector/Vector3.hpp"
|
||||
#include "Models/Vector3.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
RAY::Vector3 toRAY(const WAL::Vector3f &wal)
|
||||
namespace BBM
|
||||
{
|
||||
return RAY::Vector3(wal.x, wal.y, wal.y);
|
||||
RAY::Vector3 Utils::toRAY(const BBM::Vector3f &wal)
|
||||
{
|
||||
return RAY::Vector3(wal.x, wal.y, wal.y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by cbihan on 26/05/2021.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Vector/Vector3.hpp"
|
||||
#include "Models/Vector3.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
struct Utils
|
||||
{
|
||||
static RAY::Vector3 toRAY(const BBM::Vector3f &wal);
|
||||
|
||||
//! @brief default ctor
|
||||
Utils() = default;
|
||||
//! @brief Default copy ctor
|
||||
Utils(const Utils &) = default;
|
||||
//! @brief Default dtor
|
||||
~Utils() = default;
|
||||
//! @brief Default assignment operator
|
||||
Utils &operator=(const Utils &) = default;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user