Refactored file layout because platformio failed to find things
This commit is contained in:
58
src/Vector3D.hpp
Normal file
58
src/Vector3D.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef VECTOR3D_H_
|
||||
#define VECTOR3D_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include "Matrix.hpp"
|
||||
|
||||
template <typename Type>
|
||||
class V3D
|
||||
{
|
||||
public:
|
||||
V3D(const Matrix<1, 3> &other);
|
||||
V3D(const Matrix<3, 1> &other);
|
||||
|
||||
V3D(const V3D &other);
|
||||
|
||||
V3D(Type x = 0, Type y = 0, Type z = 0);
|
||||
|
||||
template <typename OtherType>
|
||||
V3D(const V3D<OtherType> &other);
|
||||
|
||||
template <typename OtherType>
|
||||
operator OtherType() const;
|
||||
|
||||
std::array<Type, 3> ToArray() const;
|
||||
|
||||
V3D<Type> operator+(Type other) const;
|
||||
V3D<Type> operator+(const V3D<Type> &other) const;
|
||||
|
||||
V3D<Type> operator-(Type other) const;
|
||||
V3D<Type> operator-(const V3D<Type> &other) const;
|
||||
|
||||
V3D<Type> operator*(Type scalar) const;
|
||||
|
||||
V3D<Type> operator/(Type scalar) const;
|
||||
|
||||
void operator=(const V3D<Type> &other);
|
||||
|
||||
V3D<Type> &operator+=(Type other);
|
||||
V3D<Type> &operator+=(const V3D<Type> &other);
|
||||
|
||||
V3D<Type> &operator-=(Type other);
|
||||
V3D<Type> &operator-=(const V3D<Type> &other);
|
||||
|
||||
V3D<Type> &operator/=(Type scalar);
|
||||
|
||||
V3D<Type> &operator*=(Type scalar);
|
||||
|
||||
bool operator==(const V3D<Type> &other);
|
||||
|
||||
float magnitude();
|
||||
|
||||
Type x;
|
||||
Type y;
|
||||
Type z;
|
||||
};
|
||||
|
||||
#include "Vector3D.cpp"
|
||||
#endif // VECTOR3D_H_
|
||||
Reference in New Issue
Block a user