#a billion similar errors when using bevy_trenchbroom with a .bsp file

26 messages ยท Page 1 of 1 (latest)

plain salmon
#

bevy 0.17, bevy_trenchbroom 0.10.0 with bsp feature

Trying to load a map like this:

use bevy::prelude::*;

pub struct LevelPlugin;

impl Plugin for LevelPlugin {
    fn build(&self, app: &mut App) {
        app.add_systems(Startup, spawn_test_map);
    }
}

fn spawn_test_map(
    mut commands: Commands,
    asset_server: Res<AssetServer>,
) {
    commands.spawn(SceneRoot(asset_server.load("maps/de_dust2.bsp#Scene")));
}
#

Hundreds of lines of errors like these:

error[E0277]: `glam::Vec3` does not implement `Typed` so cannot provide static type information
   --> /home/storm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/qbsp-0.6.2/src/lib.rs:188:45
    |
188 | #[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
    |                                             ^^^^^^^ the trait `Typed` is not implemented for `glam::Vec3`
    |
    = note: consider annotating `glam::Vec3` with `#[derive(Reflect)]`
    = help: the following other types implement trait `Typed`:
              &'static Location<'static>
              &'static Path
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 179 others
    = note: required for `glam::Vec3` to implement `MaybeTyped`
    = note: required for `Vec<glam::Vec3>` to implement `bevy_reflect::PartialReflect`
    = note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `glam::Vec3` does not implement `FromReflect` so cannot be created through reflection
   --> /home/storm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/qbsp-0.6.2/src/lib.rs:198:16
    |
198 |     pub vertices: Vec<Vec3>,
    |                   ^^^^^^^^^ the trait `bevy_reflect::FromReflect` is not implemented for `glam::Vec3`
    |
    = note: consider annotating `glam::Vec3` with `#[derive(Reflect)]`
    = help: the following other types implement trait `bevy_reflect::FromReflect`:
              &'static Location<'static>
              &'static Path
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 178 others
    = note: required for `Vec<glam::Vec3>` to implement `bevy_reflect::PartialReflect`

๐Ÿ˜ญ idk what they mean sorry

uneven panther
#

for the latter, check using cargo tree or searching your Cargo.lock file whether 2 versions of glam exist.

plain salmon
plain salmon
#

qbsp is using an older version

#

do i hav to make a fork of it or smth?

uneven panther
#

tho, qbsp seems to specify glam 0.*

uneven panther
uneven panther
plain salmon
uneven panther
#

oh wait, qbps has a bevy_reflect feature

plain salmon
#

ya

#

i added that in case

#

im not sure wat change is fixing it

#

since i did like 3 at once

uneven panther
plain salmon
#

o shoot idk

#

ill check cargo tree and see wat it has

uneven panther
plain salmon
#

asdgkjhhgadsjgdsa

#

ill try removing once my slow pc compiles this first and see if it still works or not :)

uneven panther
#

usually Rust actually says "theres a type of the same name provided by glam 0.31" or something like that