aboutsummaryrefslogtreecommitdiff
path: root/src/classes/mesh.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-22 15:49:14 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-22 15:49:14 +0100
commit9d3e8a60352a24b3f4650e2bb3e87da638c8921e (patch)
treed4f39d2bdf0f2dd0d66a21b4f63d5c96c94f865a /src/classes/mesh.rs
parented6ed7a62217369544f3e31ef9a886f459f0c21b (diff)
downloadunity-tools-9d3e8a60352a24b3f4650e2bb3e87da638c8921e.tar
unity-tools-9d3e8a60352a24b3f4650e2bb3e87da638c8921e.tar.bz2
unity-tools-9d3e8a60352a24b3f4650e2bb3e87da638c8921e.tar.zst
fix seeking nodeready and more helpers
Diffstat (limited to 'src/classes/mesh.rs')
-rw-r--r--src/classes/mesh.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/classes/mesh.rs b/src/classes/mesh.rs
index f828b7c..348c61c 100644
--- a/src/classes/mesh.rs
+++ b/src/classes/mesh.rs
@@ -1,7 +1,7 @@
use super::streaminginfo::StreamingInfo;
use crate::object::{Value, parser::FromValue};
use anyhow::{Result, anyhow, bail};
-use glam::{Mat4, Vec3, Vec3A};
+use glam::{Mat4, Vec2, Vec3, Vec3A, Vec4};
use log::debug;
use serde::Serialize;
use std::mem::transmute;
@@ -216,6 +216,18 @@ impl VectorType for Vec3 {
a.into_iter().array_chunks().map(Vec3::from_array).collect()
}
}
+impl VectorType for Vec2 {
+ const DIM: usize = 2;
+ fn convert_array(a: Vec<f32>) -> Vec<Self> {
+ a.into_iter().array_chunks().map(Vec2::from_array).collect()
+ }
+}
+impl VectorType for Vec4 {
+ const DIM: usize = 4;
+ fn convert_array(a: Vec<f32>) -> Vec<Self> {
+ a.into_iter().array_chunks().map(Vec4::from_array).collect()
+ }
+}
impl FromValue for ChannelInfo {
fn from_value(v: Value) -> Result<Self> {