axmol/extensions/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_physics_manual...

1773 lines
56 KiB
C++
Raw Normal View History

/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
2021-10-11 12:15:41 +08:00
Copyright (c) 2021 Bytedance Inc.
https://axis-project.github.io/
2021-12-25 10:04:45 +08:00
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
2021-12-25 10:04:45 +08:00
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
2021-12-25 10:04:45 +08:00
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.hpp"
2014-03-10 14:04:58 +08:00
#if CC_USE_PHYSICS
2021-12-25 10:04:45 +08:00
# include "scripting/lua-bindings/manual/tolua_fix.h"
# include "scripting/lua-bindings/manual/LuaBasicConversions.h"
# include "scripting/lua-bindings/manual/CCLuaValue.h"
# include "scripting/lua-bindings/manual/CCLuaEngine.h"
# include "2d/CCScene.h"
# ifndef CC_SAFE_DELETE_ARRAY
# define do \
{ \
if (p) \
{ \
delete[](p); \
(p) = nullptr; \
} \
} \
while (0)
# endif
2014-03-10 14:04:58 +08:00
int lua_cocos2dx_physics_PhysicsBody_getJoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsBody* cobj = nullptr;
2021-12-25 10:04:45 +08:00
bool ok = true;
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsBody", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2021-12-25 10:04:45 +08:00
do
{
if (!ok)
2014-03-10 14:04:58 +08:00
return 0;
auto& ret = cobj->getJoints();
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_newtable(tolua_S);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (ret.empty())
return 1;
2021-12-25 10:04:45 +08:00
auto iter = ret.begin();
int indexTable = 1;
2014-03-10 14:04:58 +08:00
for (; iter != ret.end(); ++iter)
{
if (nullptr == *iter)
continue;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushnumber(tolua_S, (lua_Number)indexTable);
2021-12-25 10:04:45 +08:00
tolua_pushusertype(tolua_S, (void*)(*iter), getLuaTypeName(*iter, "cc.PhysicsJoint"));
2014-03-10 14:04:58 +08:00
lua_rawset(tolua_S, -3);
++indexTable;
}
} while (0);
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getJoints", argc, 0);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
2014-05-02 09:07:25 +08:00
int lua_cocos2dx_physics_PhysicsWorld_getScene(lua_State* tolua_S)
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsWorld* cobj = nullptr;
2021-10-11 12:15:41 +08:00
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# 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
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2014-05-02 09:07:25 +08:00
cocos2d::Scene& ret = cobj->getScene();
2021-12-25 10:04:45 +08:00
do
{
auto className = getLuaTypeName<Ref>(&ret, "cc.Scene");
2021-12-25 10:04:45 +08:00
int ID = (int)(ret._ID);
2014-03-10 14:04:58 +08:00
int* luaID = &(ret._luaID);
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)(&ret), className);
} while (0);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getScene", argc, 0);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsWorld* cobj = nullptr;
2021-12-25 10:04:45 +08:00
bool ok = true;
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# 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
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 3)
{
2021-12-25 10:04:45 +08:00
std::function<bool(cocos2d::PhysicsWorld&, const cocos2d::PhysicsRayCastInfo&, void*)> arg0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg1;
cocos2d::Vec2 arg2;
2014-03-10 14:04:58 +08:00
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
2021-12-25 10:04:45 +08:00
do
{
arg0 = [handler](cocos2d::PhysicsWorld& world, const cocos2d::PhysicsRayCastInfo& info,
void* data) -> bool {
2021-11-15 19:05:08 +08:00
auto stack = LuaEngine::getInstance()->getLuaStack();
2021-12-25 10:04:45 +08:00
auto Ls = stack->getLuaState();
2021-11-15 19:05:08 +08:00
tolua_pushusertype(Ls, (void*)(&world), getLuaTypeName(&world, "cc.PhysicsWorld"));
physics_raycastinfo_to_luaval(Ls, info);
return stack->executeFunctionByHandler(handler, 2);
2014-03-10 14:04:58 +08:00
};
2021-12-25 10:04:45 +08:00
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.PhysicsWorld:rayCast");
ok &= luaval_to_vec2(tolua_S, 4, &arg2, "cc.PhysicsWorld:rayCast");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
return 0;
cobj->rayCast(arg0, arg1, arg2, nullptr);
toluafix_remove_function_by_refid(tolua_S, handler);
lua_settop(tolua_S, 1);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "rayCast", argc, 4);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsWorld_queryRect(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsWorld* cobj = nullptr;
2021-12-25 10:04:45 +08:00
bool ok = true;
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# 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
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 2)
{
2021-12-25 10:04:45 +08:00
std::function<bool(cocos2d::PhysicsWorld&, cocos2d::PhysicsShape&, void*)> arg0;
2014-03-10 14:04:58 +08:00
cocos2d::Rect arg1;
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
2021-12-25 10:04:45 +08:00
do
{
arg0 = [handler](cocos2d::PhysicsWorld& world, cocos2d::PhysicsShape& shape, void* data) -> bool {
2021-11-15 19:05:08 +08:00
auto stack = LuaEngine::getInstance()->getLuaStack();
2021-12-25 10:04:45 +08:00
auto Ls = stack->getLuaState();
2021-11-15 19:05:08 +08:00
tolua_pushusertype(Ls, (void*)(&world), getLuaTypeName(&world, "cc.PhysicsWorld"));
toluafix_pushusertype_ccobject(Ls, shape._ID, &shape._luaID, (void*)(&shape), "cc.PhysicsShape");
return stack->executeFunctionByHandler(handler, 2);
2014-03-10 14:04:58 +08:00
};
2021-12-25 10:04:45 +08:00
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.PhysicsWorld:queryRect");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
return 0;
cobj->queryRect(arg0, arg1, nullptr);
toluafix_remove_function_by_refid(tolua_S, handler);
lua_settop(tolua_S, 1);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "queryRect", argc, 3);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsWorld* cobj = nullptr;
2021-12-25 10:04:45 +08:00
bool ok = true;
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# 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
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 2)
{
2021-12-25 10:04:45 +08:00
std::function<bool(cocos2d::PhysicsWorld&, cocos2d::PhysicsShape&, void*)> arg0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg1;
2014-03-10 14:04:58 +08:00
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
2021-12-25 10:04:45 +08:00
do
{
arg0 = [handler](cocos2d::PhysicsWorld& world, cocos2d::PhysicsShape& shape, void* data) -> bool {
2021-11-15 19:05:08 +08:00
auto stack = LuaEngine::getInstance()->getLuaStack();
2021-12-25 10:04:45 +08:00
auto Ls = stack->getLuaState();
2021-11-15 19:05:08 +08:00
tolua_pushusertype(Ls, (void*)(&world), getLuaTypeName(&world, "cc.PhysicsWorld"));
toluafix_pushusertype_ccobject(Ls, shape._ID, &shape._luaID, (void*)(&shape), "cc.PhysicsShape");
return stack->executeFunctionByHandler(handler, 2);
2014-03-10 14:04:58 +08:00
};
assert(false);
2021-12-25 10:04:45 +08:00
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.PhysicsWorld:queryPoint");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
return 0;
cobj->queryPoint(arg0, arg1, nullptr);
toluafix_remove_function_by_refid(tolua_S, handler);
lua_settop(tolua_S, 1);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "queryPoint", argc, 3);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsBody", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0 = nullptr;
2021-12-25 10:04:45 +08:00
int arg1 = 0;
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createPolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createPolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createPolygon");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createPolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createPolygon");
ok &= luaval_to_vec2(tolua_S, 4, &arg3, "cc.PhysicsBody:createPolygon");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "createPolygon", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createPolygon'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsBody", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgePolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
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);
}
2014-03-10 14:04:58 +08:00
} while (0);
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgePolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createEdgePolygon");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
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);
}
2014-03-10 14:04:58 +08:00
} while (0);
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
cocos2d::PhysicsMaterial arg2;
double arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgePolygon");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createEdgePolygon");
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 4, &arg3, "cc.PhysicsBody:createEdgePolygon");
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
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);
}
2014-03-10 14:04:58 +08:00
} while (0);
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "createEdgePolygon", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgePolygon'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsBody", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgeChain");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgeChain");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createEdgeChain");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1;
cocos2d::PhysicsMaterial arg2;
double arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsBody:createEdgeChain");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsBody:createEdgeChain");
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 4, &arg3, "cc.PhysicsBody:createEdgeChain");
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
do
{
2014-03-10 14:04:58 +08:00
if (nullptr != ret)
{
2021-12-25 10:04:45 +08:00
int ID = ret->_ID;
2014-03-10 14:04:58 +08:00
int* luaID = &ret->_luaID;
2021-12-25 10:04:45 +08:00
toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)ret, "cc.PhysicsBody");
2014-03-10 14:04:58 +08:00
}
else
{
lua_pushnil(tolua_S);
}
} while (0);
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "createEdgeChain", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgeChain'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShape", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShape:recenterPoints");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1);
vec2_array_to_luaval(tolua_S, arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
return 1;
2014-03-10 14:04:58 +08:00
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShape:recenterPoints");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_vec2(tolua_S, 3, &arg2, "cc.PhysicsShape:recenterPoints");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2);
vec2_array_to_luaval(tolua_S, arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "recenterPoints", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShape_recenterPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShape_getPolygonCenter(lua_State* tolua_S)
2014-03-10 14:04:58 +08:00
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShape", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShape:getPolygonCenter");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::Vec2 ret = cocos2d::PhysicsShape::getPolygonCenter(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
vec2_to_luaval(tolua_S, ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "getPolygonCenter", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getPolygonCenter'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsShapeBox* cobj = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsShapeBox", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsShapeBox*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg0[4];
2014-03-10 14:04:58 +08:00
cobj->getPoints(arg0);
vec2_array_to_luaval(tolua_S, arg0, 4);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsShapePolygon* cobj = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsShapePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsShapePolygon*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2021-12-25 10:04:45 +08:00
int count = cobj->getPointsCount();
2021-12-08 00:11:53 +08:00
cocos2d::Vec2* arg0 = new cocos2d::Vec2[count];
2014-03-10 14:04:58 +08:00
cobj->getPoints(arg0);
vec2_array_to_luaval(tolua_S, arg0, count);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShapePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",
(cocos2d::PhysicsShapePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapePolygon:create");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",
(cocos2d::PhysicsShapePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapePolygon:create");
ok &= luaval_to_vec2(tolua_S, 4, &arg3, "cc.PhysicsShapePolygon:create");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapePolygon>(tolua_S, "cc.PhysicsShapePolygon",
(cocos2d::PhysicsShapePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "create", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_create'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShapePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapePolygon:calculateArea");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
double ret = cocos2d::PhysicsShapePolygon::calculateArea(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
tolua_pushnumber(tolua_S, (lua_Number)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "calculateArea", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShapePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 2)
{
double arg0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg1;
2014-03-10 14:04:58 +08:00
int arg2 = 0;
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 2, &arg0, "cc.PhysicsShapePolygon:calculateMoment");
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 3, &arg1, &arg2, "cc.PhysicsShapePolygon:calculateMoment");
2021-12-25 10:04:45 +08:00
if (nullptr == arg1)
{
LUA_PRECONDITION(arg1, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg1);
2014-03-10 14:04:58 +08:00
return 0;
}
double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg1);
2021-12-25 10:04:45 +08:00
tolua_pushnumber(tolua_S, (lua_Number)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 2)
{
double arg0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg1;
2014-03-10 14:04:58 +08:00
int arg2 = 0;
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2 arg3;
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 2, &arg0, "cc.PhysicsShapePolygon:calculateMoment");
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 3, &arg1, &arg2, "cc.PhysicsShapePolygon:calculateMoment");
2021-12-25 10:04:45 +08:00
if (nullptr == arg1)
{
LUA_PRECONDITION(arg1, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_vec2(tolua_S, 4, &arg3, "cc.PhysicsShapePolygon:calculateMoment");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg1);
2014-03-10 14:04:58 +08:00
return 0;
}
double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg1);
2021-12-25 10:04:45 +08:00
tolua_pushnumber(tolua_S, (lua_Number)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "calculateMoment", argc, 3);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsShapeEdgeBox* cobj = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsShapeEdgeBox", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsShapeEdgeBox*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2021-12-25 10:04:45 +08:00
int count = cobj->getPointsCount();
2021-12-08 00:11:53 +08:00
cocos2d::Vec2* arg0 = new cocos2d::Vec2[count];
2014-03-10 14:04:58 +08:00
cobj->getPoints(arg0);
vec2_array_to_luaval(tolua_S, arg0, count);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsShapeEdgePolygon* cobj = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsShapeEdgePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsShapeEdgePolygon*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'",
NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2021-12-25 10:04:45 +08:00
int count = cobj->getPointsCount();
2021-12-08 00:11:53 +08:00
cocos2d::Vec2* arg0 = new cocos2d::Vec2[count];
2014-03-10 14:04:58 +08:00
cobj->getPoints(arg0);
vec2_array_to_luaval(tolua_S, arg0, count);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S)
{
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
cocos2d::PhysicsShapeEdgeChain* cobj = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S, 1, "cc.PhysicsShapeEdgeChain", 0, &tolua_err))
goto tolua_lerror;
# endif
cobj = (cocos2d::PhysicsShapeEdgeChain*)tolua_tousertype(tolua_S, 1, 0);
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
if (!cobj)
{
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'", NULL);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
argc = lua_gettop(tolua_S) - 1;
2014-03-10 14:04:58 +08:00
if (argc == 0)
{
2021-12-25 10:04:45 +08:00
int count = cobj->getPointsCount();
2021-12-08 00:11:53 +08:00
cocos2d::Vec2* arg0 = new cocos2d::Vec2[count];
2014-03-10 14:04:58 +08:00
cobj->getPoints(arg0);
vec2_array_to_luaval(tolua_S, arg0, count);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
return 1;
2014-03-10 14:04:58 +08:00
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_State* tolua_S)
{
if (nullptr == tolua_S)
return 0;
2021-12-25 10:04:45 +08:00
int argc = 0;
2014-03-10 14:04:58 +08:00
EventListenerPhysicsContact* self = nullptr;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
if (!tolua_isusertype(tolua_S, 1, "cc.EventListenerPhysicsContact", 0, &tolua_err))
goto tolua_lerror;
# endif
self = static_cast<EventListenerPhysicsContact*>(tolua_tousertype(tolua_S, 1, 0));
# if COCOS2D_DEBUG >= 1
if (nullptr == self)
{
tolua_error(tolua_S,
"invalid 'self' in function 'tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler'\n",
nullptr);
2014-03-10 14:04:58 +08:00
return 0;
}
2021-12-25 10:04:45 +08:00
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 2)
{
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
if (!toluafix_isfunction(tolua_S, 2, "LUA_FUNCTION", 0, &tolua_err) ||
2014-03-10 14:04:58 +08:00
!tolua_isnumber(tolua_S, 3, 0, &tolua_err))
{
goto tolua_lerror;
}
2021-12-25 10:04:45 +08:00
# endif
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
ScriptHandlerMgr::HandlerType type =
static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0));
2014-03-10 14:04:58 +08:00
switch (type)
{
2021-12-25 10:04:45 +08:00
case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_BEGIN:
{
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);
self->onContactBegin = [handler](PhysicsContact& contact) -> bool {
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
stack->pushObject(&contact, "cc.PhysicsContact");
bool ret = stack->executeFunctionByHandler(handler, 1);
stack->clean();
return ret;
};
}
break;
case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_PRESOLVE:
{
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);
self->onContactPreSolve = [handler](PhysicsContact& contact, PhysicsContactPreSolve& solve) -> bool {
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
stack->pushObject(&contact, "cc.PhysicsContact");
tolua_pushusertype(stack->getLuaState(), &solve, "cc.PhysicsContactPreSolve");
bool ret = stack->executeFunctionByHandler(handler, 2);
stack->clean();
return ret;
};
}
break;
case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_POSTSOLVE:
{
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);
self->onContactPostSolve = [handler](PhysicsContact& contact, const PhysicsContactPostSolve& solve) {
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
stack->pushObject(&contact, "cc.PhysicsContact");
tolua_pushusertype(stack->getLuaState(), const_cast<PhysicsContactPostSolve*>(&solve),
"cc.PhysicsContactPostSolve");
stack->executeFunctionByHandler(handler, 2);
stack->clean();
};
}
break;
case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_SEPARATE:
{
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);
self->onContactSeparate = [handler](PhysicsContact& contact) {
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
stack->pushObject(&contact, "cc.PhysicsContact");
stack->executeFunctionByHandler(handler, 1);
stack->clean();
};
}
break;
default:
break;
2014-03-10 14:04:58 +08:00
}
return 0;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\n", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'registerScriptHandler'.", &tolua_err);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# endif
2014-03-10 14:04:58 +08:00
}
int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShapeEdgePolygon", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgePolygon>(tolua_S, "cc.PhysicsShapeEdgePolygon",
(cocos2d::PhysicsShapeEdgePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapeEdgePolygon:create");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgePolygon>(tolua_S, "cc.PhysicsShapeEdgePolygon",
(cocos2d::PhysicsShapeEdgePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
double arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgePolygon:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapeEdgePolygon:create");
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 4, &arg3, "cc.PhysicsShapeEdgePolygon:create");
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgePolygon>(tolua_S, "cc.PhysicsShapeEdgePolygon",
(cocos2d::PhysicsShapeEdgePolygon*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "create", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_Error tolua_err;
2021-12-25 10:04:45 +08:00
# endif
# if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S, 1, "cc.PhysicsShapeEdgeChain", 0, &tolua_err))
goto tolua_lerror;
# endif
2014-03-10 14:04:58 +08:00
argc = lua_gettop(tolua_S) - 1;
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
if (argc == 1)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgeChain:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgeChain>(tolua_S, "cc.PhysicsShapeEdgeChain",
(cocos2d::PhysicsShapeEdgeChain*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 2)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgeChain:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapeEdgeChain:create");
2021-12-25 10:04:45 +08:00
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgeChain>(tolua_S, "cc.PhysicsShapeEdgeChain",
(cocos2d::PhysicsShapeEdgeChain*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
if (argc == 3)
{
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
cocos2d::Vec2* arg0;
2014-03-10 14:04:58 +08:00
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
double arg3;
2021-12-25 10:04:45 +08:00
do
{
2014-07-22 11:16:16 +08:00
ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1, "cc.PhysicsShapeEdgeChain:create");
2021-12-25 10:04:45 +08:00
if (nullptr == arg0)
{
LUA_PRECONDITION(arg0, "Invalid Native Object");
}
} while (0);
2014-07-22 11:16:16 +08:00
ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "cc.PhysicsShapeEdgeChain:create");
2021-12-25 10:04:45 +08:00
ok &= luaval_to_number(tolua_S, 4, &arg3, "cc.PhysicsShapeEdgeChain:create");
if (!ok)
2014-03-10 14:04:58 +08:00
{
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2014-03-10 14:04:58 +08:00
return 0;
}
cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3);
2014-05-16 17:19:02 +08:00
CC_SAFE_DELETE_ARRAY(arg0);
2021-12-25 10:04:45 +08:00
object_to_luaval<cocos2d::PhysicsShapeEdgeChain>(tolua_S, "cc.PhysicsShapeEdgeChain",
(cocos2d::PhysicsShapeEdgeChain*)ret);
2014-03-10 14:04:58 +08:00
return 1;
}
2021-12-25 10:04:45 +08:00
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "create", argc, 2);
2014-03-10 14:04:58 +08:00
return 0;
2021-12-25 10:04:45 +08:00
# if COCOS2D_DEBUG >= 1
2014-03-10 14:04:58 +08:00
tolua_lerror:
2021-12-25 10:04:45 +08:00
tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_create'.", &tolua_err);
# endif
2014-03-10 14:04:58 +08:00
return 0;
}
int register_all_cocos2dx_physics_manual(lua_State* tolua_S)
{
lua_pushstring(tolua_S, "cc.PhysicsBody");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getJoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsBody_getJoints);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "createPolygon");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsBody_createPolygon);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "createEdgeChain");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsBody_createEdgeChain);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "createEdgePolygon");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsBody_createEdgePolygon);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShape");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "recenterPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShape_recenterPoints);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "getPolygonCenter");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShape_getPolygonCenter);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "getPolyonCenter");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShape_getPolygonCenter);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShapeBox");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeBox_getPoints);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShapeEdgeBox");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShapePolygon");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapePolygon_getPoints);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "create");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapePolygon_create);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "calculateArea");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "calculateMoment");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShapeEdgePolygon");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "create");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsShapeEdgeChain");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getPoints");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "create");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsShapeEdgeChain_create);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.PhysicsWorld");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
lua_pushstring(tolua_S, "getScene");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_getScene);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "queryPoint");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryPoint);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "queryRect");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryRect);
lua_rawset(tolua_S, -3);
lua_pushstring(tolua_S, "rayCast");
lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_rayCast);
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "DEBUGDRAW_NONE");
lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_NONE);
2021-12-25 10:04:45 +08:00
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "DEBUGDRAW_SHAPE");
lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_SHAPE);
2021-12-25 10:04:45 +08:00
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "DEBUGDRAW_JOINT");
lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_JOINT);
2021-12-25 10:04:45 +08:00
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "DEBUGDRAW_CONTACT");
lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_CONTACT);
2021-12-25 10:04:45 +08:00
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "DEBUGDRAW_ALL");
lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_ALL);
2021-12-25 10:04:45 +08:00
lua_rawset(tolua_S, -3);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
lua_pushstring(tolua_S, "cc.EventListenerPhysicsContact");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
2021-12-25 10:04:45 +08:00
if (lua_istable(tolua_S, -1))
2014-03-10 14:04:58 +08:00
{
2021-12-25 10:04:45 +08:00
tolua_function(tolua_S, "registerScriptHandler",
tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler);
2014-03-10 14:04:58 +08:00
}
lua_pop(tolua_S, 1);
tolua_constant(tolua_S, "PHYSICS_INFINITY", PHYSICS_INFINITY);
2021-12-25 10:04:45 +08:00
2014-03-10 14:04:58 +08:00
return 0;
}
#endif