Skip to content

Fix setting currently active editor cameras. #194

Description

@mrparmesan01

Task Overview

In flecs (ecs framework), there is an API for the flecs::world registry where we can describe conditions using the flecs::world::component<UComponent>.

This would be a good opportunity to look into flecs relationships to allow for automating actively looking at specific editor cameras based on an active component. Rather then checking everytime, which is what is currently being done in the current implementation.

Task completion?

The way I would see the functionality of this task to go is we should be able to see something similar or if not the same as the working code below.

Which is expected to do the following functionality regarding which editor camera to use.

auto camera1 = entity("Camera1");
camera1.set<atlas::perspective_camera>({....});

// Makes "Camera1" the currently active camera
camera1.add<atlas::active_camera>();

auto camera2 = entity("Camera2");
camera2.set<atlas::perspective_camera>({....});

// Makes "Camera2" the currently active camera
// "Camer1" is no longer the current editor camera
camera2.add<atlas::active_camera>();

// Using systems to execute this API or something like that.
// This should only be getting Camera 2
query_builder.with<atlas::active_camera>().each([](atlas::perspective_camera& p_camera){
// do stuff (no checks)
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions