Esempio n. 1
0
Handle::EntityHandle Vob::constructVob(World::WorldInstance& world)
{
    // Create main entity
    Handle::EntityHandle e = world.addEntity();
    Components::EntityComponent& entity = world.getEntity<Components::EntityComponent>(e);

    // Add components
    Components::Actions::initComponent<Components::LogicComponent>(world.getComponentAllocator(), e);

    Components::Actions::initComponent<Components::VisualComponent>(world.getComponentAllocator(), e);

    Components::Actions::initComponent<Components::BBoxComponent>(world.getComponentAllocator(), e);

    Components::ObjectComponent& obj = Components::Actions::initComponent<Components::ObjectComponent>(world.getComponentAllocator(), e);
    obj.m_Type = Components::ObjectComponent::Other;

    Components::Actions::initComponent<Components::PositionComponent>(world.getComponentAllocator(), e);

    //Components::addComponent<Components::PhysicsComponent>(entity);
    //Components::Actions::initComponent<Components::PhysicsComponent>(world.getComponentAllocator(), e);

    return e;
}
Esempio n. 2
0
Handle::EntityHandle Content::Wrap::createEntity(World::WorldInstance& world, Components::ComponentMask mask)
{
    return world.addEntity(mask);
}