//------------------------------------------------------------------------------------
// irr::core::vector2df wrappers (done)
//------------------------------------------------------------------------------------
extern "C" 
{

	// defaults: x=0.0f, y=0.0f
	vector2df* IrrCore_Vector2df_new(f32 x,f32 y)
	{
		vector2df* pRetVal=new vector2df(x,y);
		return pRetVal;
	}

	vector2df* IrrCore_Vector2df_newFromVal(f32 n)
	{
		return new vector2df(n);
	}
	
	vector2df* IrrCore_Vector2df_newFromVect(vector2df& other)
	{
		vector2df* pRetVal=new vector2df(other);
		return pRetVal;
	}
	
	void IrrCore_Vector2df_del(vector2df* delVect)
	{
		if (delVect>0)
			delete delVect;
		delVect=0;
	}
	
	vector2df* IrrCore_Vector2df_set(vector2df* vect,f32 x,f32 y)
	{
		if (vect>0)
			return &(vect->set(x,y));
		else return 0;
	}
	
	vector2df* IrrCore_Vector2df_setFromVect(vector2df* vect,vector2df* other)
	{
		if (vect>0)
			return &(vect->set(*other));
		else return 0;
	}
	
	f32 IrrCore_Vector2df_getX(vector2df* vect)
	{
		f32 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->X;
	
		return fRetVal;
	}
	
	f32 IrrCore_Vector2df_getY(vector2df* vect)
	{
		f32 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->Y;
	
		return fRetVal;
	}
	
	void IrrCore_Vector2df_setX(vector2df* vect,f32 x)
	{
		if (vect>0)
			vect->X=x;
	}
	
	void IrrCore_Vector2df_setY(vector2df* vect,f32 y)
	{
		if (vect>0)
			vect->Y=y;
	}
	
	f32 IrrCore_Vector2df_getLength(vector2df* vect)
	{
		f32 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->getLength();
	
		return fRetVal;
	}
	
	f32 IrrCore_Vector2df_dotProduct(vector2df* vect,vector2df* other)
	{
		f32 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->dotProduct(*other);
	
		return fRetVal;
	}
	
	f32 IrrCore_Vector2df_getDistanceFrom(vector2df* vect,vector2df* other)
	{
		f32 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->getDistanceFrom(*other);
	
		return fRetVal;
	}
	
	vector2df* IrrCore_Vector2df_rotateBy(vector2df* vect,f64 degrees,vector2df* center = 0)
	{
		if (vect>0)
			return &(vect->rotateBy(degrees,(center ? *center : vector2df())));
		else return 0;
	}
	
	// do not delete
	vector2df* IrrCore_Vector2df_normalize(vector2df* vect)
	{
		if (vect>0)
			return &vect->normalize();	
		else return 0;
	}

	f64 IrrCore_Vector2df_getAngleTrig(vector2df* vect)
	{
		if (vect)
			return vect->getAngleTrig();
		else return 0.0;
	}
	
	f64 IrrCore_Vector2df_getAngle(vector2df* vect)
	{
		f64 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->getAngle();
	
		return fRetVal;
	}
	
	f64 IrrCore_Vector2df_getAngleWith(vector2df* vect,vector2df* other)
	{
		f64 fRetVal=0.0;
	
		if (vect>0)
			fRetVal=vect->getAngleWith(*other);
	
		return fRetVal;
	}
	
	vector2df* IrrCore_Vector2df_setEq(vector2df* vect,vector2df* other)
	{
		if (vect>0) {
			*vect=*other;
			return vect;
		} else return 0;
	}
	
	bool IrrCore_Vector2df_EqEq(vector2df* vect,vector2df* other)
	{
		bool lRetVal=false;
	
		if (vect>0)
			lRetVal=(*vect==*other);
	
		return lRetVal;
	}
	
	bool IrrCore_Vector2df_NotEq(vector2df* vect,vector2df* other)
	{
		bool lRetVal=false;
	
		if (vect>0)
			lRetVal=(*vect!=*other);
	
		return lRetVal;
	}
	
	vector2df* IrrCore_Vector2df_PlusVect(vector2df* vect,vector2df* other)
	{
		vector2df* pRetVal=new vector2df((*vect+*other));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_PlusEqVect(vector2df* vect,vector2df* other)
	{
		if (vect>0) {
			*vect+=*other;
			return vect;
		} else return 0;
	}

	vector2df* IrrCore_Vector2df_Plus(vector2df* vect,f32 val)
	{
		vector2df* pRetVal=new vector2df((*vect + val));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_PlusEq(vector2df* vect,f32 val)
	{
		if (vect>0) {
			*vect += val;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_MinusVect(vector2df* vect,vector2df* other)
	{
		vector2df* pRetVal=new vector2df((*vect-*other));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_MinusEqVect(vector2df* vect,vector2df* other)
	{
		if (vect>0) {
			*vect-=*other;
			return vect;
		} else return 0;
	}

	vector2df* IrrCore_Vector2df_Minus(vector2df* vect,f32 val)
	{
		vector2df* pRetVal=new vector2df((*vect - val));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_MinusEq(vector2df* vect,f32 val)
	{
		if (vect>0) {
			*vect -= val;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_MultVect(vector2df* vect,vector2df* other)
	{
		vector2df* pRetVal=new vector2df((*vect * *other));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_Mult(vector2df* vect,f32 v)
	{
		vector2df* pRetVal=new vector2df((*vect*v));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_MultEqVect(vector2df* vect,vector2df* other)
	{
		if (vect>0) {
			*vect*=*other;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_MultEq(vector2df* vect,f32 v)
	{
		if (vect>0) {
			*vect*=v;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_DivVect(vector2df* vect,vector2df* other)
	{
		vector2df* pRetVal=new vector2df((*vect / *other));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_Div(vector2df* vect,f32 v)
	{
		vector2df* pRetVal=new vector2df((*vect / v));
		return pRetVal;
	}
	
	vector2df* IrrCore_Vector2df_DivEqVect(vector2df* vect,vector2df* other)
	{
		if (vect>0) {
			*vect/=*other;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_DivEq(vector2df* vect,f32 v)
	{
		if (vect>0) {
			*vect/=v;
			return vect;
		} else return 0;
	}
	
	vector2df* IrrCore_Vector2df_interpolate(vector2df* vect,vector2df* a, vector2df* b, f32 t)
	{
		if (vect)
			return &(vect->interpolate(*a,*b,t));
		else return 0;
	}

	bool IrrCore_Vector2df_LessEq(vector2df* vect,const vector2df& other)	
	{
		if (vect)
			return *vect <= other;
		else return false;
	}
	
	bool IrrCore_Vector2df_GreatEq(vector2df* vect,const vector2df& other)
	{
		if (vect)
			return *vect >= other;
		else return false;
	}

	bool IrrCore_Vector2df_Less(vector2df* vect,const vector2df& other)
	{
		if (vect)
			return *vect < other;
		else return false;
	}

	bool IrrCore_Vector2df_Great(vector2df* vect,const vector2df& other)
	{
		if (vect)
			return *vect > other;
		else return false;
	}

	bool IrrCore_Vector2df_equals(vector2df* vect,const vector2df& other)
	{
		if (vect)
			return vect->equals(other);
		else return false;
	}
	
	f32 IrrCore_Vector2df_getLengthSQ(vector2df* vect)
	{
		if (vect)
			return vect->getLengthSQ();
		else return 0.0;
	}
	
	f32 IrrCore_Vector2df_getDistanceFromSQ(vector2df* vect,const vector2df& other)
	{
		if (vect)
			return vect->getDistanceFromSQ(other);
		else return 0.0;
	}
	
	bool IrrCore_Vector2df_isBetweenPoints(vector2df* vect,const vector2df& begin, const vector2df& end)
	{
		if (vect)
			return vect->isBetweenPoints(begin,end);
		else return false;
	}
	
	vector2df* IrrCore_Vector2df_getInterpolated_quadratic(vector2df* vect,const vector2df& v2, const vector2df& v3, const f64 d)
	{
		if (vect)
			return new vector2df(vect->getInterpolated_quadratic(v2,v3,d));
		else return 0;
	}
	
	vector2df* IrrCore_Vector2df_getInterpolated(vector2df* vect, const vector2df* other, f64 d)
	{
		if (vect)
			return new vector2df(vect->getInterpolated(*other, d));
		else return 0;
	}
	
}