/* 
 * 
 * Confidential Information of Telekinesys Research Limited (t/a Havok).  Not for disclosure or distribution without Havok's
 * prior written consent.This software contains code, techniques and know-how which is confidential and proprietary to Havok.
 * Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2008 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
 * 
 */
#include <Demos/demos.h>
#include <Demos/DemoCommon/Utilities/Drawing/DrawUtils.h>

void hkDrawBase::drawLine(hkVector4Parameter a, hkVector4Parameter b, ColorARGB color)
{
	HK_DISPLAY_LINE( a,b, color);
}

void hkDrawBase::fillTriangle(hkVector4Parameter a, hkVector4Parameter b, hkVector4Parameter c, ColorARGB color)
{
	HK_DISPLAY_TRIANGLE( a,b,c, color);
}

void hkDrawBase::wireTriangle(hkVector4Parameter a, hkVector4Parameter b, hkVector4Parameter c, ColorARGB color)
{
	HK_DISPLAY_LINE( a,b, color);
	HK_DISPLAY_LINE( b,c, color);
	HK_DISPLAY_LINE( c,a, color);
}

void hkDrawBase::fillRectangle(hkVector4Parameter center, hkVector4Parameter x, hkVector4Parameter y, ColorARGB color)
{
	hkVector4 a = center; a.add4(y); a.add4(x);
	hkVector4 b = center; b.add4(y); b.sub4(x);
	hkVector4 c = center; c.sub4(y); c.sub4(x);
	hkVector4 d = center; d.sub4(y); d.add4(x);

	HK_DISPLAY_TRIANGLE( a,b,c, color);
	HK_DISPLAY_TRIANGLE( a,c,d, color);
}

void hkDrawBase::wireRectangle(hkVector4Parameter center, hkVector4Parameter x, hkVector4Parameter y, ColorARGB color)
{
	hkVector4 a = center; a.add4(y); a.add4(x);
	hkVector4 b = center; b.add4(y); b.sub4(x);
	hkVector4 c = center; c.sub4(y); c.sub4(x);
	hkVector4 d = center; d.sub4(y); d.add4(x);

	HK_DISPLAY_LINE( a,b, color);
	HK_DISPLAY_LINE( b,c, color);
	HK_DISPLAY_LINE( c,d, color);
	HK_DISPLAY_LINE( d,a, color);
}

hkQuadReal hkDrawBase::s_x2d = HK_QUADREAL_CONSTANT( 1,0,0,1);
hkQuadReal hkDrawBase::s_y2d = HK_QUADREAL_CONSTANT( 0,1,0,1);
hkQuadReal hkDrawBase::s_n2d = HK_QUADREAL_CONSTANT( 0,0,1,0);

/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20080529)
*
* Confidential Information of Havok.  (C) Copyright 1999-2008 
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates 
* acceptance of the End User licence Agreement for this product. A copy of 
* the license is included with this software and is also available at
* www.havok.com/tryhavok
*
*/
