diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js index b7b36f805e..01716a3a20 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_3d_auto_api.js @@ -1405,14 +1405,16 @@ getTerrainSize : function ( /** * @method getIntersectionPoint - * @param {cc.Ray} arg0 - * @return {vec3_object} - */ -getIntersectionPoint : function ( -ray +* @param {cc.Ray|cc.Ray} ray +* @param {vec3_object} vec3 +* @return {bool|vec3_object} +*/ +getIntersectionPoint : function( +ray, +vec3 ) { - return cc.Vec3; + return false; }, /** diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js index b347ba72e3..86a3561a4f 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_physics3d_auto_api.js @@ -888,6 +888,16 @@ PhysicsSprite3D : function ( */ cc.Physics3DWorld = { +/** + * @method setGravity + * @param {vec3_object} arg0 + */ +setGravity : function ( +vec3 +) +{ +}, + /** * @method stepSimulate * @param {float} arg0 @@ -929,11 +939,9 @@ physics3dworlddes }, /** - * @method removePhysics3DConstraint - * @param {cc.Physics3DConstraint} arg0 + * @method removeAllPhysics3DObjects */ -removePhysics3DConstraint : function ( -physics3dconstraint +removeAllPhysics3DObjects : function ( ) { }, @@ -973,9 +981,21 @@ hitresult }, /** - * @method removeAllPhysics3DObjects + * @method getGravity + * @return {vec3_object} */ -removeAllPhysics3DObjects : function ( +getGravity : function ( +) +{ + return cc.Vec3; +}, + +/** + * @method removePhysics3DConstraint + * @param {cc.Physics3DConstraint} arg0 + */ +removePhysics3DConstraint : function ( +physics3dconstraint ) { }, diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp index 81928ad133..2179d1bffe 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -4022,22 +4022,43 @@ bool js_cocos2dx_3d_Terrain_getIntersectionPoint(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Terrain* cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_getIntersectionPoint : Invalid Native Object"); - if (argc == 1) { - cocos2d::Ray arg0; - ok &= jsval_to_ray(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_getIntersectionPoint : Error processing arguments"); - cocos2d::Vec3 ret = cobj->getIntersectionPoint(arg0); - jsval jsret = JSVAL_NULL; - jsret = vector3_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_3d_Terrain_getIntersectionPoint : wrong number of arguments: %d, was expecting %d", argc, 1); + JS::RootedObject obj(cx); + cocos2d::Terrain* cobj = NULL; + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_getIntersectionPoint : Invalid Native Object"); + do { + if (argc == 2) { + cocos2d::Ray arg0; + ok &= jsval_to_ray(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + bool ret = cobj->getIntersectionPoint(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 1) { + cocos2d::Ray arg0; + ok &= jsval_to_ray(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 ret = cobj->getIntersectionPoint(arg0); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_3d_Terrain_getIntersectionPoint : wrong number of arguments"); return false; } bool js_cocos2dx_3d_Terrain_getNormal(JSContext *cx, uint32_t argc, jsval *vp) diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp index 34104d96da..06526eff62 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -2280,6 +2280,26 @@ void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObj JSClass *jsb_cocos2d_Physics3DWorld_class; JSObject *jsb_cocos2d_Physics3DWorld_prototype; +bool js_cocos2dx_physics3d_Physics3DWorld_setGravity(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : Invalid Native Object"); + if (argc == 1) { + cocos2d::Vec3 arg0; + ok &= jsval_to_vector3(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : Error processing arguments"); + cobj->setGravity(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -2357,32 +2377,20 @@ bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_init : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Invalid Native Object"); - if (argc == 1) { - cocos2d::Physics3DConstraint* 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::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Error processing arguments"); - cobj->removePhysics3DConstraint(arg0); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : Invalid Native Object"); + if (argc == 0) { + cobj->removeAllPhysics3DObjects(); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp) @@ -2446,20 +2454,50 @@ bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc, JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_rayCast : wrong number of arguments: %d, was expecting %d", argc, 3); return false; } -bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_physics3d_Physics3DWorld_getGravity(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::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_getGravity : Invalid Native Object"); if (argc == 0) { - cobj->removeAllPhysics3DObjects(); + cocos2d::Vec3 ret = cobj->getGravity(); + jsval jsret = JSVAL_NULL; + jsret = vector3_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_getGravity : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Invalid Native Object"); + if (argc == 1) { + cocos2d::Physics3DConstraint* 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::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Error processing arguments"); + cobj->removePhysics3DConstraint(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp) @@ -2766,15 +2804,17 @@ void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObje }; static JSFunctionSpec funcs[] = { + JS_FN("setGravity", js_cocos2dx_physics3d_Physics3DWorld_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("stepSimulate", js_cocos2dx_physics3d_Physics3DWorld_stepSimulate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("needCollisionChecking", js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("collisionChecking", js_cocos2dx_physics3d_Physics3DWorld_collisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("init", js_cocos2dx_physics3d_Physics3DWorld_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removePhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeAllPhysics3DObjects", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isDebugDrawEnabled", js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeAllPhysics3DConstraints", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("rayCast", js_cocos2dx_physics3d_Physics3DWorld_rayCast, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeAllPhysics3DObjects", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getGravity", js_cocos2dx_physics3d_Physics3DWorld_getGravity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removePhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addPhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setDebugDrawEnable", js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removePhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp index 3fac1aca43..ba6ab0adc9 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.hpp @@ -134,15 +134,17 @@ bool js_cocos2dx_physics3d_Physics3DWorld_constructor(JSContext *cx, uint32_t ar void js_cocos2dx_physics3d_Physics3DWorld_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_physics3d_Physics3DWorld_setGravity(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_collisionChecking(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_getGravity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/lua-bindings/auto/api/Physics3DWorld.lua b/cocos/scripting/lua-bindings/auto/api/Physics3DWorld.lua index 67257504df..7aff8dadb5 100644 --- a/cocos/scripting/lua-bindings/auto/api/Physics3DWorld.lua +++ b/cocos/scripting/lua-bindings/auto/api/Physics3DWorld.lua @@ -4,6 +4,13 @@ -- @extend Ref -- @parent_module cc +-------------------------------- +-- set gravity for the physics world +-- @function [parent=#Physics3DWorld] setGravity +-- @param self +-- @param #vec3_table gravity +-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld) + -------------------------------- -- Simulate one frame. -- @function [parent=#Physics3DWorld] stepSimulate @@ -24,10 +31,9 @@ -- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld) -------------------------------- --- Remove a Physics3DConstraint. --- @function [parent=#Physics3DWorld] removePhysics3DConstraint +-- Remove all Physics3DObjects. +-- @function [parent=#Physics3DWorld] removeAllPhysics3DObjects -- @param self --- @param #cc.Physics3DConstraint constraint -- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld) -------------------------------- @@ -43,9 +49,16 @@ -- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld) -------------------------------- --- Remove all Physics3DObjects. --- @function [parent=#Physics3DWorld] removeAllPhysics3DObjects +-- get current gravity +-- @function [parent=#Physics3DWorld] getGravity -- @param self +-- @return vec3_table#vec3_table ret (return value: vec3_table) + +-------------------------------- +-- Remove a Physics3DConstraint. +-- @function [parent=#Physics3DWorld] removePhysics3DConstraint +-- @param self +-- @param #cc.Physics3DConstraint constraint -- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.cpp index 115ba9609f..b46047fb8a 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.cpp @@ -3978,6 +3978,56 @@ int lua_register_cocos2dx_physics3d_PhysicsSprite3D(lua_State* tolua_S) return 1; } +int lua_cocos2dx_physics3d_Physics3DWorld_setGravity(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Physics3DWorld* 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.Physics3DWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Physics3DWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec3 arg0; + + ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.Physics3DWorld:setGravity"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'", nullptr); + return 0; + } + cobj->setGravity(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:setGravity",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_physics3d_Physics3DWorld_stepSimulate(lua_State* tolua_S) { int argc = 0; @@ -4122,7 +4172,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_collisionChecking(lua_State* tolua_S) return 0; } -int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* tolua_S) +int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* tolua_S) { int argc = 0; cocos2d::Physics3DWorld* cobj = nullptr; @@ -4142,32 +4192,29 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* t #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) + if (argc == 0) { - cocos2d::Physics3DConstraint* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Physics3DConstraint",&arg0, "cc.Physics3DWorld:removePhysics3DConstraint"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr); return 0; } - cobj->removePhysics3DConstraint(arg0); + cobj->removeAllPhysics3DObjects(); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removePhysics3DConstraint",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removeAllPhysics3DObjects",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'.",&tolua_err); #endif return 0; @@ -4266,7 +4313,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(lua_Stat return 0; } -int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* tolua_S) +int lua_cocos2dx_physics3d_Physics3DWorld_getGravity(lua_State* tolua_S) { int argc = 0; cocos2d::Physics3DWorld* cobj = nullptr; @@ -4286,7 +4333,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* t #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'", nullptr); return 0; } #endif @@ -4296,19 +4343,69 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* t { if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'", nullptr); return 0; } - cobj->removeAllPhysics3DObjects(); - lua_settop(tolua_S, 1); + cocos2d::Vec3 ret = cobj->getGravity(); + vec3_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removeAllPhysics3DObjects",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:getGravity",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Physics3DWorld* 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.Physics3DWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Physics3DWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Physics3DConstraint* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Physics3DConstraint",&arg0, "cc.Physics3DWorld:removePhysics3DConstraint"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr); + return 0; + } + cobj->removePhysics3DConstraint(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removePhysics3DConstraint",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'.",&tolua_err); #endif return 0; @@ -4630,13 +4727,15 @@ int lua_register_cocos2dx_physics3d_Physics3DWorld(lua_State* tolua_S) tolua_beginmodule(tolua_S,"Physics3DWorld"); tolua_function(tolua_S,"new",lua_cocos2dx_physics3d_Physics3DWorld_constructor); + tolua_function(tolua_S,"setGravity",lua_cocos2dx_physics3d_Physics3DWorld_setGravity); tolua_function(tolua_S,"stepSimulate",lua_cocos2dx_physics3d_Physics3DWorld_stepSimulate); tolua_function(tolua_S,"needCollisionChecking",lua_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking); tolua_function(tolua_S,"collisionChecking",lua_cocos2dx_physics3d_Physics3DWorld_collisionChecking); - tolua_function(tolua_S,"removePhysics3DConstraint",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint); + tolua_function(tolua_S,"removeAllPhysics3DObjects",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects); tolua_function(tolua_S,"isDebugDrawEnabled",lua_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled); tolua_function(tolua_S,"removeAllPhysics3DConstraints",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints); - tolua_function(tolua_S,"removeAllPhysics3DObjects",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects); + tolua_function(tolua_S,"getGravity",lua_cocos2dx_physics3d_Physics3DWorld_getGravity); + tolua_function(tolua_S,"removePhysics3DConstraint",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint); tolua_function(tolua_S,"addPhysics3DObject",lua_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject); tolua_function(tolua_S,"setDebugDrawEnable",lua_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable); tolua_function(tolua_S,"removePhysics3DObject",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.hpp index 0685ba505a..e2345e5253 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics3d_auto.hpp @@ -253,6 +253,8 @@ int register_all_cocos2dx_physics3d(lua_State* tolua_S); + +