int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S)
{
    int argc = 0;
    cocos2d::PhysicsWorld* cobj = nullptr;
    bool ok  = true;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif
    
#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"cc.PhysicsWorld",0,&tolua_err)) goto tolua_lerror;
#endif
    
    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);
    
#if COCOS2D_DEBUG >= 1
    if (!cobj)
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'", NULL);
        return 0;
    }
#endif
    
    argc = lua_gettop(tolua_S)-1;
    if (argc == 3)
    {
        std::function<bool (cocos2d::PhysicsWorld &, const cocos2d::PhysicsRayCastInfo &, void *)> arg0;
        cocos2d::Point arg1;
        cocos2d::Point arg2;
        LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
        do {
            arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool
            {                
                tolua_pushusertype(tolua_S, (void*)(&world), getLuaTypeName(&world, "cc.PhysicsWorld"));
                physics_raycastinfo_to_luaval(tolua_S, info);
                return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2);
            };
        } while(0);
        
        ok &= luaval_to_point(tolua_S, 3, &arg1);
        ok &= luaval_to_point(tolua_S, 4, &arg2);
        if(!ok)
            return 0;
        cobj->rayCast(arg0, arg1, arg2, nullptr);
        toluafix_remove_function_by_refid(tolua_S, handler);
        return 0;
    }
    CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "rayCast",argc, 4);
    return 0;
    
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'.",&tolua_err);
#endif
    
    return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S)
{
    int argc = 0;
    bool ok  = true;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif
    
#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertable(tolua_S,1,"cc.PhysicsShapePolygon",0,&tolua_err)) goto tolua_lerror;
#endif
    
    argc = lua_gettop(tolua_S) - 1;
    
    if (argc == 2)
    {
        double arg0;
        cocos2d::Point* arg1;
        int arg2 = 0;
        ok &= luaval_to_number(tolua_S, 2,&arg0);
        do {
            ok = luaval_to_array_of_Point(tolua_S, 3, &arg1, &arg2);
            if (nullptr == arg1){
                LUA_PRECONDITION( arg1, "Invalid Native Object");
            }} while (0);
        if(!ok)
        {
            CC_SAFE_FREE(arg1);
            return 0;
        }
        double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2);
        CC_SAFE_FREE(arg1);
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    if (argc == 2)
    {
        double arg0;
        cocos2d::Point* arg1;
        int arg2 = 0;
        cocos2d::Point arg3;
        ok &= luaval_to_number(tolua_S, 2,&arg0);
        do {
            ok = luaval_to_array_of_Point(tolua_S, 3, &arg1, &arg2);
            if (nullptr == arg1){
                LUA_PRECONDITION( arg1, "Invalid Native Object");
            }} while (0);
        ok &= luaval_to_point(tolua_S, 4, &arg3);
        if(!ok)
        {
            CC_SAFE_FREE(arg1);
            return 0;
        }
        double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3);
        CC_SAFE_FREE(arg1);
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "calculateMoment",argc, 3);
    return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment'.",&tolua_err);
#endif
    return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)
{
    int argc = 0;
    bool ok  = true;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif
    
#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertable(tolua_S,1,"cc.PhysicsShapePolygon",0,&tolua_err)) goto tolua_lerror;
#endif
    
    argc = lua_gettop(tolua_S) - 1;
    
    if (argc == 1)
    {
        cocos2d::Point* arg0;
        int arg1 = 0;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1);
        CC_SAFE_FREE(arg0);
        object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret);
        return 1;
    }
    if (argc == 2)
    {
        cocos2d::Point* arg0;
        int arg1 = 0;
        cocos2d::PhysicsMaterial arg2;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2);
        CC_SAFE_FREE(arg0);
        object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret);
        return 1;
    }
    if (argc == 3)
    {
        cocos2d::Point* arg0;
        int arg1 = 0;
        cocos2d::PhysicsMaterial arg2;
        cocos2d::Point arg3;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
        ok &= luaval_to_point(tolua_S, 4, &arg3);
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3);
        CC_SAFE_FREE(arg0);
        object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret);
        return 1;
    }
    CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 2);
    return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_create'.",&tolua_err);
#endif
    return 0;
}
int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)
{
    int argc = 0;
    bool ok  = true;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif
    
#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertable(tolua_S,1,"cc.PhysicsBody",0,&tolua_err)) goto tolua_lerror;
#endif
    
    argc = lua_gettop(tolua_S) - 1;
    
    if (argc == 1)
    {
        cocos2d::Point* arg0 = nullptr;
        int arg1 = 0;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1);
        CC_SAFE_FREE(arg0);
        do {
            if (nullptr != ret)
            {
                int ID = ret->_ID;
                int* luaID = &ret->_luaID;
                toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret, "cc.PhysicsBody");
            }
            else
            {
                lua_pushnil(tolua_S);
            }
        } while (0);
        return 1;
    }
    if (argc == 2)
    {
        cocos2d::Point* arg0;
        int arg1 = 0;
        cocos2d::PhysicsMaterial arg2;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2);
        CC_SAFE_FREE(arg0);
        do {

            if (nullptr != ret)
            {
                int ID = ret->_ID;
                int* luaID = &ret->_luaID;
                toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret, "cc.PhysicsBody");
            }
            else
            {
                lua_pushnil(tolua_S);
            }
        } while (0);
        return 1;
    }
    if (argc == 3)
    {
        cocos2d::Point* arg0;
        int arg1 = 0;
        cocos2d::PhysicsMaterial arg2;
        cocos2d::Point arg3;
        do {
            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
            if (nullptr == arg0){
                LUA_PRECONDITION( arg0, "Invalid Native Object");
            }} while (0);
        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
        ok &= luaval_to_point(tolua_S, 4, &arg3);
        if(!ok)
        {
            CC_SAFE_FREE(arg0);
            return 0;
        }
        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3);
        CC_SAFE_FREE(arg0);
        do {
            if (nullptr != ret)
            {
                int ID = ret->_ID;
                int* luaID = &ret->_luaID;
                toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret, "cc.PhysicsBody");
            }
            else
            {
                lua_pushnil(tolua_S);
            }
        } while (0);
        return 1;
    }
    CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "createPolygon",argc, 2);
    return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createPolygon'.",&tolua_err);
#endif
    return 0;
}
int lua_cocos2dx_dhspine_DHSkeleton_getIntersectionBySlot(lua_State* tolua_S)
{
    int argc = 0;
    cocos2d::DHSkeleton* cobj = nullptr;
    bool ok  = true;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif
    
    
#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"cc.DHSkeleton",0,&tolua_err)) goto tolua_lerror;
#endif
    
    cobj = (cocos2d::DHSkeleton*)tolua_tousertype(tolua_S,1,0);
    
#if COCOS2D_DEBUG >= 1
    if (!cobj)
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_dhspine_DHSkeleton_getIntersectionBySlot'", nullptr);
        return 0;
    }
#endif
    
    argc = lua_gettop(tolua_S)-1;
    if (argc == 3)
    {
        const char* arg0;
        cocos2d::Point arg1;
        cocos2d::Point arg2;
        
        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.DHSkeleton:getIntersectionBySlot"); arg0 = arg0_tmp.c_str();
        
        ok &= luaval_to_point(tolua_S, 3, &arg1, "cc.DHSkeleton:getIntersectionBySlot");
        
        ok &= luaval_to_point(tolua_S, 4, &arg2, "cc.DHSkeleton:getIntersectionBySlot");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_dhspine_DHSkeleton_getIntersectionBySlot'", nullptr);
            return 0;
        }
        std::pair<bool, cocos2d::Vec2> ret = cobj->getIntersectionBySlot(arg0, arg1, arg2);
        
        lua_newtable(tolua_S);
        lua_pushstring(tolua_S, "intersect");
        tolua_pushboolean(tolua_S, ret.first);
        lua_rawset(tolua_S, -3);
        lua_pushstring(tolua_S, "pointX");
        lua_pushnumber(tolua_S, (lua_Number) ret.second.x);
        lua_rawset(tolua_S, -3);
        lua_pushstring(tolua_S, "pointY");
        lua_pushnumber(tolua_S, (lua_Number) ret.second.y);
        lua_rawset(tolua_S, -3);
        
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.DHSkeleton:getIntersectionBySlot",argc, 3);
    return 0;
    
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_dhspine_DHSkeleton_getIntersectionBySlot'.",&tolua_err);
#endif
    
    return 0;
}