adding operator* for vector3f to please ZOE the tyrant

This commit is contained in:
Clément Le Bihan
2021-05-26 17:21:01 +02:00
parent 864e75c555
commit e70dbd5b3b
4 changed files with 22 additions and 3 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ set(SOURCES
add_executable(bomberman
sources/main.cpp
${SOURCES}
)
sources/Models/Vector3.cpp)
target_include_directories(bomberman PUBLIC sources)
target_link_libraries(bomberman PUBLIC wal ray)
+13
View File
@@ -0,0 +1,13 @@
//
// Created by cbihan on 26/05/2021.
//
#include "Vector3.hpp"
namespace BBM
{
RAY::Vector3 operator*(const Vector3f &v)
{
return {v.x, v.y, v.z};
}
}
+7 -1
View File
@@ -7,6 +7,7 @@
#include <iostream>
#include <cmath>
#include "Vector/Vector3.hpp"
namespace BBM
{
@@ -157,7 +158,12 @@ namespace BBM
typedef Vector3<float> Vector3f;
typedef Vector3<unsigned> Vector3u;
typedef Vector3<int> Vector3i;
} // namespace WAL
RAY::Vector3 operator*(const Vector3f &v);
}
template<typename T>
std::ostream &operator<<(std::ostream &s, const BBM::Vector3<T> &v)
+1 -1
View File
@@ -36,7 +36,7 @@ namespace BBM
auto &comp = entity.getComponent<Drawable3DComponent<T>>();
auto &pos = entity.getComponent<PositionComponent>();
comp.member.setPosition(Utils::toRAY(pos.position));
comp.member.setPosition(*pos.position);
comp.member.drawOn(this->_window);
}