summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/src/data_types/vector.rs12
1 files changed, 10 insertions, 2 deletions
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<Value>
pub y: Value,
}
+impl<Value> Vec2<Value>
+{
+ pub fn into_array(self) -> [Value; 2]
+ {
+ self.into()
+ }
+}
+
impl Vec2<u32>
{
pub const ZERO: Self = Self { x: 0, y: 0 };
@@ -182,9 +190,9 @@ impl Vec3<f32>
impl<Value> Vec3<Value>
{
- pub fn as_ptr(&self) -> *const Value
+ pub fn into_array(self) -> [Value; 3]
{
- &self.x
+ self.into()
}
}