#Icosphere error

14 messages · Page 1 of 1 (latest)

turbid crater
#

*the trait From<Icosphere> is not implemented for bevy::prelude::Mesh *

my code:
||commands.spawn(PbrBundle { mesh: meshes.add(Mesh::from(shape::Icosphere { radius: 1.0, subdivisions:2})), material:materials.add(Color::rgb(0.9, 0.9, 0.9).into()), transform: Transform { translation: Vec3::new(0.0, 2.0, 3.0), ..default() }, ..default() }); ||

cinder monolith
turbid crater
#

mesh: meshes.add(Mesh::try_from(shape::Icosphere { radius: 1.0, subdivisions:2}.try_into().unwrap())) like this?

#

gives error: expected struct bevy::prelude::Mesh, found enum Result

turbid crater
#

i used try_from but no result

cinder monolith
#
meshes.add(shape::Icosphere { radius: 1.0, subdivisions: 2 }.try_into().unwrap())
#

or

meshes.add(Mesh::try_from(shape::Icosphere { radius: 1.0, subdivisions:2 }).unwrap())

if you prefer

turbid crater
cinder monolith
#

Nothing, except that someone decided to fix that one up. The other shapes can all fail in similar ways and will probably be changed similarly eventually.

turbid crater
cinder monolith
#

Yeah, if user provided subdivisions: 80 or more, it could fail. They just made it fail more elegantly.

Maybe some other shapes have a similar issue, but haven't been fixed yet. Some other shapes probably can't fail, so no need to update.

turbid crater
cinder monolith
#

^^