Giter Club home page Giter Club logo

bevy_dolly's Issues

bevy main branch

Just found this repo, looking forward to using it.

Thoughts on a bevy main branch? Created a fork that works with main currently.

Notes:

  • Had to add a wrapper to CameraRig for Component unless I am missing something.
  • Updated QuerySets, some were not filtered and returning the With<?>, I realize it has no effect really, was it there for reason?

The query state changes lead to code like this, is there a cleaner way to handle E0716

    let mut q2 = query.q2();
    let mut rig = q2.single_mut();
    rig.0.driver_mut.....

bevy_0.12: crate does not compile without helpers feature

error[E0433]: failed to resolve: could not find `helpers` in the crate root
  --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/lib.rs:16:9
   |
16 |         helpers::{cone::*, cursor_grab::*, pos_ctrl::*},
   |         ^^^^^^^ could not find `helpers` in the crate root

error[E0432]: unresolved import `crate::helpers`
  --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/lib.rs:15:9
   |
15 |         helpers::*,
   |         ^^^^^^^ could not find `helpers` in the crate root

Also, does not compile with the helpers feature.

error[E0599]: no method named `iter` found for reference `&MoveAction` in the current scope
   --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/helpers/pos_ctrl.rs:127:29
    |
127 |             for (i, b) in v.iter().enumerate() {
    |                             ^^^^ method not found in `&MoveAction`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following traits define an item `iter`, perhaps you need to implement one of them:
            candidate #1: `Walker`
            candidate #2: `bevy::reflect::Array`
            candidate #3: `bevy::reflect::List`
            candidate #4: `bevy::reflect::Map`
            candidate #5: `bitflags::traits::Flags`
            candidate #6: `sysinfo::traits::NetworksExt`

error[E0599]: no method named `len` found for reference `&MoveAction` in the current scope
   --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/helpers/pos_ctrl.rs:145:22
    |
145 |                 if v.len() > 1 && i != v.len() - 1 {
    |                      ^^^ method not found in `&MoveAction`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following traits define an item `len`, perhaps you need to implement one of them:
            candidate #1: `ExactSizeIterator`
            candidate #2: `bevy::reflect::Array`
            candidate #3: `bevy::reflect::List`
            candidate #4: `bevy::reflect::Map`
            candidate #5: `BufferRef`
            candidate #6: `RuntimeSizedArray`
            candidate #7: `core_graphics::data_provider::CustomData`

error[E0599]: no method named `len` found for reference `&MoveAction` in the current scope
   --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/helpers/pos_ctrl.rs:145:42
    |
145 |                 if v.len() > 1 && i != v.len() - 1 {
    |                                          ^^^ method not found in `&MoveAction`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following traits define an item `len`, perhaps you need to implement one of them:
            candidate #1: `ExactSizeIterator`
            candidate #2: `bevy::reflect::Array`
            candidate #3: `bevy::reflect::List`
            candidate #4: `bevy::reflect::Map`
            candidate #5: `BufferRef`
            candidate #6: `RuntimeSizedArray`
            candidate #7: `core_graphics::data_provider::CustomData`

error[E0599]: no method named `len` found for reference `&MoveAction` in the current scope
   --> /Users/me/.cargo/git/checkouts/bevy_dolly-ae7dd05587c8a08d/dcd1f44/src/helpers/pos_ctrl.rs:149:27
    |
149 |                 if i == v.len() - 1 {
    |                           ^^^ method not found in `&MoveAction`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following traits define an item `len`, perhaps you need to implement one of them:
            candidate #1: `ExactSizeIterator`
            candidate #2: `bevy::reflect::Array`
            candidate #3: `bevy::reflect::List`
            candidate #4: `bevy::reflect::Map`
            candidate #5: `BufferRef`
            candidate #6: `RuntimeSizedArray`
            candidate #7: `core_graphics::data_provider::CustomData`

Update to Bevy 0.10

Seeing as Bevy 0.10 is about to be released, I thought it's time to put this in the room ๐Ÿ™‚

Make Rig builder follow Bevy's current paradigm of passing tuples

As Bevy changed the API for bundle and system (and soon plugin) adding to accept tuples instead of multiple calls to a builder function, I think we should follow suit:

Rig::builder()
    .with(Position::new(Vec3::ZERO))
    .with(YawPitch::new().yaw_degrees(45.0).pitch_degrees(-30.0))
    .with(Smooth::new_position(0.3))
    .with(Smooth::new_rotation(0.3))
    .with(Arm::new(Vec3::Z * 4.0))
    .build()

becomes

Rig::builder()
    .with((
		Position::new(Vec3::ZERO),
        YawPitch::new().yaw_degrees(45.0).pitch_degrees(-30.0),
        Smooth::new_position(0.3),
        Smooth::new_rotation(0.3),
        Arm::new(Vec3::Z * 4.0)
	))
    .build()

Examples are broken

Getting the following when running fpv on main:
image

The other examples report similar errors.

Use generic system or system param for ergonomic rig lookup

Generic System:

//App
.add_system(dolly_update_system::<MyRig>)

//Setup
commands
        .spawn()
      //.insert(Some Transform)
        .insert(Rig::builder(/*...*/))
        .insert(MyRig);

//Generic System
fn dolly_update_system<T: Component>(mut query: Query<Rig, With<T>>) {
    for rig in query.iter() {
        rig.update()
    }
}

System Param:

//WIP

#[derive(SystemParam)]
struct CameraUpdater<'w, 's> {
    players: Query<'w, 's, &'static Player>,
    count: ResMut<'w, PlayerCount>,
}

impl<'w, 's> CameraUpdater<'w, 's> {
    fn update(&mut self) {
		self.update()
    }
}

/// The [`SystemParam`] can be used directly in a system argument.
fn update_camera(mut query: Query<Transform, With<Camera3D>>, mut cam_updater: CameraUpdater) {
    let t = cam_updater.update();
	for cams in query.iter() {
        cams = t;
    }
}

Change all "2" functionality to From impls

By this I mean functions like transform_2_bevy. Because the numbers 2 and 3 have significant connotations in glam (and by extent Bevy) with the dimensionality, I was confused about this function. The rust ecosystem already provides a trait for exactly this kind of conversion, namely From and the automatically implemented To, so I suggest we use this instead. If you are fine with this change, I volunteer to implement it and setup a PR :)

Use same entity for rig and camera

It seems to me that the following kind of code...

    commands.spawn((
        MainCamera,
        Rig::builder()
            .with(Fpv::from_position_target(transform))
            .build(),
    ));

    commands.spawn((
        MainCamera,
        Camera3dBundle {
            transform,
            ..default()
        },
    ));

...could be more easily written as

    commands.spawn((
        MainCamera,
        Rig::builder()
            .with(Fpv::from_position_target(transform))
            .build(),
        Camera3dBundle {
            transform,
            ..default()
        },
    ));

From a quick check, it seems like the examples behave the same way, although this was not an extensive test.
I assume that the design decision of not requiring this in the first place is to mix and match rigs and cameras, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.