From 9d3e8a60352a24b3f4650e2bb3e87da638c8921e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 22 Mar 2025 15:49:14 +0100 Subject: fix seeking nodeready and more helpers --- src/classes/mesh.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/classes/mesh.rs') 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) -> Vec { + a.into_iter().array_chunks().map(Vec2::from_array).collect() + } +} +impl VectorType for Vec4 { + const DIM: usize = 4; + fn convert_array(a: Vec) -> Vec { + a.into_iter().array_chunks().map(Vec4::from_array).collect() + } +} impl FromValue for ChannelInfo { fn from_value(v: Value) -> Result { -- cgit v1.2.3-70-g09d2