Struct three_d::io::Loaded [−][src]
pub struct Loaded { /* fields omitted */ }
Expand description
Contains the resources loaded using the Loader and/or manually inserted using the insert_bytes method. Use the remove_bytes or get_bytes function to extract the raw byte array for the loaded resource or one of the other methods to both extract and deserialize a loaded resource.
Implementations
Constructs a new empty set of loaded files. Use this together with insert_bytes to load resources from an unsuported source and then parse them as usual using the functionality on Loaded.
Remove and returns the loaded byte array for the resource at the given path. The byte array then has to be deserialized to whatever type this resource is (image, 3D model etc.).
Returns a reference to the loaded byte array for the resource at the given path. The byte array then has to be deserialized to whatever type this resource is (image, 3D model etc.).
pub fn obj<P: AsRef<Path>>(
&mut self,
path: P
) -> ThreeDResult<(Vec<CPUMesh>, Vec<CPUMaterial>)>
This is supported on crate feature obj-io
only.
pub fn obj<P: AsRef<Path>>(
&mut self,
path: P
) -> ThreeDResult<(Vec<CPUMesh>, Vec<CPUMaterial>)>
obj-io
only.Deserialize a loaded .obj file resource and .mtl material file resource (if present) into a list of meshes and materials. It uses the wavefront-obj crate.
pub fn gltf(
&mut self,
path: impl AsRef<Path>
) -> ThreeDResult<(Vec<CPUMesh>, Vec<CPUMaterial>)>
This is supported on crate feature gltf-io
only.
pub fn gltf(
&mut self,
path: impl AsRef<Path>
) -> ThreeDResult<(Vec<CPUMesh>, Vec<CPUMaterial>)>
gltf-io
only.Deserialize a loaded .gltf file and related .bin resource file and related texture resources or a loaded .glb file into a list of meshes and materials. It uses the gltf crate.
This is supported on crate feature image-io
only.
image-io
only.Deserialize the loaded image resource at the given path into a CPUTexture using the image crate. The CPUTexture can then be used to create a Texture2D.
pub fn cube_image<P: AsRef<Path>>(
&mut self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> ThreeDResult<CPUTexture<u8>>
This is supported on crate feature image-io
only.
pub fn cube_image<P: AsRef<Path>>(
&mut self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> ThreeDResult<CPUTexture<u8>>
image-io
only.Deserialize the 6 loaded image resources at the given paths into a CPUTexture using the image crate. The CPUTexture can then be used to create a TextureCubeMap.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Loaded
impl !UnwindSafe for Loaded
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more