Jump to content
  • Advertisement
Sign in to follow this  

Luabind and Entity/Components

This topic is 1554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  1. 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:redface.gifbject

    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, I have read a lot on this topic and i think my brain is overburdened with too many conflicting ideas and concepts

    Kind regards

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!