diff options
| author | Alexander <alex@cogarr.net> | 2020-06-29 15:29:03 -0400 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2020-06-29 15:29:03 -0400 |
| commit | 80789508b9655d25629223b9dcc84b4cfb77ce45 (patch) | |
| tree | 37e140e532af61c1ca4699c8b6254cf2cb07ed02 /src/client/lua_api/scene/ilight.cpp | |
| parent | 44a1421c393632978d59c0698a93ae22243b97e9 (diff) | |
| download | brokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.tar.gz brokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.tar.bz2 brokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.zip | |
Updates for mdoc
Also more tests
Diffstat (limited to 'src/client/lua_api/scene/ilight.cpp')
| -rw-r--r-- | src/client/lua_api/scene/ilight.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/client/lua_api/scene/ilight.cpp b/src/client/lua_api/scene/ilight.cpp index 1e292ee..e405443 100644 --- a/src/client/lua_api/scene/ilight.cpp +++ b/src/client/lua_api/scene/ilight.cpp @@ -23,6 +23,21 @@ using namespace core; extern IrrlichtDevice* device; +/*** +Create a light +Creates a light that illuminates the surrounding objects dynamically. +@function scene.newlight(number radius, vector3d position) +@tparam number radius The radius that the light should shine +@tparam vector3d position The position to create the light at +@treturn iscenelight The created light +*/ +/*** +A light. +Lights illuminate the scene nodes arounded them based on mesh vertexes. You +probably want to bake the lightmap instead of using light nodes. +@class iscenelight +@inherits iscenenode +*/ //{} :: scene.newlight(radius, {v3 position}) static int newiscenelight(lua_State* L){ printf("Createing light!\n"); @@ -48,6 +63,12 @@ static int newiscenelight(lua_State* L){ } +/*** +Sets the light type +Different light types illuminate the surrounding meshes in different ways. +@function iscenelight:settype(number type) +@tparam number type The type the light should be +*/ //settype(self,const) int settype(lua_State *L){ video::E_LIGHT_TYPE type = (video::E_LIGHT_TYPE)lua_tonumber(L,-1);//self,type @@ -60,8 +81,6 @@ int settype(lua_State *L){ } static const luaL_reg ilight_m[] = { - {"getpos", iscenegetpos}, - {"setpos", iscenesetpos}, {"settype", settype}, {0, 0}, }; @@ -72,8 +91,20 @@ void ilight_register(lua_State* L){ lua_pushcfunction(L,newiscenelight);//{scene},newiscenelight() lua_setfield(L,-2,"newlight");//{scene} +/*** +A point light +@field scene.ELT_POINT +*/ set_const(L,ELT_POINT); +/*** +A spot light +@field scene.ELT_SPOT +*/ set_const(L,ELT_SPOT); +/*** +A sun light +@field scene.ELT_DIRECTIONAL +*/ set_const(L,ELT_DIRECTIONAL); lua_pop(L,1);// @@ -81,6 +112,7 @@ void ilight_register(lua_State* L){ luaL_newmetatable(L,"scene.ilight");//scene.ilight lua_newtable(L);//scene.ilight,{} luaL_register(L, NULL, ilight_m);//scene.ilight,{} + luaL_register(L, NULL, igeneric_m); lua_setfield(L,-2,"__index");//scene.ilight lua_pop(L,1); |
