diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index eb17b93ccc..44132ff013 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -1010,9 +1010,11 @@ getRotation3D : function ( /** * @method getNodeToParentAffineTransform - * @return {cc.AffineTransform} - */ -getNodeToParentAffineTransform : function ( +* @param {cc.Node} node +* @return {cc.AffineTransform|cc.AffineTransform} +*/ +getNodeToParentAffineTransform : function( +node ) { return cc.AffineTransform; @@ -1172,9 +1174,11 @@ getChildrenCount : function ( /** * @method getNodeToParentTransform - * @return {mat4_object} - */ -getNodeToParentTransform : function ( +* @param {cc.Node} node +* @return {mat4_object|mat4_object} +*/ +getNodeToParentTransform : function( +node ) { return cc.Mat4; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 8717e27753..877a9526e2 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -2645,19 +2645,46 @@ bool js_cocos2dx_Node_getRotation3D(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Node_getNodeToParentAffineTransform(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getNodeToParentAffineTransform : Invalid Native Object"); - if (argc == 0) { - cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(); - jsval jsret = JSVAL_NULL; - jsret = ccaffinetransform_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } + bool ok = true; - JS_ReportError(cx, "js_cocos2dx_Node_getNodeToParentAffineTransform : wrong number of arguments: %d, was expecting %d", argc, 0); + JS::RootedObject obj(cx); + cocos2d::Node* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getNodeToParentAffineTransform : Invalid Native Object"); + do { + if (argc == 1) { + cocos2d::Node* arg0; + do { + if (args.get(0).isNull()) { arg0 = nullptr; break; } + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(arg0); + jsval jsret = JSVAL_NULL; + jsret = ccaffinetransform_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 0) { + cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(); + jsval jsret = JSVAL_NULL; + jsret = ccaffinetransform_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_Node_getNodeToParentAffineTransform : wrong number of arguments"); return false; } bool js_cocos2dx_Node_convertTouchToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp) @@ -2974,19 +3001,46 @@ bool js_cocos2dx_Node_getChildrenCount(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Node_getNodeToParentTransform(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getNodeToParentTransform : Invalid Native Object"); - if (argc == 0) { - const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); - jsval jsret = JSVAL_NULL; - jsret = matrix_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } + bool ok = true; - JS_ReportError(cx, "js_cocos2dx_Node_getNodeToParentTransform : wrong number of arguments: %d, was expecting %d", argc, 0); + JS::RootedObject obj(cx); + cocos2d::Node* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getNodeToParentTransform : Invalid Native Object"); + do { + if (argc == 1) { + cocos2d::Node* arg0; + do { + if (args.get(0).isNull()) { arg0 = nullptr; break; } + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 ret = cobj->getNodeToParentTransform(arg0); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 0) { + const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); + jsval jsret = JSVAL_NULL; + jsret = matrix_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_Node_getNodeToParentTransform : wrong number of arguments"); return false; } bool js_cocos2dx_Node_convertToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp) diff --git a/cocos/scripting/lua-bindings/auto/api/Node.lua b/cocos/scripting/lua-bindings/auto/api/Node.lua index 7fd90a8953..e6ca67081d 100644 --- a/cocos/scripting/lua-bindings/auto/api/Node.lua +++ b/cocos/scripting/lua-bindings/auto/api/Node.lua @@ -345,11 +345,13 @@ -- @return Node#Node self (return value: cc.Node) -------------------------------- --- --- @function [parent=#Node] getNodeToParentAffineTransform +-- @overload self, cc.Node +-- @overload self +-- @function [parent=#Node] getNodeToParentAffineTransform -- @param self +-- @param #cc.Node ancestor -- @return AffineTransform#AffineTransform ret (return value: cc.AffineTransform) - + -------------------------------- -- -- @function [parent=#Node] isCascadeOpacityEnabled @@ -388,13 +390,13 @@ -- @return vec3_table#vec3_table ret (return value: vec3_table) -------------------------------- --- Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
--- The matrix is in Pixels.
--- return The transformation matrix. --- @function [parent=#Node] getNodeToParentTransform +-- @overload self, cc.Node +-- @overload self +-- @function [parent=#Node] getNodeToParentTransform -- @param self +-- @param #cc.Node ancestor -- @return mat4_table#mat4_table ret (return value: mat4_table) - + -------------------------------- -- converts a Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative).
-- param touch A given touch.
diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 0dc75a1c0e..f9068c3f24 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -4891,39 +4891,43 @@ int lua_cocos2dx_Node_getNodeToParentAffineTransform(lua_State* tolua_S) int argc = 0; cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToParentAffineTransform'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_getNodeToParentAffineTransform'", nullptr); - return 0; + do{ + if (argc == 1) { + cocos2d::Node* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:getNodeToParentAffineTransform"); + + if (!ok) { break; } + cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(arg0); + affinetransform_to_luaval(tolua_S, ret); + return 1; } - cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(); - affinetransform_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:getNodeToParentAffineTransform",argc, 0); + }while(0); + ok = true; + do{ + if (argc == 0) { + cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform(); + affinetransform_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:getNodeToParentAffineTransform",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -5176,39 +5180,43 @@ int lua_cocos2dx_Node_getNodeToParentTransform(lua_State* tolua_S) int argc = 0; cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToParentTransform'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_getNodeToParentTransform'", nullptr); - return 0; + do{ + if (argc == 1) { + cocos2d::Node* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.Node:getNodeToParentTransform"); + + if (!ok) { break; } + cocos2d::Mat4 ret = cobj->getNodeToParentTransform(arg0); + mat4_to_luaval(tolua_S, ret); + return 1; } - const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); - mat4_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:getNodeToParentTransform",argc, 0); + }while(0); + ok = true; + do{ + if (argc == 0) { + const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); + mat4_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:getNodeToParentTransform",argc, 0); return 0; #if COCOS2D_DEBUG >= 1