/*****************************************************************************
 * $Id: eng_event.cc,v 1.2 2006/11/08 00:15:19 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Engine events.
 *//*
 * LEGAL:   COPYRIGHT (C) 2006 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#define ENG_EVENT_CC 1
#include "eng.hh"
#include "eng_event.hh"

////////////////////////////////////////////////////////////////////////////////
//////////////////////////////  EngineEvents  //////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

/*****************************************************************************
 * Helpers to get enums.
 *****************************************************************************/
EngineEvents::eEyeChange
EngineEvents::EyeChangeEnumRotate( uint axis )
{
	ASSERT( CHECK_AXIS(axis) );
	static const eEyeChange sTable[3] = { eEyeChange_PITCH,  // X
                                          eEyeChange_YAW,    // Y
                                          eEyeChange_ROLL }; // Z
	return sTable[axis];
}
EngineEvents::eEyeChange
EngineEvents::EyeChangeEnumTranslate( uint axis, int dir )
{
	ASSERT( CHECK_AXIS(axis) );
	static const eEyeChange sTable[6] = { eEyeChange_TRANSLATE_X_POS,
                                          eEyeChange_TRANSLATE_Y_POS,
                                          eEyeChange_TRANSLATE_Z_POS,
                                          eEyeChange_TRANSLATE_X_NEG,
                                          eEyeChange_TRANSLATE_Y_NEG,
                                          eEyeChange_TRANSLATE_Z_NEG };
    uint i = (dir < 0) ? axis+3 : axis;
    ASSERT( i < sizeof(sTable) );
	return sTable[i];
}
