// GUICamera.cpp: implementation of the GUICamera class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MW4GameEd2.h"
#include "GUICamera.h"
#include <MW4\CameraShip.hpp>


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

GUICamera::GUICamera()
{
Changeable=false;
}

void GUICamera::Copy(GUICamera &obj)
{
	EdGameObject::Copy(obj);
}

EdGUIObject *GUICamera::Clone()
{
	GUICamera *obj=new GUICamera;
	obj->Copy(*this);
	return obj;
}

GUICamera::GUICamera(CString name,Point3D &pnt)
{
	BuildFrom(CString("Misc\\CameraShip\\CameraShip.instance"),name);
	SetPos(pnt);
}


void GUICamera::BuildDisplayInfoFromData()
{
		if(LineList) delete LineList;
		Scalar rad=5;
		LineCount=17;
		
		LineList=new GUILine[LineCount];


		LineList[0].SetLine(Point3D(-rad,-rad,-rad),
							Point3D(rad,-rad,-rad));
		LineList[1].SetLine(Point3D(rad,-rad,-rad),
							Point3D(rad,-rad,rad));
		LineList[2].SetLine(Point3D(rad,-rad,rad),
							Point3D(-rad,-rad,rad));
		LineList[3].SetLine(Point3D(-rad,-rad,rad),
							Point3D(-rad,-rad,-rad));

		LineList[4].SetLine(Point3D(-rad,rad,-rad),
							Point3D(rad,rad,-rad));
		LineList[5].SetLine(Point3D(rad,rad,-rad),
							Point3D(rad,rad,rad));
		LineList[6].SetLine(Point3D(rad,rad,rad),
							Point3D(-rad,rad,rad));
		LineList[7].SetLine(Point3D(-rad,rad,rad),
							Point3D(-rad,rad,-rad));

		LineList[8].SetLine(Point3D(-rad,-rad,-rad),
							Point3D(-rad,rad,-rad));
		LineList[9].SetLine(Point3D(rad,-rad,rad),
							Point3D(rad,rad,rad));
		LineList[10].SetLine(Point3D(-rad,-rad,rad),
							Point3D(-rad,rad,rad));
		LineList[11].SetLine(Point3D(rad,-rad,-rad),
							Point3D(rad,rad,-rad));

		LineList[12].SetLine(Point3D(rad*0.05f,rad*0.05f,rad),
							Point3D(rad*0.05f,rad*0.05f,rad*3));
		LineList[13].SetLine(Point3D(rad*0.05f,rad*0.05f,rad*3),
							Point3D(rad,rad*0.05f,rad*2));
		LineList[14].SetLine(Point3D(rad*0.05f,rad*0.05f,rad*3),
							Point3D(-rad,rad*0.05f,rad*2));
		LineList[15].SetLine(Point3D(rad*0.05f,rad*0.05f,rad*3),
							Point3D(rad*0.05f,rad,rad*2));
		LineList[16].SetLine(Point3D(rad*0.05f,rad*0.05f,rad*3),
							Point3D(rad*0.05f,-rad,rad*2));

		BuildRadius();

}

GUICamera::~GUICamera()
{
}

