/*****************************************************************************
 * $LastChangedDate: 2011-03-17 19:59:52 -0400 (Thu, 17 Mar 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Interface of C functions for Lua scripts.
 * @remarks @remarks module.txt documents how to export new C++ classes to Lua.
 *
 * ----------------------------
 * -- THIS IS AUTO-GENERATED --
 * ----------------------------
 *
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#include "base/module.hh"
using namespace base;
#include "object/module.hh"
#include "object/aircraft.hh"
using namespace object;
#include "program/module.hh"
#include "program/aircraft_models.hh"
using namespace program;
#include "lua_bind/module.hh"
#include "lua_bind/bind.hh"

namespace lua {


namespace bind {

#define BIND_CLASS_NAME      "Aircraft"
#define BIND_METATABLE_NAME  LUABIND_METATABLE_STRING(BIND_CLASS_NAME)

//==============================================================================
// C functions called by Lua that access C++ objects.
//==============================================================================
// Need a function to check typesig because of macro/template limitations.
#if ! DOXYGEN
INTERN void
CheckTypesigAircraft( shptr<Aircraft> obj )
{
    CHECK_TYPESIG(obj,TYPESIG_AIRCRAFT);
}
#endif // ! DOXYGEN

/*****************************************************************************
 * Lua's garbage collector indirectly invokes this C++ destructor.
 *****************************************************************************/
INTERN int 
Aircraft_Destroy( lua_State* L ) 
{ 
   try { 

        return DESTROY_USERDATA_SHPTR<Aircraft>( L, CheckTypesigAircraft );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:EnableBrakes(bool)
 *****************************************************************************/
INTERN int 
Aircraft_EnableBrakes( lua_State* L ) 
{ 
   try { 

        const bool enable = POP_BOOL( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->EnableBrakes( enable );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:EnableCoordinatedTurn( bool )
 *****************************************************************************/
INTERN int 
Aircraft_EnableCoordinatedTurn( lua_State* L ) 
{ 
   try { 

        const bool coturn = POP_BOOL( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->EnableCoordinatedTurn( coturn );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * table Aircraft:GetMatrix()
 *****************************************************************************/
INTERN int 
Aircraft_GetMatrix( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        PUSH_TABLE_FROM_MATRIX( L, aircraft->GetMatrix() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * string Aircraft:GetName()
 *****************************************************************************/
INTERN int 
Aircraft_GetName( lua_State* L ) 
{ 
   try { 

        Aircraft* aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L ).PTR();
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushstring( L, aircraft->GetName().c_str() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:GetPhysics()
 *****************************************************************************/
INTERN int 
Aircraft_GetPhysics( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        return NEW_USERDATA_PTR( L,
                                 &aircraft->GetPhysics(),
                                 LUABIND_METATABLE_STRING("AircraftPhysics") );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Vec3 Aircraft:GetPosition()
 *****************************************************************************/
INTERN int 
Aircraft_GetPosition( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        const WorldVertex pos = aircraft->GetPosition();
        PUSH_VECTOR3( L, pos );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * number Aircraft:GetRawPtr()
 *****************************************************************************/
INTERN int 
Aircraft_GetRawPtr( lua_State* L ) 
{ 
   try { 

        Aircraft* aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L ).PTR();
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushnumber( L, long(static_cast<Aircraft*>(aircraft)) );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * eState Aircraft:GetState()
 *****************************************************************************/
INTERN int 
Aircraft_GetState( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushnumber( L, aircraft->GetState() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * fp Aircraft:GetThrottle()
 *****************************************************************************/
INTERN int 
Aircraft_GetThrottle( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushnumber( L, aircraft->GetThrottle() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfBrakes()
 *****************************************************************************/
INTERN int 
Aircraft_IfBrakes( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfBrakes() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfCollidable()
 *****************************************************************************/
INTERN int 
Aircraft_IfCollidable( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfCollidable() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfCollision()
 *****************************************************************************/
INTERN int 
Aircraft_IfCollision( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfCollision() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfCollisionFatal()
 *****************************************************************************/
INTERN int 
Aircraft_IfCollisionFatal( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfCollisionFatal() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 *  bool Aircraft:IfCoordinatedTurnEnabled()
 *****************************************************************************/
INTERN int 
Aircraft_IfCoordinatedTurnEnabled( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfCoordinatedTurnEnabled() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfCoordinatedTurnExecuting()
 *****************************************************************************/
INTERN int 
Aircraft_IfCoordinatedTurnExecuting( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfCoordinatedTurnExecuting() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfHasPropeller()
 *****************************************************************************/
INTERN int 
Aircraft_IfHasPropeller( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfHasPropeller() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfLandingGear() / down=true
 *****************************************************************************/
INTERN int 
Aircraft_IfLandingGear( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfLandingGear() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfWheelBrakes()
 *****************************************************************************/
INTERN int 
Aircraft_IfWheelBrakes( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfWheelBrakes() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:IfZombie()
 *****************************************************************************/
INTERN int 
Aircraft_IfZombie( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        lua_pushboolean( L, aircraft->IfZombie() );
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:New( x,y,z|Vec3, Aircraft::eType, ModelCache.LOAD_SHARED|LOAD_COPY )
 *****************************************************************************/
INTERN int 
Aircraft_New( lua_State* L ) 
{ 
   try { 

        const bool          loadCopy     = POP_BOOL( L );
        const eAircraftType aircraftType = static_cast<eAircraftType>( POP_INT( L ) );
        const WorldVertex   pos          = POP_VECTOR3<WorldVertex>( L );
        shptr<Aircraft> aircraft = program::MakeAircraft( aircraftType, pos, loadCopy );
        return NEW_USERDATA_SHPTR<Aircraft>( L, aircraft, BIND_METATABLE_NAME );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:PhysicalRotate( axis, controlFraction, controlFreq )
 *****************************************************************************/
INTERN int 
Aircraft_PhysicalRotate( lua_State* L ) 
{ 
   try { 

        const Milliseconds controlFreq( POP_INT( L ) );
        const fp controlFrac = POP_FP( L );
        const uint axis  = POP_INT( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->PhysicalRotate( axis, controlFrac, controlFreq );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft.PlayEngineSound( volume )
 *****************************************************************************/
INTERN int 
Aircraft_PlayEngineSound( lua_State* L ) 
{ 
   try { 

        const fp volume = POP_FP( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->PlayEngineSound( volume );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:Reset()
 *****************************************************************************/
INTERN int 
Aircraft_Reset( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->Reset();
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:Rotate( axis, radian )
 *****************************************************************************/
INTERN int 
Aircraft_Rotate( lua_State* L ) 
{ 
   try { 

        const fp   radian = POP_FP( L );
        const uint axis   = POP_INT( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->Rotate( axis, radian );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetCollidable( bool )
 *****************************************************************************/
INTERN int 
Aircraft_SetCollidable( lua_State* L ) 
{ 
   try { 

        const bool f = POP_BOOL( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetCollidable( f );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetCollision( int )
 *****************************************************************************/
INTERN int 
Aircraft_SetCollision( lua_State* L ) 
{ 
   try { 

        const int collision = POP_INT( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetCollision( static_cast<Aircraft::eCollision>( collision ) );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetLandingGear( bool ) / down=true
 * SUBTLE: This is a NOP is speed is zero.
 * Use sim.LANDING_GEAR_UP/DOWN.
 *****************************************************************************/
INTERN int 
Aircraft_SetLandingGear( lua_State* L ) 
{ 
   try { 

        const bool down = POP_BOOL( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetLandingGear( down );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetMatrix( matrix )
 *****************************************************************************/
INTERN int 
Aircraft_SetMatrix( lua_State* L ) 
{ 
   try { 

        Matrix m; POP_TABLE_INTO_MATRIX( L, m );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetMatrix( m, Aircraft::PLACEMENT );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetPosition( x,y,z|Vec3 )
 *****************************************************************************/
INTERN int 
Aircraft_SetPosition( lua_State* L ) 
{ 
   try { 

        const WorldVertex pos = POP_VECTOR3<WorldVertex>( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetPosition( pos );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetShadowCaster( bool )
 *****************************************************************************/
INTERN int 
Aircraft_SetShadowCaster( lua_State* L ) 
{ 
   try { 

        // Should be called prior to SceneGraph::AttachObject() else no effect.
        const bool enable = POP_BOOL( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetShadowCaster( enable );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetState( eState )
 *****************************************************************************/
INTERN int 
Aircraft_SetState( lua_State* L ) 
{ 
   try { 

        const Aircraft::eState state = static_cast<Aircraft::eState>( POP_INT( L ) );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetState( state );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SetThrottle( fp )
 *****************************************************************************/
INTERN int 
Aircraft_SetThrottle( lua_State* L ) 
{ 
   try { 

        const fp throttle = POP_FP( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SetThrottle( throttle );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft.StopEngineSound()
 *****************************************************************************/
INTERN int 
Aircraft_StopEngineSound( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->StopEngineSound();
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SwingBayDoors( fraction ) safe NOP if aircraft has no bay
 *****************************************************************************/
INTERN int 
Aircraft_SwingBayDoors( lua_State* L ) 
{ 
   try { 

        const fp fraction = POP_FP( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SwingBayDoors( fraction );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:SwingWings( fraction ) safe NOP if not swing-wing aircraft
 *****************************************************************************/
INTERN int 
Aircraft_SwingWings( lua_State* L ) 
{ 
   try { 

        const fp fraction = POP_FP( L );
        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->SwingWings( fraction );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:ToggleBrakes()
 *****************************************************************************/
INTERN int 
Aircraft_ToggleBrakes( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->EnableBrakes( not aircraft->IfBrakes() );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * bool Aircraft:ToggleLandingGear() / returns true if landing gear changed state
 *****************************************************************************/
INTERN int 
Aircraft_ToggleLandingGear( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        const bool state = aircraft->IfLandingGear();
        aircraft->SetLandingGear( not state );
        lua_pushboolean( L, state != aircraft->IfLandingGear() );  // true if state changed
        return 1;  // stack items to return
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * Aircraft:Zombify()
 *****************************************************************************/
INTERN int 
Aircraft_Zombify( lua_State* L ) 
{ 
   try { 

        shptr<Aircraft> aircraft = POP_USERDATA_AS_SHPTR<Aircraft>( L );
        CHECK_TYPESIG(aircraft,TYPESIG_AIRCRAFT);
        aircraft->Zombify();
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

//==============================================================================
// Register binding with Lua. 
//==============================================================================

#if ! DOXYGEN 

INTERN const struct luaL_reg sMethodTable[] =
{
  { "New", Aircraft_New },
  { "__gc", Aircraft_Destroy },
  { "EnableBrakes", Aircraft_EnableBrakes },
  { "EnableCoordinatedTurn", Aircraft_EnableCoordinatedTurn },
  { "GetMatrix", Aircraft_GetMatrix },
  { "GetName", Aircraft_GetName },
  { "GetPhysics", Aircraft_GetPhysics },
  { "GetPosition", Aircraft_GetPosition },
  { "GetRawPtr", Aircraft_GetRawPtr },
  { "GetState", Aircraft_GetState },
  { "GetThrottle", Aircraft_GetThrottle },
  { "IfBrakes", Aircraft_IfBrakes },
  { "IfCollidable", Aircraft_IfCollidable },
  { "IfCollision", Aircraft_IfCollision },
  { "IfCollisionFatal", Aircraft_IfCollisionFatal },
  { "IfCoordinatedTurnEnabled", Aircraft_IfCoordinatedTurnEnabled },
  { "IfCoordinatedTurnExecuting", Aircraft_IfCoordinatedTurnExecuting },
  { "IfHasPropeller", Aircraft_IfHasPropeller },
  { "IfLandingGear", Aircraft_IfLandingGear },
  { "IfWheelBrakes", Aircraft_IfWheelBrakes },
  { "IfZombie", Aircraft_IfZombie },
  { "PhysicalRotate", Aircraft_PhysicalRotate },
  { "PlayEngineSound", Aircraft_PlayEngineSound },
  { "Reset", Aircraft_Reset },
  { "Rotate", Aircraft_Rotate },
  { "SetCollidable", Aircraft_SetCollidable },
  { "SetCollision", Aircraft_SetCollision },
  { "SetLandingGear", Aircraft_SetLandingGear },
  { "SetMatrix", Aircraft_SetMatrix },
  { "SetPosition", Aircraft_SetPosition },
  { "SetShadowCaster", Aircraft_SetShadowCaster },
  { "SetState", Aircraft_SetState },
  { "SetThrottle", Aircraft_SetThrottle },
  { "StopEngineSound", Aircraft_StopEngineSound },
  { "SwingBayDoors", Aircraft_SwingBayDoors },
  { "SwingWings", Aircraft_SwingWings },
  { "ToggleBrakes", Aircraft_ToggleBrakes },
  { "ToggleLandingGear", Aircraft_ToggleLandingGear },
  { "Zombify", Aircraft_Zombify },
  { NULL, NULL }
};

void
RegisterAircraft( lua_State* L )
{
    REGISTER_BINDING( L,
                      BIND_METATABLE_NAME,
                      BIND_CLASS_NAME,
                      sMethodTable );
}

#endif // ! DOXYGEN 

} // namespace bind 

} // namespace lua 
