From 36fa6811c1c8171008bde10127a31be9614d6de8 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 14 Apr 2026 16:03:30 +0200 Subject: feat(engine): add into_array fn to Vec2 & Vec3 --- engine/src/data_types/vector.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/src/data_types/vector.rs b/engine/src/data_types/vector.rs index 8567af5..e745387 100644 --- a/engine/src/data_types/vector.rs +++ b/engine/src/data_types/vector.rs @@ -9,6 +9,14 @@ pub struct Vec2 pub y: Value, } +impl Vec2 +{ + pub fn into_array(self) -> [Value; 2] + { + self.into() + } +} + impl Vec2 { pub const ZERO: Self = Self { x: 0, y: 0 }; @@ -182,9 +190,9 @@ impl Vec3 impl Vec3 { - pub fn as_ptr(&self) -> *const Value + pub fn into_array(self) -> [Value; 3] { - &self.x + self.into() } } -- cgit v1.2.3-18-g5258