#ifndef VEC3_H
#define VEC3_H

#include "Vec.h"

namespace Salamander
{

/*
** A Three-Dimensional implementation of a vector. Defines the additional operators:
**		|	Cross Product
*/

class Vec3 : public Vec<Vec3>
{
public:
	Vec3(double x = 0.0f, 
		 double y = 0.0f,
		 double z = 0.0f);
	virtual ~Vec3();

public:
	// Comparison Operators
	virtual bool operator== (const Vec3& v);	// Equals
	virtual bool operator!= (const Vec3& v);	// Does not equal

	// Unary Operators
	Vec3 operator-();			// Negate

	// Scalar Operators
	Vec3 operator* (double s);	// Scalar multiply
	Vec3 operator/ (double s);	// Scalar divide

	// Vector Operators
	Vec3 operator+ (const Vec3& v);		// Component add
	Vec3 operator- (const Vec3& v);		// Component subtract
	double operator* (const Vec3& v);	// Dot product
	Vec3 operator^ (const Vec3& v);		// Cross product
	Vec3 operator/ (const Vec3& v);		// Component divide

	// Additive Operators
	Vec3& operator*= (double s);	// Scalar multiply increment
	Vec3& operator/= (double s);	// Scalar divide increment
	Vec3& operator+= (const Vec3& v);	// Vector increment
	Vec3& operator-= (const Vec3& v);	// Vector decrement

	// Properties
	double length();
	double lengthSquared();

	// Other operations
	Vec3& normalise();		// Normalise this vector
	Vec3 normal();			// Return a normalised copy

public:
	double x_, y_, z_;

};

}
#endif // VEC3_H


