-- $LastChangedDate: 2011-03-17 19:59:52 -0400 (Thu, 17 Mar 2011) $
-- Macros written in Lua to expand C++ code for bindings between C++/Lua.
-- Avoid lua_/LUA_ which is reserved by Lua.

bindTable = {

class = "Physics",
typesig = nil,
luaCanInstantiate = false,

headers =
[[
#include "base/module.hh"
using namespace base;
#include "physics/module.hh"
#include "physics/physics_control.hh"
using namespace physics;
]],

func_Enable = {
    comments = "Physics:Enable()",
    code = [[
        PhysicsControl::Enable( POP_BOOL( L ) );
    ]]
},

func_PermanentlyDisable = {
    comments = "Physics:PermanentlyDisable()",
    code = [[
        PhysicsControl::PermanentlyDisable();
    ]]
},

func_IfEnabled = {
    comments = "bool Physics:IfEnabled()",
    code = [[
        lua_pushboolean( L, PhysicsControl::IfEnabled() );
        return 1;  // stack items to return
    ]]
},

func_EnableStall = {
    comments = "Physics:EnableStall( bool )",
    code = [[
        PhysicsControl::EnableStall( POP_BOOL( L ) );
    ]]
},

func_IfStallEnabled = {
    comments = "bool Physics:IfStallEnabled()",
    code = [[
        lua_pushboolean( L, PhysicsControl::IfStallEnabled() );
        return 1;  // stack items to return
    ]]
},

func_KPH2Speed = {
    comments = "Speed Physics:KPH2Speed( kph )",
    code = [[
        const SpeedKPH kph( POP_FP( L ) );
        const Speed    speed( physics::conv::KPH2Speed( kph ) );
        lua_pushnumber( L, speed.FP() );
        return 1;  // stack items to return
    ]]
},

func_Speed2KPH = {
    comments = "KPH Physics:Speed2KPH( Speed )",
    code = [[
        const Speed    speed( POP_FP( L ) );
        const SpeedKPH speedKPH( physics::conv::Speed2KPH( speed ) );
        lua_pushnumber( L, speedKPH.FP() );
        return 1;  // stack items to return
    ]]
},

}
