//////////////////////////////////////////////////////////////////////////////
//
// AVP_Sense_Vision_Sentrygun.h
//
// Created by WGP - 06 December 2006
//
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __AVP_SENSE_VISION_SENTRYGUN_H__
#define __AVP_SENSE_VISION_SENTRYGUN_H__ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

// Axon
#include "Knowledge/SenseTypes/Axon_Sense_Vision.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class AVP_Knowledge_System_Sentrygun;
class AVP_ServerEntity_Actor;

//////////////////////////////////////////////////////////////////////////////
//
// AVP_Sense_Vision
//
//////////////////////////////////////////////////////////////////////////////

class AVP_Sense_Vision_Sentrygun : public Axon_Sense_Vision
{

public:
	AVP_Sense_Vision_Sentrygun( AVP_Knowledge_System_Sentrygun* pxKnowledgeSystem );
	virtual ~AVP_Sense_Vision_Sentrygun();

	virtual void ReadFromChunkStream( Asura_Chunk_Stream& xStream );
	virtual void WriteToChunkStream( Asura_Chunk_Stream& xStream ) const;
	virtual void Update(const float fTimeslice);

	void SetVisionFOV( const float fRange, const float fTanHorHalfFOV, const float fTanVertUpHalfFOV, const float fTanVertDownHalfFOV ) { m_fRange = fRange; m_fTanFovX = fTanHorHalfFOV; m_fTanFovYUp = fTanVertUpHalfFOV; m_fTanFovYDown = fTanVertDownHalfFOV; }
	void SetVisionFireArc( const float fTanHorHalfFireArc ) { m_fTanArcX = fTanHorHalfFireArc; }

#ifndef ASURA_NO_DEBUG_OUTPUT
	static void RenderKnowledgeDebugInfo(Asura_Guid uGuid);
#endif

protected:
	AVP_Knowledge_System_Sentrygun* GetSentrygunKnowledgeSystem();
	bool LOSCheckOnActor( const AVP_ServerEntity_Actor* pxThreatActor );

	float	m_fTanArcX;

private:
	typedef Axon_Sense_Vision PARENT;
};

#endif //__AVP_SENSE_VISION_SENTRYGUN_H__
