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.).

Inserts the given bytes into the set of loaded files which is useful if you want to load the data from an unsuported source. The files can then be parsed as usual using the functionality on Loaded.

This is supported on crate feature 3d-io only.

Deserialize a loaded .3d file resource (a custom binary format for three-d) into a list of meshes and materials.

This is supported on crate feature 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.

This is supported on crate feature 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.

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.

This is supported on crate feature 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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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