mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-13 23:52:55 +00:00
06751e54f6f00abdbbd2b5971da54487835fa5e3
This PR implements basic object selection, with help from `bevy_mod_picking` and `bevy_mod_outline`. ### Work Done * Click to select objects in the world * Selected objects become visually highlighted * The selected entity is available globally on the `Res<Selection>` resource * Selected entities can also be queried via the `Selected` marker component * Pressing `F` will "focus" the camera on the selected entity * Pressing `Esc` will clear the active selection ### Known Issues * We're currently using `bevy_mod_picking`'s "Selection" feature, which isn't aware of our own input events. As a consequence, it will select the object under the cursor when releasing `LMB` after orbiting the camera, which is not what we want. This should be pretty easily fixable by dropping `bevy_mod_picking`'s selection feature and reading the object under the cursor in our own click listener that only runs if the LMB event is unhandled. * The skinned mesh is not currently selectable. This is likely fixable by adjusting the logic in `scene::mark_scene_objects`... somehow. The `Gltf` data structure is kind of a nightmare to work with, so this will take some investigation. ### Future Enhancements * For parity with other DCC apps, the "Focus" action should also adjust the camera zoom level to "frame" the selected object in the view. Punting on that for now because I'm not super confident about the math involved. * Group selection with Shift/Ctrl and/or marquee selection would be really nice to have, but probably not critical for now.
Storyteller Studio
Installing dependencies
- Install Rust
- Install Node.js LTS
- Run
npm ci
Building / Running / Testing stuff
This repo is managed by Nx, a polyglot build system and monorepo framework written in TypeScript. After installing dependencies, dev tasks can be run through the Nx CLI:
npx nx <command> <project> [options]
# OR
npx nx run <project>:<command> [options]
For example, to compile the Bevy app to WebAssembly and serve it via the web frontend project, run:
npx nx serve studio-frontend
Projects are located in directories at the workspace root. The list of commands
supported by a given project can be found under the target property of its
project.json file, which defines the Nx configuration for that project.
The full list of options for a given command can be discovered by passing the
--help flag:
npx nx <command> <project> --help
Description
Languages
Rust
59.2%
TypeScript
34.9%
SCSS
4.1%
JavaScript
1%
HTML
0.3%
Other
0.5%