feat(loader): implemented faces and vertex extractors for Model
This commit is contained in:
parent
83ea75fea9
commit
4e536d420d
|
@ -2,10 +2,17 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anyhow"
|
||||||
|
version = "1.0.75"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lithium-loader"
|
name = "lithium-loader"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
"lithium-utils",
|
"lithium-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,6 @@ authors = ["antifallobst"]
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lithium-utils = { path = "../lithium-utils" }
|
lithium-utils = { path = "../lithium-utils" }
|
||||||
|
|
||||||
|
anyhow = "1.0.75"
|
|
@ -1,3 +1,4 @@
|
||||||
|
use anyhow::Result;
|
||||||
use lithium_utils::{Vector2, Vector3};
|
use lithium_utils::{Vector2, Vector3};
|
||||||
|
|
||||||
pub struct Vertex {
|
pub struct Vertex {
|
||||||
|
@ -53,4 +54,12 @@ impl Model {
|
||||||
faces,
|
faces,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn faces(&self) -> &Vec<(u32, u32, u32)> {
|
||||||
|
&self.faces
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vertex(&self, id: u32) -> Option<&Vertex> {
|
||||||
|
self.vertices.get(id as usize)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue