Results 1 to 1 of 1

Thread: Luabind class

  1. #1
    Join Date
    Nov 2008
    Posts
    397

    Luabind class and entity component system

    Hi guys

    I have managed to cast my class into lua and that seems to work fine, however, i want to cast it back to a c++ class?

    now i thought i could do the following from a luabind:bject
    Code:
    void cEntityManager::addEntity(luabind::object const& ent)
    {
        cEntity *thisEnt = luabind::object_cast<cEntity*>(ent);
    }
    but it seems that doesnt work?

    tbh im not sure if this is what i want anyway. i wanted to create an entity component system where i could create new components and new entities in lua and have my engine process and run them. however im finding it difficult to find good examples of it.

    should i just be storing luabind objects(derived from class entity) instead of c++ class entities and have the engine process the objects as lua? is there a way i could typecast the object back to a c++ class while still maintaining the lua overrides?

    any help on this would be greatly appreciated

    Kind regards
    Rob
    Last edited by sarriss2; 06-21-2014 at 06:23 AM.
    Programming:
    C++ (Win32 and MFC), Perl, OpenGL, OpenGL ES 2, Cobol, Javascript/Jquery/ExtJS4, DirectX 10, VB6, XHTML, PHP, CSS, SQL, XML, C# (Basic), Unreal Script (Basic), XNA (Basic)

    Modelling:
    3DsMax, Maya, Zbrush

    Game Engines:
    Unreal Development Kit, Unity

    Other:
    Photoshop, Flash/Scaleform

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •