コード例 #1
0
ファイル: Vob.cpp プロジェクト: degenerated1123/REGoth
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;
}
コード例 #2
0
ファイル: ContentLoad.cpp プロジェクト: Leinnan/REGoth
Handle::EntityHandle Content::Wrap::createEntity(World::WorldInstance& world, Components::ComponentMask mask)
{
    return world.addEntity(mask);
}