mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-31 09:32:02 +00:00
adding operator* for vector3f to please ZOE the tyrant
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -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,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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user