pub struct ModelLoader { /* private fields */ }Implementations§
Source§impl ModelLoader
impl ModelLoader
pub fn new() -> Self
Sourcepub fn load(&mut self, path: &str) -> Result<Vec<Mesh3D>, ModelError>
pub fn load(&mut self, path: &str) -> Result<Vec<Mesh3D>, ModelError>
Carrega um modelo 3D de arquivo
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Limpa o cache
Sourcepub fn remove_from_cache(&mut self, path: &str)
pub fn remove_from_cache(&mut self, path: &str)
Remove um modelo do cache
Sourcepub fn cached_models(&self) -> Vec<String>
pub fn cached_models(&self) -> Vec<String>
Lista modelos em cache
Sourcepub fn load_with_transform(
&mut self,
path: &str,
position: Vec3,
rotation: Vec3,
scale: Vec3,
) -> Result<Vec<Mesh3D>, ModelError>
pub fn load_with_transform( &mut self, path: &str, position: Vec3, rotation: Vec3, scale: Vec3, ) -> Result<Vec<Mesh3D>, ModelError>
Carrega modelo com transformações
Sourcepub fn load_with_material(
&mut self,
path: &str,
material: Material3D,
) -> Result<Vec<Mesh3D>, ModelError>
pub fn load_with_material( &mut self, path: &str, material: Material3D, ) -> Result<Vec<Mesh3D>, ModelError>
Carrega modelo com material customizado
Source§impl ModelLoader
impl ModelLoader
Sourcepub fn export_cube_obj(path: &str, size: f32) -> Result<(), ModelError>
pub fn export_cube_obj(path: &str, size: f32) -> Result<(), ModelError>
Cria um cubo e salva como OBJ
Sourcepub fn export_mesh_obj(mesh: &Mesh3D, path: &str) -> Result<(), ModelError>
pub fn export_mesh_obj(mesh: &Mesh3D, path: &str) -> Result<(), ModelError>
Exporta mesh para OBJ
Auto Trait Implementations§
impl Freeze for ModelLoader
impl RefUnwindSafe for ModelLoader
impl Send for ModelLoader
impl Sync for ModelLoader
impl Unpin for ModelLoader
impl UnsafeUnpin for ModelLoader
impl UnwindSafe for ModelLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more