root/week1oplossing/vector3.h

User picture

Author: machiel.sleeuwaert

Revision: 13 («Previous)

(Oct 15 14:12 2008 UTC) Over 3 years ago


  

 
Show/hide line numbers
#pragma once
#include "GameEngine.h"
namespace Machiel
{
	class Vector3
	{
		

	public:
		// constructoren
		Vector3();
		Vector3(float x, float y, float z);

		// destructor
		~Vector3();

		tstring ToString();

		// operatoren:
		// +, -, *
		// +=, -=, *=
		// ==, !=

		// copy constructor en assignment operator moeten 
		// public zijn (ofwel defaults, ofwel zelf 
		// geschreven)

		Vector3(const Vector3& p);	
		Vector3& operator=(const Vector3& p);
		Vector3 operator+(const Vector3& p);
		Vector3 operator-(const Vector3& p);
		Vector3 operator*(const Vector3& p);
		Vector3& operator+=(const Vector3& p);
		Vector3& operator-=(const Vector3& p);
		Vector3& operator*=(const Vector3& p);
		bool operator==(const Vector3& p);
		bool operator!=(const Vector3& p);
	private:
		float m_x,m_y,m_z;

		friend tstringstream& operator<<(tstringstream& stream, Vector3& vector3);
		friend tstring operator+(tstring string, Vector3& vector3);
		friend Vector3 operator*(int n, Vector3& vector3);
	};




}