I'm pretty sure the error is saying that I have no constructor which takes in no parameters, but I'm not even trying to call such a constructor in the first place.
//Vector2.h
#pragma once
class Vector2
{
public:
float x, y;
Vector2(float x, float y) ;
Vector2 Normalize();
Vector2 operator+(const Vector2 rhs);
Vector2 operator-(const Vector2 rhs);
};
//Vector2.cpp
#include <iostream>
#include "Vector2.h"
Vector2::Vector2(float x, float y)
{
this->x = x;
this->y = y;
}
Vector2 Vector2::Normalize()
{
float lengthSq = x * x + y * y;
if (lengthSq > 0.0f) {
float invLength = 1.0f / std::sqrt(lengthSq);
return Vector2(
x *= invLength,
y *= invLength
);
}
}
Vector2 Vector2::operator+(Vector2 rhs)
{
this->x += rhs.x;
this->y += rhs.y;
}
Vector2 Vector2::operator-(Vector2 rhs)
{
this->x -= rhs.x;
this->y -= rhs.y;
}