mirror of https://github.com/axmolengine/axmol.git
lua binding
This commit is contained in:
parent
026f0a8b25
commit
4d1ca0966c
|
@ -283,6 +283,8 @@ THE SOFTWARE.
|
|||
#include "3d/CCMeshVertexIndexData.h"
|
||||
#include "3d/CCSkeleton3D.h"
|
||||
#include "3d/CCBillBoard.h"
|
||||
#include "3d/CCFrustum.h"
|
||||
#include "3d/CCPlane.h"
|
||||
|
||||
// Deprecated include
|
||||
#include "deprecated/CCDictionary.h"
|
||||
|
|
|
@ -12,12 +12,6 @@
|
|||
-- @param #cc.Bone3D attachBone
|
||||
-- @return AttachNode#AttachNode ret (return value: cc.AttachNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#AttachNode] getWorldToNodeTransform
|
||||
-- @param self
|
||||
-- @return mat4_table#mat4_table ret (return value: mat4_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#AttachNode] visit
|
||||
|
@ -26,4 +20,16 @@
|
|||
-- @param #mat4_table parentTransform
|
||||
-- @param #unsigned int parentFlags
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#AttachNode] getWorldToNodeTransform
|
||||
-- @param self
|
||||
-- @return mat4_table#mat4_table ret (return value: mat4_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#AttachNode] getNodeToWorldTransform
|
||||
-- @param self
|
||||
-- @return mat4_table#mat4_table ret (return value: mat4_table)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -37,6 +37,13 @@
|
|||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- Enable frustum culling
|
||||
-- @function [parent=#Camera] enableFrustumCulling
|
||||
-- @param self
|
||||
-- @param #bool enalbe
|
||||
-- @param #bool clipZ
|
||||
|
||||
--------------------------------
|
||||
-- Creates a view matrix based on the specified input parameters.<br>
|
||||
-- param eyePosition The eye position.<br>
|
||||
|
@ -48,6 +55,13 @@
|
|||
-- @param #vec3_table target
|
||||
-- @param #vec3_table up
|
||||
|
||||
--------------------------------
|
||||
-- Is this aabb visible in frustum
|
||||
-- @function [parent=#Camera] isVisibleInFrustum
|
||||
-- @param self
|
||||
-- @param #cc.AABB aabb
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Camera] setCameraFlag
|
||||
|
|
|
@ -60772,6 +60772,58 @@ int lua_cocos2dx_Camera_getType(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Camera_enableFrustumCulling(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Camera* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Camera",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Camera*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_enableFrustumCulling'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 2)
|
||||
{
|
||||
bool arg0;
|
||||
bool arg1;
|
||||
|
||||
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Camera:enableFrustumCulling");
|
||||
|
||||
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Camera:enableFrustumCulling");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_enableFrustumCulling'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->enableFrustumCulling(arg0, arg1);
|
||||
return 0;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:enableFrustumCulling",argc, 2);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_enableFrustumCulling'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Camera_lookAt(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -60824,6 +60876,56 @@ int lua_cocos2dx_Camera_lookAt(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Camera_isVisibleInFrustum(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Camera* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Camera",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Camera*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_isVisibleInFrustum'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::AABB arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::AABB>(tolua_S, 2, "cc.AABB",&arg0);
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_isVisibleInFrustum'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
bool ret = cobj->isVisibleInFrustum(arg0);
|
||||
tolua_pushboolean(tolua_S,(bool)ret);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:isVisibleInFrustum",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_isVisibleInFrustum'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Camera_setCameraFlag(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -61042,7 +61144,9 @@ int lua_register_cocos2dx_Camera(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"getViewMatrix",lua_cocos2dx_Camera_getViewMatrix);
|
||||
tolua_function(tolua_S,"getCameraFlag",lua_cocos2dx_Camera_getCameraFlag);
|
||||
tolua_function(tolua_S,"getType",lua_cocos2dx_Camera_getType);
|
||||
tolua_function(tolua_S,"enableFrustumCulling",lua_cocos2dx_Camera_enableFrustumCulling);
|
||||
tolua_function(tolua_S,"lookAt",lua_cocos2dx_Camera_lookAt);
|
||||
tolua_function(tolua_S,"isVisibleInFrustum",lua_cocos2dx_Camera_isVisibleInFrustum);
|
||||
tolua_function(tolua_S,"setCameraFlag",lua_cocos2dx_Camera_setCameraFlag);
|
||||
tolua_function(tolua_S,"create", lua_cocos2dx_Camera_create);
|
||||
tolua_function(tolua_S,"createPerspective", lua_cocos2dx_Camera_createPerspective);
|
||||
|
|
|
@ -1619,6 +1619,8 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue