//*******************************************************************
// File: Asura_XBox360_VectorMaths.cpp
//
// Created: 21 December 2006 DLH
//
// Description: 
//
//*******************************************************************

// system libraries
#include "Core/Asura.h"

#if defined( ASURA_USE_PLATFORM_VECTORS)
// main header
#include "Core/Asura_XBox360_VectorMaths.h"

// other libraries

// internal dependencies

//*******************************************************************
// Constants
//*******************************************************************


//*******************************************************************
// Local Classes
//*******************************************************************


//*******************************************************************
// Local Data
//*******************************************************************


//*******************************************************************
// Function Definitions
//*******************************************************************


// transform by matrix 4x4
//Asura_AVector3 Asura_AVector3::operator * ( const Asura_AMatrix3x3& xMat) const


//////////////////////////////////////////////////////////////////////////
// Asura_AVector3
//////////////////////////////////////////////////////////////////////////
void Asura_AVector3::SelectGE(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS,
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x >= xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y >= xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z >= xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}
void Asura_AVector3::SelectGT(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS, 
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x > xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y > xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z > xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}
void Asura_AVector3::SelectLE(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS,
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x <= xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y <= xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z <= xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}
void Asura_AVector3::SelectLT(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS,
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x < xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y < xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z < xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}
void Asura_AVector3::SelectEQ(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS,
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x == xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y == xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z == xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}
void Asura_AVector3::SelectNE(Asura_AVector3_InParam xLHS, Asura_AVector3_InParam xRHS,
							  Asura_AVector3_InParam xTrue, Asura_AVector3_InParam xFalse)
{
	m_xVector4.x = xLHS.m_xVector4.x != xRHS.m_xVector4.x ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y = xLHS.m_xVector4.y != xRHS.m_xVector4.y ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z = xLHS.m_xVector4.z != xRHS.m_xVector4.z ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
}


//////////////////////////////////////////////////////////////////////////
// Asura_AVector4
//////////////////////////////////////////////////////////////////////////
void Asura_AVector4::SelectGE(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x >= xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y >= xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z >= xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w >= xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}

void Asura_AVector4::SelectGT(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x > xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y > xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z > xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w > xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}

void Asura_AVector4::SelectLE(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x <= xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y <= xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z <= xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w <= xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}

void Asura_AVector4::SelectLT(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x <  xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y <  xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z <  xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w <  xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}

void Asura_AVector4::SelectEQ(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x == xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y == xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z == xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w == xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}

void Asura_AVector4::SelectNE(Asura_AVector4_InParam xLHS, Asura_AVector4_InParam xRHS,
							  Asura_AVector4_InParam xTrue, Asura_AVector4_InParam xFalse)
{
	m_xVector4.x	= (xLHS.m_xVector4.x != xRHS.m_xVector4.x) ? xTrue.m_xVector4.x : xFalse.m_xVector4.x;
	m_xVector4.y	= (xLHS.m_xVector4.y != xRHS.m_xVector4.y) ? xTrue.m_xVector4.y : xFalse.m_xVector4.y;
	m_xVector4.z	= (xLHS.m_xVector4.z != xRHS.m_xVector4.z) ? xTrue.m_xVector4.z : xFalse.m_xVector4.z;
	m_xVector4.w	= (xLHS.m_xVector4.w != xRHS.m_xVector4.w) ? xTrue.m_xVector4.w : xFalse.m_xVector4.w;
}


//*******************************************************************
//
// (c) 2006 Rebellion
//
// Warning: This computer program is protected by copyright law and 
// international treaties. Unauthorized reproduction or distribution
// of this program, or any portion of it, may result in severe civil and
// criminal penalties, and will be prosecuted to the maximum extent 
// possible under the law.
//
//*******************************************************************
#endif //ASURA_USE_PLATFORM_VECTORS


/// End of file. ///
