#pragma once
#include <iostream>
#include <string>

using namespace std;

class Vector3
{
public:
	float data[3];
	Vector3();
	Vector3(float x, float y, float z);
	~Vector3(void);

	float* getData();

	float length() const;
	Vector3& normalize();
	void print() const;
	float dot(Vector3 other) const;
	Vector3 cross(Vector3 other) const;

	//Vector3 operator=(Vector3 other) const;

	bool operator==(Vector3 other) const;

	float& operator[](int ind);
	
	Vector3 operator*(float scale) const;
	Vector3& operator*=(float scale);

	Vector3 operator*(Vector3 other) const;
	Vector3& operator*=(Vector3 other);

	Vector3 operator/(float scale) const;
	Vector3& operator/=(float scale);

	Vector3 operator/(Vector3 other) const;
	Vector3& operator/=(Vector3 other);

	Vector3 operator+(Vector3 add) const;
	Vector3& operator+=(Vector3 add);

	Vector3 operator-(Vector3 sub) const;
	Vector3& operator-=(Vector3 sub);

	// cross product
	Vector3 operator^(Vector3 other) const;

	// dot product
	float operator|(Vector3 other) const;

	string toString() const;

	Vector3 operator-() const;
	
};

namespace boost
{
	namespace serialization
	{
		// Vector3
		template<class Archive>
		void serialize(Archive & ar, Vector3 & vector, const unsigned int version)
		{
			ar & vector.data;
		}
	}
}