Completed the board manager rewrite

This commit is contained in:
2024-08-22 21:07:32 -04:00
parent 48f83eee38
commit 3e4f0124db
17 changed files with 666 additions and 408 deletions

54
include/Vector3D.h Normal file
View File

@@ -0,0 +1,54 @@
#pragma once
#include <cstdint>
#include <cmath>
class V3D{
public:
V3D(uint32_t x=0, uint32_t y=0, uint32_t z=0):
x(x),
y(y),
z(z){}
V3D& operator=(const V3D &other){
this->x = other.x;
this->y = other.y;
this->z = other.z;
return *this;
}
V3D& operator+(const V3D &other){
V3D vector{};
vector.x = this->x + other.x;
vector.y = this->y + other.y;
vector.z = this->z + other.z;
return vector;
}
V3D& operator-(const V3D &other){
V3D vector{};
vector.x = this->x - other.x;
vector.y = this->y - other.y;
vector.z = this->z - other.z;
return vector;
}
V3D operator/(const uint32_t scalar){
V3D vector{};
vector.x = this->x / scalar;
vector.y = this->y / scalar;
vector.z = this->z / scalar;
return vector;
}
bool operator==(const V3D &other){
return this->x == other.x && this->y == other.y && this->z == other.z;
}
float magnitude(){
return std::sqrt(this->x * this->x + this->y * this->y + this->z * this-> z);
}
uint32_t x;
uint32_t y;
uint32_t z;
};