Implement constant Vector4s

This commit is contained in:
2024-01-30 21:35:41 -05:00
parent 710a41cbb1
commit 0c20e9bb21
2 changed files with 11 additions and 0 deletions

View File

@@ -1,8 +1,12 @@
#pragma once
#include <J3ML/J3ML.h>
#include <J3ML/LinearAlgebra.h>
#include <cstddef>
namespace LinearAlgebra {
using namespace J3ML;
/// A 2D (x, y) ordered pair.
class Vector2 {
public:
@@ -65,6 +69,11 @@ namespace LinearAlgebra {
float Magnitude() const;
static float Magnitude(const Vector2& of);
bool IsFinite() const;
static bool IsFinite(const Vector2& v);

View File

@@ -9,6 +9,8 @@
namespace LinearAlgebra {
const Vector4 Vector4::Zero = {0,0,0,0};
const Vector4 Vector4::NaN = {NAN, NAN, NAN, NAN};
Vector4::Vector4(): x(0), y(0), z(0), w(0)
{}