tirbofish/dropbear · commit
c8aafb9e7f7e50aa37eabf8fad33f716da38e472
wip: overhaul on assets, with uuid linking planned.
Signature present but could not be verified.
Unverified
@@ -89,6 +89,7 @@ float-derive = "0.1" rkyv = "0.8" bevy_mikktspace = "1.0.0" naga = { version = "29", features = ["wgsl-in"] } +uuid = { version = "1.22", features = ["v4", "serde"] } [workspace.dependencies.image] version = "0.25" @@ -108,9 +108,7 @@ impl ProcedurallyGeneratedObject { let model = Model { label: label.clone(), hash, - path: ResourceReference::from_reference(crate::utils::ResourceReferenceType::ProcObj( - self.clone(), - )), + path: ResourceReference::Procedural(self.clone()), meshes: vec![mesh], materials: vec![material], skins: Vec::new(), @@ -77,171 +77,136 @@ pub fn relative_path_from_euca(uri: &str) -> anyhow::Result<&str> { Ok(stripped.strip_prefix("resources/").unwrap_or(stripped)) } -/// An enum that contains the different types that a resource reference can possibly be. +/// A reference to an asset used to identify and load it. /// -/// # Example -/// ```rust -/// use dropbear_engine::utils::{ResourceReferenceType, ResourceReference}; +/// `File` holds a path relative to the project's `resources/` directory +/// (e.g. `"models/cube.glb"`). `Embedded` carries raw bytes. +/// `Procedural` stores the procedurally generated geometry directly. /// -/// let resource_ref = ResourceReference::from_reference( -/// ResourceReferenceType::File("euca://models/cube.obj".to_string()) -/// ); -/// assert_eq!(resource_ref.as_path().unwrap(), "models/cube.obj"); -/// ```
Large diffs are not rendered by default. Showing the first 50 of 1964 lines. Show full diff