Skip to content

Commit

Permalink
style(tesseratos): Formatted DebugCamera plugin and added bindings to…
Browse files Browse the repository at this point in the history
… player from the plugin
  • Loading branch information
diogomsmiranda committed Feb 7, 2024
1 parent 9c0d146 commit 0612d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions engine/src/utils/free_camera_controller/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ void cubos::engine::freeCameraControllerPlugin(Cubos& cubos)
bindings.axes()["free-vertical"] =
InputAxis{{{Key::Space, Modifiers::None}}, {{Key::LAlt, Modifiers::None}}, {}};

Check warning on line 34 in engine/src/utils/free_camera_controller/plugin.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/utils/free_camera_controller/plugin.cpp#L34

Added line #L34 was not covered by tests

bindings.actions()["free-toggle"] = InputAction{{{Key::LControl, Modifiers::None}}, {}, {}};

input.bind(bindings);
});

Expand Down
16 changes: 10 additions & 6 deletions tools/tesseratos/src/tesseratos/debug_camera/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ void tesseratos::debugCameraPlugin(Cubos& cubos)

cubos.addResource<DebugCameraInfo>();

cubos.startupSystem("create Debug Camera").call([](Commands commands, DebugCameraInfo& debugCamera) {
debugCamera.ent = commands.create().add(Camera{}).add(Position{{}}).add(FreeCameraController{}).entity();
});

cubos.startupSystem("disable free camera controller")
cubos.startupSystem("create Debug Camera")
.tagged("cubos.input")
.after("cubos.fcc.init")
.call([](Window& window, Query<Camera&, Position&, FreeCameraController&> entities) {
.call([](Input& input, Window& window, Query<Camera&, Position&, FreeCameraController&> entities,
Commands commands, DebugCameraInfo& debugCamera) {
debugCamera.ent = commands.create().add(Camera{}).add(Position{{}}).add(FreeCameraController{}).entity();

cubos::engine::InputBindings bindings = input.bindings().at(0);
bindings.actions()["free-toggle"] = cubos::engine::InputAction{{{Key::F, Modifiers::None}}, {}, {}};
input.bind(bindings);

for (auto [camera, position, controller] : entities)
{
window->mouseState(MouseState::Default);
Expand Down

0 comments on commit 0612d99

Please sign in to comment.