From 2ac18802b58d671c10538e78d50a620baad9a188 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 7 Dec 2022 21:23:42 +0100 Subject: advanced transform --- evc/src/helpers/vector.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'evc/src/helpers/vector.rs') diff --git a/evc/src/helpers/vector.rs b/evc/src/helpers/vector.rs index 12243e4..f411832 100644 --- a/evc/src/helpers/vector.rs +++ b/evc/src/helpers/vector.rs @@ -24,6 +24,15 @@ impl + Copy> Vec2 { } } +impl + Copy> Vec2 { + pub fn scale(&self, f: T) -> Self { + Self { + x: self.x * f, + y: self.y * f, + } + } +} + impl Vec2 { pub fn x_only(&self) -> Self { Self { x: self.x, y: 0 } -- cgit v1.2.3-70-g09d2