Struct three_d::Loaded [−][src]
The resources loaded using the Loader. Use the 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
impl<'a> Loaded<'a>
[src]
pub fn bytes<P: AsRef<Path>>(&'a self, path: P) -> Result<&'a [u8], IOError>
[src]
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.).
impl<'a> Loaded<'a>
[src]
pub fn image<P: AsRef<Path>>(
&'a self,
path: P
) -> Result<CPUTexture<u8>, IOError>
[src]
&'a self,
path: P
) -> Result<CPUTexture<u8>, IOError>
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.
Feature
Only available when the image-io
feature is enabled.
pub fn cube_image<P: AsRef<Path>>(
&'a self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> Result<CPUTexture<u8>, IOError>
[src]
&'a self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> Result<CPUTexture<u8>, IOError>
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.
Feature
Only available when the image-io
feature is enabled.
impl<'a> Loaded<'a>
[src]
pub fn three_d<P: AsRef<Path>>(
&'a self,
path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
[src]
&'a self,
path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
Deserialize a loaded .3d file resource (a custom binary format for three-d
) into a list of meshes and materials.
Feature
Only available when the 3d-io
feature is enabled.
impl<'a> Loaded<'a>
[src]
pub fn obj<P: AsRef<Path>>(
&'a self,
path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
[src]
&'a self,
path: P
) -> Result<(Vec<CPUMesh>, Vec<CPUMaterial>), IOError>
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.
Feature
Only available when the obj-io
feature is enabled.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Loaded<'a>
impl<'a> Send for Loaded<'a>
impl<'a> Sync for Loaded<'a>
impl<'a> Unpin for Loaded<'a>
impl<'a> !UnwindSafe for Loaded<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,