0

I found this code online which probably worked for a different version of the Amethyst Engine:

let mesh = data.world.exec(|loader: AssetLoaderSystemData<Mesh>| {
    loader.load_from_data(
        Shape::Sphere(32, 32).generate::<Vec<PosNormTangTex>>(None),
        (),
    )
});

Looks like now the generate method returns a MeshBuilder instead of the Mesh itself. I could call the .build() method on the builder probably, but it requires two additional paramenters, one of which is the QueueId, that I do not have nor I know where to fetch them from.

How can I correctly adapt that code to Amethyst 0.15 version?

nyarlathotep108
  • 5,275
  • 2
  • 26
  • 64
  • 1
    Did you try calling `.into()`? The following code works for me: `load_from_data(Sphere(...).generate::<(Vec, Vec, Vec, Vec)>(None).into(), ())` – Kitsu Jun 18 '20 at 11:11
  • @Kitsu yes I tried that one, not sure why it works compile-wise, but runtime crashes. I think it's weird to use conversions in this case, strange that it is allowed to compile, there should be a proper way of doing this. Not sure about the conceptual difference of `generate` and `build` as well... – nyarlathotep108 Jun 18 '20 at 11:23

0 Answers0