Implementing merge + fixing Angle datatype
This commit is contained in:
@@ -11,7 +11,7 @@ endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
#set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_CXX_FLAGS "-municode")
|
||||
#set(CMAKE_CXX_FLAGS "-municode")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
# Enable Package Managers
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <bits/ranges_algo.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include <glm/ext/scalar_constants.hpp>
|
||||
|
||||
@@ -12,7 +12,7 @@ inline float lerp(float a, float b, float t) {
|
||||
|
||||
// A stab at a vector<length> implementation suitable for game engineering
|
||||
template <std::size_t length>
|
||||
class numeric_vector<length> {
|
||||
class numeric_vector {
|
||||
public:
|
||||
virtual float operator[](std::size_t index) = 0;
|
||||
};
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
float yaw;
|
||||
float roll;
|
||||
bool operator==(const Angle& a) const {
|
||||
return (x == a.x) && (y == a.y) && (z == a.z);
|
||||
return (pitch == a.pitch) && (yaw == a.yaw) && (roll == a.roll);
|
||||
}
|
||||
void clamp() {
|
||||
if (this->x > 89.0f)
|
||||
|
@@ -78,9 +78,9 @@ vector3 vector3::max(const vector3& max) const
|
||||
vector3 vector3::clamp(const vector3& min, const vector3& max) const
|
||||
{
|
||||
return {
|
||||
std::ranges::clamp(min.x, this->x, max.x),
|
||||
std::ranges::clamp(min.y, this->y, max.y),
|
||||
std::ranges::clamp(min.z, this->z, max.z)
|
||||
std::clamp(min.x, this->x, max.x),
|
||||
std::clamp(min.y, this->y, max.y),
|
||||
std::clamp(min.z, this->z, max.z)
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user