| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- $#include "Viewport.h"
- class Viewport
- {
- Viewport();
- Viewport(Scene* scene, Camera* camera, RenderPath* renderPath = 0);
- Viewport(Scene* scene, Camera* camera, const IntRect& rect, RenderPath* renderPath = 0);
- ~Viewport();
-
- void SetScene(Scene* scene);
- void SetCamera(Camera* camera);
- void SetRect(const IntRect& rect);
- void SetRenderPath(RenderPath* path);
- void SetRenderPath(XMLFile* file);
- void SetDrawDebug(bool enable);
-
- Scene* GetScene() const;
- Camera* GetCamera() const;
- const IntRect& GetRect() const;
- RenderPath* GetRenderPath() const;
- bool GetDrawDebug() const;
- Ray GetScreenRay(int x, int y) const;
- IntVector2 WorldToScreenPoint(const Vector3& worldPos) const;
- Vector3 ScreenToWorldPoint(int x, int y, float depth) const;
- tolua_property__get_set Scene* scene;
- tolua_property__get_set Camera* camera;
- tolua_property__get_set IntRect& rect;
- tolua_property__get_set RenderPath* renderPath;
- tolua_property__get_set bool drawDebug;
- };
- ${
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new00
- static int tolua_GraphicsLuaAPI_Viewport_new00(lua_State* tolua_S)
- {
- return ToluaNewObject<Viewport>(tolua_S);
- }
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new00_local
- static int tolua_GraphicsLuaAPI_Viewport_new00_local(lua_State* tolua_S)
- {
- return ToluaNewObjectGC<Viewport>(tolua_S);
- }
- /* method: new of class Viewport */
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new01
- static int tolua_GraphicsLuaAPI_Viewport_new01(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,4,"RenderPath",1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,5,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
- Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
- RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,4,0));
- {
- Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,renderPath));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
- }
- }
- return 1;
- tolua_lerror:
- return tolua_GraphicsLuaAPI_Viewport_new00(tolua_S);
- }
- /* method: new_local of class Viewport */
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new01_local
- static int tolua_GraphicsLuaAPI_Viewport_new01_local(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,4,"RenderPath",1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,5,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
- Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
- RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,4,0));
- {
- Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,renderPath));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
- }
- }
- return 1;
- tolua_lerror:
- return tolua_GraphicsLuaAPI_Viewport_new00_local(tolua_S);
- }
- /* method: new of class Viewport */
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new02
- static int tolua_GraphicsLuaAPI_Viewport_new02(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const IntRect",0,&tolua_err)) ||
- !tolua_isusertype(tolua_S,5,"RenderPath",1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,6,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
- Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
- const IntRect* rect = ((const IntRect*) tolua_tousertype(tolua_S,4,0));
- RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,5,0));
- {
- Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,*rect,renderPath));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
- }
- }
- return 1;
- tolua_lerror:
- return tolua_GraphicsLuaAPI_Viewport_new01(tolua_S);
- }
- /* method: new_local of class Viewport */
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new02_local
- static int tolua_GraphicsLuaAPI_Viewport_new02_local(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const IntRect",0,&tolua_err)) ||
- !tolua_isusertype(tolua_S,5,"RenderPath",1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,6,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
- Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
- const IntRect* rect = ((const IntRect*) tolua_tousertype(tolua_S,4,0));
- RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,5,0));
- {
- Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,*rect,renderPath));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
- }
- }
- return 1;
- tolua_lerror:
- return tolua_GraphicsLuaAPI_Viewport_new01_local(tolua_S);
- }
- $}
|